clr

2024-06-27T14:30:07.469639Z

I tried installing cljr or windows but I'm getting an error when I run cljr.

2024-06-27T14:30:19.425569Z

Unhandled exception. System.IO.FileNotFoundException: Could not find file 'C:\Users\Paul Dumais\.clojure\.cpcache\D504A11022EB3B0AD69BDCB04ED9D390.cp'.
File name: 'C:\Users\Paul Dumais\.clojure\.cpcache\D504A11022EB3B0AD69BDCB04ED9D390.cp'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.ReadAllText(String path, Encoding encoding)
   at Cljr.Program.Main(String[] args) in C:\work\clojure\clr.core.cli\src\dotnet\Cljr\Program.cs:line 380Unhandled exception. System.IO.FileNotFoundException: Could not find file 'C:\Users\Paul Dumais\.clojure\.cpcache\D504A11022EB3B0AD69BDCB04ED9D390.cp'.
File name: 'C:\Users\Paul Dumais\.clojure\.cpcache\D504A11022EB3B0AD69BDCB04ED9D390.cp'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.ReadAllText(String path, Encoding encoding)
   at Cljr.Program.Main(String[] args) in C:\work\clojure\clr.core.cli\src\dotnet\Cljr\Program.cs:line 380

2024-06-27T14:31:34.998849Z

Here are may global dotnet tools:

λ dotnet tool list -g
Package Id        Version           Commands
------------------------------------------------
clojure.cljr      0.1.0-alpha2      cljr
clojure.main      1.11.0            Clojure.Main

dmiller 2024-06-27T21:10:49.956489Z

I think you'll need to update clojure.main to the last alpha of 1.12.0. There are changes in there required to run clojure.cljr .

👍 1
2024-07-03T12:29:21.360479Z

No rush, I have other fish to fry.

2024-06-28T12:32:03.996729Z

2024-06-28T12:32:28.851589Z

Ok, I updated both but I still have the same error.

λ dotnet tool list -g
Package Id        Version            Commands
-------------------------------------------------
clojure.cljr      0.1.0-alpha2       cljr
clojure.main      1.12.0-alpha9      Clojure.Main
I seem to have a bad dotnet install or vcredist. I have those being installed via scoop. When I run the cljr command I get the error above but it also prompts me to open a file called 'Paul' in my C/Users folder which contains the following the snippet I posted above.

2024-06-28T13:27:26.943869Z

I deleted the file 'Paul' as suggested here: https://answers.microsoft.com/en-us/windows/forum/all/strange-message-on-startup/e9cb9aba-c871-4e81-892c-cf83de65b89d but now I get:

λ cljr
C:\Users\Paul : The term 'C:\Users\Paul' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ C:\Users\Paul Dumais\.dotnet\tools\.store\clojure.cljr\0.1.0-alpha2\c ...
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\Paul:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

2024-06-28T13:31:22.759609Z

It looks like some file was supposed to be written as an executable script but the path got truncated at the space in my username.

dmiller 2024-06-28T13:33:24.600119Z

That's a clue. cljr doesn't write any script files directly, but some reference to your user directory might need escaping in some way. I'll take a look later today and see what I can find. Thanks for all the investigatory work.

2024-06-28T13:35:28.403989Z

Thanks for looking into this. I'm wondering if I should uninstall my scoop-mananged installs just in case it's introducing some path escaping issues.

dmiller 2024-06-28T13:54:06.729629Z

I'm not familiar with scoop. I'll leave you to contemplate that. I have to step away. I'll take a look when I get back.

👍 1
dmiller 2024-07-02T16:08:12.860639Z

I haven't forgotten. Just got buried in ClojureCLR.Next.

👍 1