-
-
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
Depending on the gcc version, doing echo .. | nim c -r -
gives "can't open nm output" error
#14060
Comments
It appears to me a gcc bug? Can you try |
I tried:
That created:
When I run the script, it creates Note that even when
|
It's almost as if older gcc is returning this collect2: fatal error: can't open nm output which is perceived as a fatal error by nim compiler internally, but gcc still does things fine inspite of that. |
We don't parse the output of those commands, they are non standardized anyway, instead we check the exit code: Lines 862 to 864 in bff742c
If your gcc doesn't return a clean exit code, then we can only assume that something is wrong. |
Does the same error message happen in the script? You can add If the same happens with the script, then there's something wrong with your gcc. |
I changed the script to:
It ran and finished fine and generated the |
If I run
Does that give any clue? |
If I switch to gcc 9.1.0, I get that same ??(0, 0) Hint .. when running with verbosity 3:
|
Well the clean exit code is the universal contract :P I think what error out was gcc attempting to inspect the generated executable, but I'm not sure.
Hmm, gcc might not be playing well with how we spawn the processes. This might be a bug that got fixed in the recent gcc versions. |
Can you try |
|
Try this then: It should make gcc print out exactly what it's doing. At this point I'm not sure if it's a Nim problem. With |
So what ever that collect2 is doing is failing:
|
Well I have absolutely no idea why it's failing, maybe you can try a slightly newer gcc? Like gcc 6.5 (latest release of gcc 6)? |
I can switch among gcc 6.1.0, 7.2.0 and 9.1.0, but 6.1.0 needs to be the default due to a tool dependency. I see this issue in both 6.1.0 and 7.2.0, but not 9.1.0. I really thank you for your time! At the very least, this issue might serve to just document this issue with old gcc versions. |
I have reported this issue to the gcc mailing list: https://gcc.gnu.org/pipermail/gcc-help/2020-April/000184.html I hope we get a solution from there. |
Hello,
At work, we are using gcc 6.1.0 for stability reasons. With that gcc, passing nim code to
nim
via the stdin results in an error.That issue does not happen on gcc 9.1.0.
Example
Current Output
I get collect2: fatal error: can't open nm output: Success when I have gcc 6.1.0 loaded in my env.
Here's the same output with more debug info:
Expected Output
I get this when using gcc 9.1.0 (but I cannot have that gcc version loaded in my work env).
Additional Information
While
echo echo NimVersion | nim c -r -
gives this error, if I run the autogenerated/tmp/kmodi/.cache/nim/stdinfile_d/stdinfile
executable, I get the expected echo output.I have seen this issue before too on older nim versions, but I did not figure out then that that issue had to do with gcc version: Passing code via stdin to Nim stopped working [regression Nim 0.19+] #11294 (comment)
The same issue is seen with a bit newer gcc 7.2.0. The next gcc version I have after that is 9.1.0 (and I don't see that issue with gcc 9.1.0)
I get the same error on gcc 6.1.0 when running
echo echo NimVersion | nim c -
(without-r
)The text was updated successfully, but these errors were encountered: