Skip to content

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

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 Jun 5, 2015 · 4 comments
Labels
closed-as-intended Closed as the reported issue is expected behavior type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

Originally opened as dart-lang/sdk#22973

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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/4865287?v=3" align="left" width="48" height="48"hspace="10"> Comment by lrhn


Added Area-Pub, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


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 #1211, 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 Jun 5, 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.

@DartBot DartBot added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) closed-as-intended Closed as the reported issue is expected behavior labels Jun 5, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


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.

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 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

1 participant