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

dvt: remove nounset bash opt #64

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

sebaszv
Copy link
Contributor

@sebaszv sebaszv commented Nov 6, 2024

writeShellApplication has [ "errexit" "nounset" "pipefail" ]
set for its bashOptions parameter. This sets these at the top
of every generated script.

The error message "no template specified" is never printed since
the script immediately dies because ${1} isn't set and nounset
is enabled. Excluding the option from the script generation allows
the error message to print rather than just
result/bin/dvt: line 6: 1: unbound variable which isn't helpful.

https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders/default.nix#L261

`writeShellApplication` has `[ "errexit" "nounset" "pipefail" ]`
set for its `bashOptions` parameter. This sets these at the top
of every generated script.

The error message `"no template specified"` is never printed since
the script immediately dies because `${1}` isn't set and `nounset`
is enabled. Excluding the option from the script generation allows
the error message to print rather than just
`result/bin/dvt: line 6: 1: unbound variable` which isn't helpful.
@sebaszv
Copy link
Contributor Author

sebaszv commented Nov 18, 2024

@lucperkins
Any chance of this getting reviewed? I'm not sure if the notification was received.
No rush at all. I'm sure that you have numerous other things to prioritise.
There's also a few other PRs I created, so the same for those as well.

Whenever you get time. Thanks 😀👍.

@lucperkins lucperkins merged commit ea36f02 into the-nix-way:main Nov 18, 2024
4 of 5 checks passed
@sebaszv sebaszv deleted the fix-dvt-nounset branch November 18, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants