Skip to content

When pub creates executable script, it doesn't work on Linux Mint / Ubuntu due to use of sh #22973

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 Mar 24, 2015 · 5 comments
Labels
closed-as-intended Closed as the reported issue is expected behavior

Comments

@DartBot
Copy link

DartBot commented Mar 24, 2015

This issue was originally filed by [email protected]


For example, the following script generated for csp_fixer fails to run on linux mint, as 'sh' is really dash, and a really restricted shell

!/usr/bin/env sh

This file was created by pub v1.8.5.

Package: csp_fixer

Version: 0.1.3

Executable: csp_fixer

Script: csp_fixer

dart "/home/daniel/.pub-cache/global_packages/csp_fixer/bin/csp_fixer.dart.snapshot" "$@"

csp_fixer some/path

fails with "dart not found"

but bash has PATH properly set up, and dart can be run from the shell prompt

PATH is not being forwarded to sh, or sh on Mint ( which is supplied by dash ) doesn't properly support it.

Some method should be provided to change the shell used, or perhaps a more universal option found.

cf bug dart-archive/pub-dartlang#271

@lrhn
Copy link
Member

lrhn commented Mar 25, 2015

Added Area-Pub, Triaged labels.

@nex3
Copy link
Member

nex3 commented Mar 25, 2015

I suspect you have your PATH configured improperly; I can't imagine that it wouldn't respect PATH, since not only is it part of the spec, it's crucial to executing anything ever. When we fixed issue #21854, we ran the "checkbashisms" script to be sure we weren't accidentally doing anything wrong, and it came up clean, indicating that we weren't relying on any bash-specific in these scripts anymore.


Added AsDesigned label.

@DartBot
Copy link
Author

DartBot commented Mar 27, 2015

This comment was originally written by [email protected]


Path is set fine. The problem is SH under Ubuntu is DASH, and the generated script has bashisms that Dash doesn't support.

https://wiki.ubuntu.com/DashAsBinSh

The biggest I suspect is this:

dash doesn't expand ~ on path search

Given how many people use ~ in their PATH when referring to local installs.

@nex3
Copy link
Member

nex3 commented Mar 27, 2015

That does sound like PATH is set incorrectly. If you want to use Dash as your default shell, you shouldn't put Dash-incompatible stuff in the environment variables it reads.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-as-intended Closed as the reported issue is expected behavior
Projects
None yet
Development

No branches or pull requests

4 participants