Skip to content

Replace bash shebang with '#!/usr/bin/env bash" for portability#34543

Merged
joaomoreno merged 1 commit into
microsoft:masterfrom
ultimaweapon:bash-shebang
Sep 20, 2017
Merged

Replace bash shebang with '#!/usr/bin/env bash" for portability#34543
joaomoreno merged 1 commit into
microsoft:masterfrom
ultimaweapon:bash-shebang

Conversation

@ultimaweapon

Copy link
Copy Markdown
Contributor

The example system that does not put bash in a /bin directory is FreeBSD. Instead, they put it inside /usr/local/bin.

@msftclas

msftclas commented Sep 17, 2017

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@joaomoreno

Copy link
Copy Markdown
Member

There is no Electron for FreeBSD.

Did you hit some actual issue?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Sep 18, 2017
@ultimaweapon

ultimaweapon commented Sep 18, 2017

Copy link
Copy Markdown
Contributor Author

I'm trying to port VS Code to FreeBSD. So, this PR is a first step.

@Tyriar Tyriar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does seem to be the best for portability 👍 https://stackoverflow.com/a/10383546/1156119

@Tyriar Tyriar removed their assignment Sep 18, 2017
@joaomoreno joaomoreno merged commit ff8954e into microsoft:master Sep 20, 2017
@joaomoreno

Copy link
Copy Markdown
Member

Thanks!

@joaomoreno joaomoreno added this to the September 2017 milestone Sep 20, 2017
@joaomoreno joaomoreno added engineering VS Code - Build / issue tracking / etc. and removed info-needed Issue requires more information from poster labels Sep 20, 2017
@joaomoreno

Copy link
Copy Markdown
Member

@Tyriar This broke your publish scripts:

2017-09-25T05:22:58.0228590Z *****************************************************************************
2017-09-25T05:22:58.0248040Z Start: Publish to repositories
2017-09-25T05:22:58.0267650Z *****************************************************************************
2017-09-25T05:22:58.0295740Z /usr/bin/env: bash -e: No such file or directory

This is why I don't like PRs which don't fix an actual problem. Reverted that file: d99c7d8

@Tyriar

Tyriar commented Oct 6, 2017

Copy link
Copy Markdown
Contributor

I reverted the remainder of this commit in e29c517, it caused issues with Lintian on the deb package: #35638

@ultimaweapon

Copy link
Copy Markdown
Contributor Author

Sorry for the problems. I will investigate these problems later when I have free time.

@julie-is-late

julie-is-late commented Oct 10, 2017

Copy link
Copy Markdown

not sure if you figured this out already, but #!/usr/bin/env has issues when you try to give the commands arguments like your bash -e from above. I've run into it before trying to do something like #!/usr/bin/env awk -f. It likes to try to parse all of the arguments together as one input to env, almost like it's making a call similar to env "$@" and mashing everything together. This is at least the case with GNU coreutils' env, it's reported to work on BSD, not that that's much help here though.
It looks like you already caught it in d99c7d8

@Tyriar

Tyriar commented Oct 11, 2017

Copy link
Copy Markdown
Contributor

@jshap70 that was the first problem that was hit

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

engineering VS Code - Build / issue tracking / etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants