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

Sublime Text tries to use /bin/bash when executing commands for build systems #12011

Closed
neilmayhew opened this issue Dec 29, 2015 · 5 comments
Closed

Comments

@neilmayhew
Copy link
Member

See line 66 of exec.py in /nix/store/*-sublimetext3-3083-bin/Packages/Default.sublime-package

I assume this applies to any shell command, not just those for build systems, but building is where it's particularly noticeable.

Default.sublime-package is a zip file, so it will need to be unpacked, patched and repacked.

@neilmayhew
Copy link
Member Author

The following changes work well for me when I use them in ~/.config/sublime-text-3/Packages/Default/exec.py. Maybe this could be used as the patch file.

exec.py.diff.txt

@wmertens
Copy link
Contributor

I agree, that patch looks good. Should be pretty easy to apply to the Sublime build. Any takers?

On phone, sorry for brevity…

@mogria
Copy link
Contributor

mogria commented Mar 2, 2017

I tried to fix this in on my repo with this commit mogria@e6dccbc
(branch https://github.com/mogria/nixpkgs/commits/sublime3-fix-hardcoded-bash)

The derivation builds successfully and replaces the instances of /bin/bash with /usr/bin/env bash. I opted to use substituteInPlace instead of a patch, because it didn't apply.

Now when I start a build with a simple Makefile like this:

all:
	touch made

clean:
	rm made

The following error appears in the Sublime-Text console:

/usr/bin/env: relocation error: /nix/store/68sa3m89shpfaqq1b9xp5p1360vqhwx6-glibc-2.25/lib/libdl.so.2: symbol _dl_catch_error, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

mogria added a commit to mogria/nixpkgs that referenced this issue Mar 2, 2017
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.
@yorickvP
Copy link
Contributor

yorickvP commented Mar 5, 2017

That sounds like it's trying to link to the wrong libc somehow.
I would suggest using a direct path to a bash from the nix store (${bash}/bin/bash I suppose) in case it tries to exec it directly. I'm not sure how to debug the new error, strace might sound like a good idea.

mogria added a commit to mogria/nixpkgs that referenced this issue Mar 6, 2017
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 issue 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.
globin pushed a commit that referenced this issue 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 issue 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.
@calvertvl
Copy link
Contributor

@Mic92, @globin: This change was cherry-picked to 17.03 but not 16.09; it looks to me like it would not have any conflicts.

As it is a bug, it should probably be cherry-picked to 16.09, followed by closing this issue.

Mic92 pushed a commit that referenced this issue 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)
@Mic92 Mic92 closed this as completed Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants