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

Compiler bug when a macro uses run() with spaces in the path #5919

Closed
obskyr opened this issue Apr 4, 2018 · 4 comments
Closed

Compiler bug when a macro uses run() with spaces in the path #5919

obskyr opened this issue Apr 4, 2018 · 4 comments

Comments

@obskyr
Copy link

obskyr commented Apr 4, 2018

Try the following examples, lifted more or less straight from the docs:

directory with spaces/print_gotten_string.cr:

macro get_version
    {{ run("./get_string").stringify }}
end

puts get_version

directory with spaces/get_string.cr:

puts "Hi!"

Running crystal run print_gotten_string.cr errors out with the following message:

can't specify arguments in both, command and args without including "${@}" into your command
???
???
???
???
???
???
???
???
???
???
???
???
???
???
???
???
???
???
???
???
???

Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues

It looks like Process.prepare_argv is getting the parts of the path as arguments instead of the entire path being passed in as the command.

@obskyr obskyr changed the title Compiler errors out when a macro uses run() with spaces in the path Compiler bug when a macro uses run() with spaces in the path Apr 5, 2018
@obskyr
Copy link
Author

obskyr commented Apr 5, 2018

Changed title to reflect the fact that it doesn't error out gracefully.

@asterite
Copy link
Member

asterite commented Apr 5, 2018

Should have been fixed by #5543 , but probably not released in some of the past releases because of GitFlow.

@straight-shoota
Copy link
Member

There has only been the release of 0.24.2 since the merge and that did only include some bugfixes but not #5543

But I can confirm this issue is fixed in master.

@jhass jhass closed this as completed Apr 5, 2018
@obskyr
Copy link
Author

obskyr commented Apr 5, 2018

Terrific, thanks!

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