clr

selfsame 2023-09-08T04:32:35.784939Z

@dmiller hi! small issue https://github.com/clojure/clojure-clr/blob/master/Clojure/Clojure/Lib/RT.cs#L3404 can return an empty string on net 5+ which throws a System.ArgumentNullException. https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.location?view=net-7.0 says that "In .NET 5 and later versions, for bundled assemblies, the value returned is an empty string." apologies for not using JIRA couldn't figure out an account

Daniel Gerson 2023-11-07T16:36:08.503799Z

I tried, but it's still failing. It could be that it's not seeing my change. Unfortunately I can't get debugging working in the library code (works in the first ArcadiaHook.cs file) despite copying the PDBs and messing around with "justMyCode":false, in VsCode. Perhaps something about the way that it launches natively and then loads .NET (unfamiliar with Godot). Or perhaps it doesn't like my Apple M1 Pro (I have an Alienware Windows PC I could get up and running). Lots of slow downs re process including realising that I needed .NET 7.0 even though I only want the .NET 6.0 DLLs (CLR won't build). Don't think I want to pick it up again unless I get debugging working, or I'm liable to just hit the next road block...

Daniel Gerson 2023-11-07T16:42:44.297899Z

static IEnumerable<string> GetFindFilePathsRaw()
        {
            yield return System.AppDomain.CurrentDomain.BaseDirectory;
            yield return Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "bin");
            yield return Directory.GetCurrentDirectory();

            Assembly assy = Assembly.GetEntryAssembly();
            if ( assy != null)
            {
                string assyLocation = Path.GetDirectoryName(assy.Location);
                if (!string.IsNullOrEmpty(assyLocation))
                    yield return Path.GetDirectoryName(assy.Location);
            }
Your change looks nicer than mine 😂 . Clearly I'm not a C# person.

dmiller 2023-11-08T03:58:54.981799Z

Let's combine. my filter really should use IsNullOrEmpty or IsNullOrWhitespace.

selfsame 2023-11-08T04:29:13.359379Z

public static IEnumerable<string> GetFindFilePaths()
        {
            return GetFindFilePathsRaw().Where(p => !string.IsNullOrEmpty(p)).Distinct();
        }
hey that does fix the filepaths exception! @danielmgerson I'll keep poking at it. Thank you both!

🎉 1
dmiller 2023-11-06T06:09:20.098959Z

Hit crunch time on a project. At this point in life, only so much focus to go around. I should be back being more active in another week or so. I missed the original post. Don't hesitate to reach out to me directly in whatever channel works, including email. The quick fix is just to drop in this replacement (just above the method listed above): public static IEnumerable<string> GetFindFilePaths() { return GetFindFilePathsRaw().Where(p => p != null).Distinct(); } Assuming you don't mind compiling the C# source. I should be able to get another alpha release out tomorrow.

Daniel Gerson 2023-10-25T20:20:24.719059Z

Thought I'd just add some context for ☝️, given this question looks stale. Selfsame is maintaining a Clojure bridge (bootstrap and Arcadia API) for the Godot game engine 🤖. He's trying to upgrade to the shiny https://godotengine.org/article/godot-4-1-is-here/ but has hit a snag with the latest CLR Clojure.dll , which https://github.com/arcadia-unity/ArcadiaGodot/blob/godot4/journal.md. The issue appears to be related to step 4 from the https://github.com/clojure/clojure-clr/blob/master/docs/what-a-load-of-clojure.md#where-do-we-look CLR supporting doc, which suggests step 4 may be redundant anyway!? I'm not entirely sure why this code path doesn't trigger in other scenarios, but I can confirm it triggers when the Godot bootstrap code RT.load("clojure/core"); runs https://github.com/arcadia-unity/ArcadiaGodot/blob/godot4/ArcadiaHook.cs#L104. The reason in this case is as he's mentioned above. (Further to his explanation`Path.GetDirectoryName` returns null for the empty string passed, which Path.Combine finally errors on. 🐞 ). If the offending line (step 4) can't be removed, or put behind a flag, is it possible that Selfsame can please be assisted by someone who knows the CLR?

💯 4
Daniel Gerson 2023-11-08T11:08:36.300619Z

Woohoo, thanks both!

Daniel Gerson 2023-11-04T08:12:34.793189Z

@dmiller Thanks so much! Much appreciated 🙏 Also, hope it was a good break (if it was a break).

dmiller 2023-11-03T03:26:25.312709Z

@selfsame @danielmgerson Been away for a few days. I'll take a look at this tomorrow and get back to you.

dmiller 2024-02-22T20:08:10.192429Z

The patch is in the alpha9 release as of today.

🙌 1