nandi/clonimpublic Fork
⑂ 1119f58
Commits
⬇ Clone ▾
git clone https://git.rickub.com/nandi/clonim.git
git clone ssh://git@rickub.com/nandi/clonim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

fix: support Nimble-installed runtime archives

nandithebull committed 2026-09-22T13:19:10-07:00 Browse files
1119f58 parent: bd1db92
modified clonim.nimble +1 -1
@@ -1,4 +1,4 @@
1-version = "0.1.16"
1+version = "0.1.17"
22 author = "clonim contributors"
33 description = "A Clojure compiler hosted on Nim"
44 license = "MIT"
@@ -1,4 +1,4 @@
1-version = "0.1.16"1+version = "0.1.17"
2 author = "clonim contributors"2 author = "clonim contributors"
3 description = "A Clojure compiler hosted on Nim"3 description = "A Clojure compiler hosted on Nim"
4 license = "MIT"4 license = "MIT"
modified src/clonim.nim +9 -2
@@ -67,9 +67,16 @@ proc srcDir(): string =
6767
6868 proc runtimeLib(release: bool): string =
6969 ## Release archives place the private runtime beside bin/. A source checkout
70- ## builds the same archive into lib/ on first use.
70+ ## builds the same archive into lib/ on first use. Nimble installs the
71+ ## executable beside its sources rather than under bin/, so keep its archive
72+ ## inside the installed package; putting it in pkgs2/lib makes Nim interpret
73+ ## that directory as a malformed package on later invocations.
7174 let libName = (if release: "libclonim_runtime.a" else: "libclonim_runtime_debug.a")
72- let installed = getAppDir().parentDir / "lib" / libName
75+ let appDir = getAppDir()
76+ let installedRoot =
77+ if fileExists(appDir / "app_runtime.nim"): appDir
78+ else: appDir.parentDir
79+ let installed = installedRoot / "lib" / libName
7380 let source = srcDir() / "runtime_lib.nim"
7481 if fileExists(installed):
7582 if not fileExists(source): return installed
@@ -67,9 +67,16 @@ proc srcDir(): string =
67 67
68 proc runtimeLib(release: bool): string =68 proc runtimeLib(release: bool): string =
69 ## Release archives place the private runtime beside bin/. A source checkout69 ## Release archives place the private runtime beside bin/. A source checkout
70- ## builds the same archive into lib/ on first use.70+ ## builds the same archive into lib/ on first use. Nimble installs the
71+ ## executable beside its sources rather than under bin/, so keep its archive
72+ ## inside the installed package; putting it in pkgs2/lib makes Nim interpret
73+ ## that directory as a malformed package on later invocations.
71 let libName = (if release: "libclonim_runtime.a" else: "libclonim_runtime_debug.a")74 let libName = (if release: "libclonim_runtime.a" else: "libclonim_runtime_debug.a")
72- let installed = getAppDir().parentDir / "lib" / libName75+ let appDir = getAppDir()
76+ let installedRoot =
77+ if fileExists(appDir / "app_runtime.nim"): appDir
78+ else: appDir.parentDir
79+ let installed = installedRoot / "lib" / libName
73 let source = srcDir() / "runtime_lib.nim"80 let source = srcDir() / "runtime_lib.nim"
74 if fileExists(installed):81 if fileExists(installed):
75 if not fileExists(source): return installed82 if not fileExists(source): return installed