Skip to content
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

Passing code via stdin to Nim stopped working [regression Nim 0.19+] #11294

Closed
kaushalmodi opened this issue May 21, 2019 · 4 comments
Closed

Comments

@kaushalmodi
Copy link
Contributor

kaushalmodi commented May 21, 2019

In Nim 0.18.0 and earlier, it was possible to pass it code via stdin. But the same method of passing code via stdin doesn't work in Nim 0.19.0+.

Example

echo echo NimVersion | nim -r c -  

Current Output

In Nim 0.19.0+, we get this error:

command line(1, 2) Error: invalid command line option: '-'

Expected Output

Should print the value of NimVersion.

Additional Information

Ref: code-golf/code-golf#86 (comment)

@kaushalmodi
Copy link
Contributor Author

@Araq This issue is still not fixed for me.

> echo echo NimVersion | nim -r c -
Hint: used config file '/home/kmodi/usr_local/apps/6/nim/devel/config/nim.cfg' [Conf]
Hint: used config file '/home/kmodi/usr_local/apps/6/nim/devel/config/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: stdinfile [Processing]
CC: stdinfile
Hint:  [Link]
collect2: fatal error: can't open nm output: Success
compilation terminated.
Error: execution of an external program failed: 'gcc   -o /home/kmodi/sandbox/nim/bug_reports/nim_doc__wrong_file_name_in_idx/-  /tmp/kmodi/.cache/nim/-_d/stdlib_io.c.o /tmp/kmodi/.cache/nim/-_d/stdlib_system.c.o /tmp/kmodi/.cache/nim/-_d/stdinfile.c.o  -lm   -ldl'

Looks like now the echo echo NimVersion | nim -r c - command creates a binary named - literally!

.rwxr-xr-x 85k kmodi 24 May 13:14 -*

@Araq
Copy link
Member

Araq commented May 24, 2019

Works on Windows and afaict it never worked better, so it's not a regression anymore, shrug.

@Clyybber
Copy link
Contributor

Clyybber commented May 25, 2019

You can always use /dev/stdin instead of -.
I also can't remember - working.
This should still be fixed though..

@kaushalmodi
Copy link
Contributor Author

@timotheecour Thanks for your fix in 1f7c907

Now it works!!

> echo echo NimVersion | nim -r --hints:off c -
1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants