This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-08
Channels
- # announcements (9)
- # babashka (17)
- # beginners (26)
- # biff (2)
- # calva (5)
- # cider (11)
- # clara (6)
- # clojure (48)
- # clojure-europe (34)
- # clojure-nl (1)
- # clojure-norway (34)
- # clojure-uk (2)
- # clojurescript (22)
- # clr (11)
- # code-reviews (5)
- # conjure (3)
- # datomic (26)
- # emacs (14)
- # fulcro (10)
- # hyperfiddle (70)
- # lsp (34)
- # malli (5)
- # missionary (5)
- # off-topic (34)
- # releases (1)
- # shadow-cljs (19)
- # tree-sitter (1)
- # xtdb (25)
@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
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 :robot_face:. 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. :ladybug: ).
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?
@U0FEXTR8Q @U03B2SRNYTY Been away for a few days. I'll take a look at this tomorrow and get back to you.
@dmiller Thanks so much! Much appreciated 🙏 Also, hope it was a good break (if it was a break).
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.
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...
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.public static IEnumerable<string> GetFindFilePaths()
{
return GetFindFilePathsRaw().Where(p => !string.IsNullOrEmpty(p)).Distinct();
}
hey that does fix the filepaths exception! @U03B2SRNYTY I'll keep poking at it. Thank you both!Woohoo, thanks both!
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 :robot_face:. 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. :ladybug: ).
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?