-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
rr: include gdb as a propagated input #57590
Conversation
Thanks! I probably missed this because I normally have gdb in my Hmmm, I wonder if it might be better to actually use |
@thoughtpolice Thanks for taking a look! I'm afraid I haven't used either technique before. What would |
After some discussion with other developers on IRC, the Here's an example from an expression I updated the other day, which is the Souffle Datalog compiler: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/souffle/default.nix#L41 The basic idea is just to add
The use of You may also use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Requesting changes based on previous comments)
@thoughtpolice Thank you so much for the detailed explanation! I will make the required changes. |
wrapProgram works but it would be even better if you could just patch the software to hardcode the path of gdb at build time. That would be more idiomatic Nix, would be slightly more reliable, and would remove the unnecessary shell script wrapper. Hopefully rr only actually has the string "gdb" in one place, which it uses to look gdb up on PATH; in which case you can just replace that string with the full Nix path. |
Whether or not one or another is more idiomatic is up to opinion of maintainer (in my opinion, both are so pervasive calling one more "idiomatic" than the other is largely a moot point).
This is not really true in my experience, especially compared to You can alternatively write a But even then, in this case, There are of course uses for the family of substitute functions -- they obviously do not do the same thing, so some instances will have advantages and some won't. And I use them ( |
As you say, some software is designed such that it's hard to make a single patch to override an executable location. For such software, it would be good to send a change upstream so that the executable location can be more easily patched. Best yet would be to send a change upstream so that the executable location can be passed as an input to the build process, via whatever equivalent to "./configure --some-executable-location=$gdb/bin/gdb" rr has. Then there's no wrapper and no patching, it's just a natural part of the build process. Ideally, such an option already exists in the rr build process, and we can just use it. Certainly such an option is something that would be useful to anyone compiling rr from source... But wrapProgram works, and it requires less effort, so it's fine; using it is certainly an improvement over the status quo of getting gdb from the user's PATH. |
ping (triage) |
Motivation for this change
rr
crashes at runtime whengdb
isn't availableThings done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)