clr

dmiller 2024-10-22T13:20:35.659589Z

You definitely need an alpha of 1.12.0 to run cljr -- there are some required fixes and enhancements in there. cljr -X:deps tree works on my box:

PS C:\work\clojure\clr.tools.nrepl> cljr -X:deps tree
Starting exec/tool
io.github.clojure/clr.tools.reader v1.4.2
So I have to wonder if Linux is coming into play. I'll see if I can get to some testing under WSL here. It's been a while. I'm surprised aliases are not working. More details would be helpful. I use aliases for doing tests on all the libraries. I'm not familiar with 'exit code passthrough'. Could you elaborate?

weavejester 2024-10-22T18:27:14.854029Z

It doesn't seem to pick up aliases. That is, it's as if the command like option was missing. By exit code passthrough I mean that cljr should return the exit code of the application being executed. So if I have an application with (System.Environment/Exit 1), the exit code from running it with cljr should be 1. The issue came up as a result of https://github.com/weavejester/medley/pull/96 - the submitter had put in a few hacks to get cljr to work, and when I tried I had the same issues they did.

weavejester 2024-10-22T18:50:40.506729Z

$ cljr -X:deps tree
Starting exec/tool
Unqualified function can't be resolved: tree
I'm wondering if there's something subtle going on around the argument parsing.

dmiller 2024-10-22T18:51:02.545439Z

If you have any samples that might shed light on the alias issue, please share. I have done basic testing, as I mentioned, but there may be situations where it falls short. I'll get a fix up for the exit code. Missed that in the original source.

dmiller 2024-10-22T18:53:38.318289Z

I'm going to guess a Linux difference on the arg problem. There was some special case code for Windows arg handling in the clj source. Perhaps my version messes up for non-Windows. If I don't get to it today, I'll be sitting in my hotel room tomorrow afternoon and evening in advance of the Conj. Seems fitting to work on it there. 🙂

weavejester 2024-10-22T18:57:20.389559Z

We were trying to get a test runner working. The contributor originally looked at https://github.com/clojure/clr.core.cli?tab=readme-ov-file#running-tests, but had to add a number of hacks to get it working, see: https://github.com/weavejester/medley/blob/88092c6e812c719aa3a4c657a7a70b6bbc112a0d/.github/workflows/test.yml#L39. The GitHub action in the PR could be a basis for some Linux-based smoke tests to check basic features like aliases etc. I should add that there's no hurry to fix this (at least on my end!), please enjoy the Conj.

2024-10-22T19:18:30.521719Z

I think you may be right in that this issue is linux-specific. I’m using MacOS and getting the same Unqualified function message from cljr -X:deps tree.

2024-10-22T19:21:47.157539Z

There is no hurry on my end either! This can wait until after Conj.

dmiller 2024-10-22T19:35:22.220109Z

That should be enough of a hint to make progress. Thx.

dmiller 2024-10-23T03:33:48.646089Z

Not that you need the blow-by-blow description, but the error does not appear to be in the C# code that parses the command line args and then passes them to Clojure (which runs the -main in clojure.run.exec). The same args are getting passed to the Clojure process on Linux as on Windows. Which leaves either the code that computes the classpath, basis, etc. and the code executes the tools: clojure.run.exec/-main. At least two errors are making an appearance under Linux. (Runs just fine under Windows.)

cljr -X:deps tree
Starting exec/tool
Unqualified function can't be resolved: tree

 cljr -X:test
Starting exec/tool
No function found on command line or in :exec-fn
There are two slight differences in the .basis file generated on Linux vs Windows. That should be fun to debug.

🪲 1
🐛 1
2024-10-27T16:07:50.202359Z

This is working great! Aliases are now getting applied as expected.

2024-10-27T16:27:12.199819Z

Thanks for your work on this. There’s still the issue of exit codes not propagating up from clojure, which means I still need to use a test-runner wrapper to force GitHub steps to fail. Once that’s done, however, I think that should take care of everything on our end.

dmiller 2024-10-27T17:09:42.898119Z

I had this nagging feeling I had forgotten something. It was late. Alpha4 just pushed to nuget with a fix for the exit code.

2024-10-27T17:10:34.610469Z

That was fast. I’ll check it out soon. Thank you!

2024-10-27T17:43:19.446989Z

Looks to be working on my mac as well as in GitHub actions

🎉 1
dmiller 2024-10-27T03:42:15.671169Z

Okay, back from the Conj. Lots of great talks! I just published version 0.1.0-alpha3. Things now work on Linux. Running Ubuntu under WSL:

david@DESKTOP-IBDM5GL:~/test/clr.core.memoize$ cljr -X:deps tree
Starting exec/tool
io.github.clojure/clr.core.cache v1.1.234
  . io.github.clojure/clr.data.priority-map v1.2.0
david@DESKTOP-IBDM5GL:~/test/clr.core.memoize$ cljr -X:test
Starting exec/tool

Running tests in #{"src/test/clojure"}

Testing with Clojure 1.12.0-alpha10

Testing clojure.core.memoize-test

[... test output omitted ... ]

Ran 17 tests containing 206 assertions.
0 failures, 0 errors.
It took me a while to track down, but it turned out to be something simple. There was a hack in the command-line arguments being passed to the program that creates the classpath, basis and other info. Each argument was wrapped in double-quotes. Code comments indicate this had to do with some issue with Powershell dealing with colons in the arguments. So I conditionalized the code to not do that on non-Windows. That seemed to have solved the problem, as evidenced above. Let me know how it goes for you.

👀 1
weavejester 2024-10-22T06:45:01.355409Z

I've been trying out cljr 0.1.0-alpha2 with Clojure-CLR 1.12.0-alpha10 under Ubuntu 24.10 with .NET 8.0. I'm not sure what's going wrong, but aliases, exit code passthrough and dependency resolution all seem to be non-functional (even cljr -X:deps tree claims that 'tree' cannot be resolved). I tried downgrading to ClojureCLR 1.11.0 (using dotnet tool), but that version seems to require .NET 6.0, which doesn't appear to have an available package for my Linux version. Does anyone have any ideas, or is this a known issue? I notice that @archibald.pontier_clo was having similar issues to me.