-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
trivial-builders.nix: add writeShellScriptBin builder #19050
Conversation
Looking at nixpkgs there are more instances where |
in | ||
runCommand name {} '' | ||
${stdenv.shell} -n ${s}/bin/${name} | ||
cp -v -r ${s} $out |
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 think this change is great!
Still, instead of making a copy of the verified script, I think it would be better to add a checkPhase to the writeTextFile function above.
So do we want to integrate this? |
Sorry, forgot about this one. Please give me a couple of days :)
2017-01-24 16:38 GMT+03:00 Joachim F. <notifications@github.com>:
… So do we want to integrate this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19050 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AERTITNFneuUtByx0PEyQBApBqahNlSZks5rVf7ggaJpZM4KJKlm>
.
|
5faa222
to
ff16c10
Compare
I just noticed that this now has the Also, I notice that it no longer puts the resulting script under |
ff16c10
to
ac7f0df
Compare
@joachifm , I fixed the /bin/${name} location in the build expression.
I there is a compromise, please let me know. |
Ah, the rebuild is not a problem per se, if we want this change we can put it into staging. Preferably along with some other change that'd also require a mass rebuild. |
OK. |
Applied in f49c2fb thank you! |
Motivation for this change
We often use Nix to write in-place shell scripts. This patch adds writeShellScriptBin which enables basic syntax-checking for such a scripts.
More detailed, it does the following:
text
is a shell-script, adds '#!${stdenv.shell}' headerwriteScriptBin
functionsh -n
to check the basic syntaxThings done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)