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 · 3 comments

Comments

Projects
None yet
4 participants
@kaushalmodi
Copy link
Contributor

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: JRaspass/code-golf#86 (comment)

@mratsim mratsim added the Regression label May 23, 2019

@Araq Araq closed this in cacd6d1 May 24, 2019

@kaushalmodi

This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2019

@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

This comment has been minimized.

Copy link
Member

commented May 24, 2019

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

@Clyybber

This comment has been minimized.

Copy link
Contributor

commented May 25, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.