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

trivial-builders: Sanitize derivation name #85255

Merged
merged 1 commit into from Apr 24, 2020

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Apr 14, 2020

Motivation for this change

This then supports using functions like writeShellScriptBin with script names
that would be invalid as derivation names, which was desired by a user on IRC.

Assuming sanitizeDerivationName as introduced in #83241 is correct (which I'm pretty sure it is, comes with covering tests), this change will be fully backwards compatible without any rebuilds.

An alternative would be to use sanitizeDerivationName in mkDerivation directly, but that might influence performance a bit too much for not much of a benefit. This is much more useful for these trivial builders, which especially don't support changing the derivation name on its own.

Things done
  • Made sure a simple writeShellScriptBin "{^_^}" newly works after this commit

This then supports using functions like writeShellScriptBin with script names
that would be invalid as derivation names
@infinisil infinisil merged commit eeb4e52 into NixOS:master Apr 24, 2020
@infinisil infinisil deleted the sanitize-run-command-name branch April 24, 2020 22:11
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.

None yet

1 participant