-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
QA: The used scripts in nixpkgs are not sane #133088
Comments
Wasn't it @happysalada who was doing some really awesome work in this area recently? |
@Kreyren thank you for submitting this! Last but not least. The shell stuff is doing some funny dynamic things with variables and shellcheck provides false positives, so you'll have to filter a bit. The main reason why people haven't implemented some of those changes is that it can break things in unexpected ways. Anyways, happy to help any efforts in improving those scripts! |
$out is defined but shellcheck doesn't know about it. It also doesn't have spaces so doesn't need quoting. Same for compressImage I suppose? So the majority of these messages are bogus. cd || exit 1 wouldn't hurt I guess |
/nix/store can be changed so $out can have space ? One use case I see is someone with /nix/ pointing to ssd but he wants to use hist hdd and unluckily it has space/stange chars. This person could fix his mount point and thus benefit from cachix but I don't know how the installer choose disk to use. Also when someone is modifying a package if all variable are quoted he will most likely quote his new variable and we get better software. And to avoid rebuild I would suggest if you change a script then fix all issue in this script (the quoting included) but don't force a rebuild just for quoting |
/nix/store can be changed so $out can have space ?
No, in some places of stdenv there are non-trivial design issues that need to be solved for that to work, just quoting $out everywhere is not enough
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-is-bash-expanded-in-nixpkgs/23560/1 |
Describe the bug
Scripts used in
shellHook
,buildCommand
, etc.. are not sane and can break runtime:Proposal
Integrate a CI that checks the scripts against shellcheck
The text was updated successfully, but these errors were encountered: