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
xdg-utils: add missing dependencies #95675
Conversation
80eb2c5
to
3565781
Compare
- Add coreutils to PATH, because the xdg scripts use other not yet provided coreutils like head. This makes the custom 'cut' and 'sort' functions obsolete. Remove double quotes around $out because $out contains no Bash field separators. - Replace all instances of 'which' with 'type -P'. The previous sed command only replaced instances with a leading space.
3565781
to
68559e2
Compare
/marvin opt-in |
Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here. |
xset() { ${xset}/bin/xset "$@"; }\ | ||
perl() { PERL5LIB=${perlPath} ${perlPackages.perl}/bin/perl "$@"; }\ | ||
mimetype() { ${perlPackages.FileMimeInfo}/bin/mimetype "$@"; }\ | ||
PATH=$PATH:'"$out"'/bin\ | ||
PATH=$PATH:'$out'/bin:${coreutils}/bin\ |
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.
It seems this was previously not done to avoid polluting $PATH
(#25511 (comment)).
I think your argument that xdg-utils scripts will expect other coreutils commands, like head and basename, to be present is reasonable.
Another approach might be to process those xdg scripts to point to the specific tool implementations they expect (e.g. busybox or coreutils), but given that this derivation already pulls in coreutils it seems reasonable to just leverage those.
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.
At least the following executables are used from coreutils: head, wc, tr, touch, test, tail. I think it is fine to pollute the $PATH
with all those binaries or we wrap here for days.
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.
Having xdg-utils contaminate the environment is bad because it can be confusing. Imagine opening a nix file in a text editor using xdg-open
and then testing it in a terminal opened from the text editor. Now, arguably, users will likely have coreutils installed so this is more important when adding other programs to PATH
, or when exporting other environment variables but we should still keep it in mind. Ideally we would use something like @abathur’s resholved.
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.
resholved
isn't in a production-ready state yet and it's also unvavailable in nixpkgs.
Do you propose to wait until resholved
is released? This could take months, judging its current progress.
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.
I haven't read context here so I'm commenting generally:
I don't want you to be stuck waiting for resholve to land in Nixpkgs (and hate me if it takes a bit).
But, if resholve does solve a problem here without needing any new features, I don't think it would take "months" and I'm open to discussing timelines/priorities.
It shouldn't be too hard to add resholve temporarily to test it out. It has a good core of functionality, and it works for a living in my own profile and in Graham's. I even considered it ready for inclusion earlier this year, but the override API's grown into a bit of a haphazard kitchen sink that I've decided to fix before calling an initial release.
It is basically at the top of my "priority" list, but some "urgent" projects are taking all of its sunlight.
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
xset() { ${xset}/bin/xset "$@"; }\ | ||
perl() { PERL5LIB=${perlPath} ${perlPackages.perl}/bin/perl "$@"; }\ | ||
mimetype() { ${perlPackages.FileMimeInfo}/bin/mimetype "$@"; }\ | ||
PATH=$PATH:'"$out"'/bin\ | ||
PATH=$PATH:'$out'/bin:${coreutils}/bin\ |
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.
At least the following executables are used from coreutils: head, wc, tr, touch, test, tail. I think it is fine to pollute the $PATH
with all those binaries or we wrap here for days.
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
1 similar comment
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Result of 2 packages marked as broken and skipped:
2 packages failed to build:
4 packages built:
|
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Result of 2 packages marked as broken and skipped:
2 packages failed to build:
4 packages built:
|
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
2 similar comments
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
This makes the custom 'cut' and 'sort' functions obsolete.
Remove double quotes around $out because $out contains no Bash field separators.
The previous sed command only replaced instances with a leading space.
Reproduce