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

add a wrapper to gdb which adds gcc (or other paths) as safe path #11139

Closed
wants to merge 2 commits into from

Conversation

fkz
Copy link
Contributor

@fkz fkz commented Nov 19, 2015

This fixes #10427. Though I'm not sure if defaulting to adding gcc is the right way to do it.

@fkz fkz force-pushed the fix-gdb branch 2 times, most recently from aa04795 to 6e3e580 Compare November 19, 2015 04:51
@dezgeg
Copy link
Contributor

dezgeg commented Nov 19, 2015

I think this would make gdb manpages not show up in the Nix profile path.

@fkz
Copy link
Contributor Author

fkz commented Nov 19, 2015

you're right, I thought the propagatedBuildInput would magically do the trick when in fact we need propagatedUserEnvPkgs and then you also have to run the default builder...
Anyway, now it seems to work. Alternatively, we could also create a symlink tree with buildEnv

@fkz fkz force-pushed the fix-gdb branch 2 times, most recently from f4b04e6 to eb3aab1 Compare November 19, 2015 13:03
@fkz
Copy link
Contributor Author

fkz commented Nov 28, 2015

hm, travis seems only to fail because 'no space left on device'. Not sure why it rebuilds so much, maybe a lot of qt/kde depends on gdb.
So, this works for me now, but thinking a little more about it I think it would be better to add some hook that adds all (or some?) packages of the current build environment to the safe gdb path. The problem is that, afaik gdb doesn't read any environment variables to add safe paths. So we have to add a "-x initscript" flag to the gdb call which this wrapper does, but I don't see how we can do this depending on hooks. An alternative might be to patch gdb to include an init script that reads the safe paths from some environment variable and then just change them in the hook. I'm also not sure how this works in the "nix-env -iA gdb"/environment.systemPackages=[gdb] case.
I'm also not completely sure of the security implications of adding all buildInputs to the safe paths, but I think you trust your buildInputs anyway.
Any comments?

@rasendubi
Copy link
Member

(triage) @fkz any update?

@schmittlauch
Copy link
Member

Just ran into #10427 again, this still needs fixing.

@@ -5897,13 +5897,15 @@ let
ruby = ruby_2_0_0;
};

gdb = callPackage ../development/tools/misc/gdb {
gdbWithoutWrapper = callPackage ../development/tools/misc/gdb {
Copy link
Member

@Mic92 Mic92 Nov 5, 2018

Choose a reason for hiding this comment

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

Commonly we use the -unwrapped suffix instead.

@Mic92
Copy link
Member

Mic92 commented Nov 5, 2018

A quick hack if you trust your nix store would be:

# ~/.gdbinit
set auto-load safe-path /nix

@tmplt
Copy link
Member

tmplt commented Mar 21, 2019

Are there plans to fix and merge this? I can reproduce #10427 in 18.09, stable at aabc610.

@mmahut
Copy link
Member

mmahut commented Aug 1, 2019

Any update on this pull request?

@mmahut
Copy link
Member

mmahut commented Aug 19, 2019

Closing due to lack of activity, feel free to reopen this if needed.

@mmahut mmahut closed this Aug 19, 2019
@tmplt
Copy link
Member

tmplt commented Nov 17, 2019

Superseded by #73574.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gdb auto-load safe-path should include ${pkgs.gcc}
8 participants