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

sublime3: fix hardcoded /bin/bash when executing commands for build systems #23561

Merged
merged 2 commits into from Mar 15, 2017

Conversation

mogria
Copy link
Contributor

@mogria mogria commented Mar 6, 2017

Motivation for this change

See Issue #12011. You can now run Builds from within Sublime Text.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

exec.py in Default.package-sublime calls /bin/bash with subprocess.
See Issue NixOS#12011. Because of this builds could not be started from
withtin Sublime Text.
Without the wrapped version of bash (a symlink to $bash/bin/bash)
with LD_PRELOAD to glibc an relocation error occurs when trying
to run builds from within Sublime Text 3.  See Issue NixOS#12011.
@mention-bot
Copy link

@mogria, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ixmatus, @wmertens and @codyopel to be potential reviewers.

${unzip}/bin/unzip ../Packages/Default.sublime-package > /dev/null
substituteInPlace "exec.py" --replace \
'["/bin/bash"' \
'["/usr/bin/env", "bash"'
Copy link
Member

Choose a reason for hiding this comment

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

how about?

substituteInPlace "exec.py" --replace \
  '["/bin/bash"' \
  '["${pkgs.bash}/bin/bash"'

Copy link
Member

Choose a reason for hiding this comment

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

Just noticed that you have already revert this change.

'["/bin/bash"' \
'["/usr/bin/env", "bash"'
"[\"/bin/bash\"" \
"[\"$out/sublime_bash\""
Copy link
Member

Choose a reason for hiding this comment

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

Would not my solution has the same effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So is this fine? As you've said, It's already revised in the second commit.

@mogria
Copy link
Contributor Author

mogria commented Mar 15, 2017

Is there any issue with this? Can this be merged?

@Mic92 Mic92 merged commit 1893ed5 into NixOS:master Mar 15, 2017
@Mic92
Copy link
Member

Mic92 commented Mar 15, 2017

Thanks!

globin pushed a commit that referenced this pull request Mar 15, 2017
…ystems (#23561)

* sublime3: replace hardcoded /bin/bash with /usr/bin/env

exec.py in Default.package-sublime calls /bin/bash with subprocess.
See Issue #12011. Because of this builds could not be started from
withtin Sublime Text.

* sublime3: use wrapped of bash to fix internal build system

Without the wrapped version of bash (a symlink to $bash/bin/bash)
with LD_PRELOAD to glibc an relocation error occurs when trying
to run builds from within Sublime Text 3.  See Issue #12011.

(cherry picked from commit 1893ed5)
peterhoeg pushed a commit to peterhoeg/nixpkgs that referenced this pull request Mar 16, 2017
…ystems (NixOS#23561)

* sublime3: replace hardcoded /bin/bash with /usr/bin/env

exec.py in Default.package-sublime calls /bin/bash with subprocess.
See Issue NixOS#12011. Because of this builds could not be started from
withtin Sublime Text.

* sublime3: use wrapped of bash to fix internal build system

Without the wrapped version of bash (a symlink to $bash/bin/bash)
with LD_PRELOAD to glibc an relocation error occurs when trying
to run builds from within Sublime Text 3.  See Issue NixOS#12011.
Mic92 pushed a commit that referenced this pull request Jun 1, 2017
…ystems (#23561)

* sublime3: replace hardcoded /bin/bash with /usr/bin/env

exec.py in Default.package-sublime calls /bin/bash with subprocess.
See Issue #12011. Because of this builds could not be started from
withtin Sublime Text.

* sublime3: use wrapped of bash to fix internal build system

Without the wrapped version of bash (a symlink to $bash/bin/bash)
with LD_PRELOAD to glibc an relocation error occurs when trying
to run builds from within Sublime Text 3.  See Issue #12011.

(cherry picked from commit 1893ed5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants