Skip to content

pub's binstubs should set #!/bin/bash explicitly #21854

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

Closed
DartBot opened this issue Dec 11, 2014 · 9 comments
Closed

pub's binstubs should set #!/bin/bash explicitly #21854

DartBot opened this issue Dec 11, 2014 · 9 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Dec 11, 2014

This issue was originally filed by @seaneagan


From seaneagan/den#7:

This seems to be the culprit http://stackoverflow.com/a/17753098/217408 (/bin/sh -> dash) and dash seems not to support [[ according to the SO answer.

Do you consider changing the first line in /home/myuser/.pub-cache/bin/den to #!/bin/bash, which fixes the issue for me?

[[ is bash specific and according to http://lwn.net/Articles/343924/ the script file should set #!/bin/bash explicitly in this case. Contains some other interesting background I wasn't aware of.

@sethladd
Copy link
Contributor

Not everyone uses bash, though?


Removed Type-Defect label.
Added Type-Enhancement, Area-Pub, Triaged labels.

@nex3
Copy link
Member

nex3 commented Dec 12, 2014

We could also just use [ ] rather than [[ ]], right?

@DartBot
Copy link
Author

DartBot commented Dec 12, 2014

This comment was originally written by @seaneagan


They don't have to use it though, just have to have it installed, so that
the binstubs can use it.

@nex3
Copy link
Member

nex3 commented Dec 12, 2014

Set owner to @nex3.
Added Started label.

@nex3
Copy link
Member

nex3 commented Dec 12, 2014

Fixed in r42308.


Added Fixed label.

@DartBot
Copy link
Author

DartBot commented Dec 12, 2014

This comment was originally written by @zoechi


Great! Works fine now.

@DartBot
Copy link
Author

DartBot commented Dec 12, 2014

This comment was originally written by @seaneagan


Thanks! Looks like the pub executable also uses [[, but it has #!/bin/bash. Should that be changed to be consistent with the binstubs? Not sure if the pub executable uses any other bash-specific features.

Cygwin is also not properly supported by the binstubs and the pub executable, see issue #20822. This means you have to call pub.bat or e.g. den.bat instead of just pub or den, and also that it's impossible to write shell scripts that call these executables and work cross-platform (cygwin and linux/mac).

@nex3
Copy link
Member

nex3 commented Dec 15, 2014

Thanks! Looks like the pub executable also uses [[, but it has #!/bin/bash. Should that be changed to be consistent with the binstubs? Not sure if the pub executable uses any other bash-specific features.

Feel free to file an issue for this, although it's much less urgent since it's not actually breaking anyone.

Cygwin is also not properly supported by the binstubs and the pub executable, see issue #20822.

I believe Cygwin is not an officially supported platform right now.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#1211.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants