-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shim's cause issues and should be replaced by symlinks #16838
Comments
This is not a Nim issue but a choosenim issue. |
yes, but it affects nim ecosystem (including testament use in nimble packages, see example 1), and existing issues in choosenim were closed:
that means there is 0 open issue tracking this, anywhere. |
I think @dom96 won't mind patches to choosenim. |
shims are the wrapper processes generated by choosenim via proxyexe.nim instead of the conventional symlinks. They cause a number of issues, as shown here.
Example 1: breaks testament use in nimble
Current Output
Expected Output
works
Notes:
which testament
prints:/Users/timothee/.nimble//bin/testament
nim c -o:/Users/timothee/.nimble//bin/testament testament/testament.nim
(works meaning it doesn't have the above mentioned issue; note that testament: fix #16829, fix partially #16830 #16831 is also needed after that, but for unrelated reasons)Example 2: breaks debugging with lldb
lldb -o r -o quit /Users/timothee/.nimble//bin/testament
fails with:Error: Spawning of process failed. (Error was: Interrupted system call)
Info: If unexpected, please report this error to https://github.com/dom96/choosenim
note that the same command works if /Users/timothee/.nimble//bin/testament is a symlink to a testament binary or if it's a testament binary itself (eg as generated by
nim c -o:/Users/timothee/.nimble//bin/testament testament/testament.nim
)Example 3
same as example 2 but with /Users/timothee/.nimble//bin/nim
Example 4
shim doesn't provide you with the path to the target binary (whereas with a symlink it's easily obtainable via
ls -l
for example); in particular, it's not at all clear what is the real binary /Users/timothee/.nimble//bin/testament points tonote that this is the main reason for adding
nimExe
:but this doesn't help for other binaries wrapped in a shim.
on OSX I figured it what it pointed to via
dtruss
as follows:sudo dtruss -a -t stat64 /Users/timothee/.nimble//bin/testament 2>&1 | grep testament
=> it resolved to /Users/timothee/git_clone/nim/Nim_devel/bin/testament
obviously, this isn't portable nor desirable. At the very least, choosenim (which is responsible for generating shims / binary wrappers), and in particular
choosenim/src/choosenimpkg/proxyexe.nim
, should allow an easy way to reveal the wrapped binary, eg via an environment variable CHOOSENIM_DEBUG or a cmdlinetestament --choosenim:debug
that'd be intercepted inproxyexe.parseCliParams
. This would be an improvement but still wouldn't replace the other issues.Example 5: breaks nimeval.findNimStdLib
see comment there:
Example 6:
regression since 1.4.2: vm crash with lists.SinglyLinkedRing · Issue #16384 · nim-lang/Nim
difference in behavior:
Additional Information
which testament
prints:/Users/timothee/.nimble//bin/testament
Error: Spawning of process failed
caused by choosenim using a wrapper process (shim) instead of symbolic link dom96/choosenim#126, use symlinks instead of shims where symlinks are supported dom96/choosenim#189; even though shims are generated in https://github.com/dom96/choosenim instead of nim repo, this is a nim ecosystem issue that affects tooling in general as shown in above example (and some of those issues were marked as wontfix in choosenim even though the issue is still there)/the argument that "windows doesn't windows symlinks therefore we should use shims instead of symlinks on all platforms" IMO is moot, given that windows does support symlinks and we shouldn't limit other platforms based on lowest common denominator; see also #16784 which discusses improving symlink support on windows.
note
nimble already uses symlinks so there's a precedent for that:
The text was updated successfully, but these errors were encountered: