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
terraform: Wrap PATH of propagatedBuildInputs #37861
Conversation
Plugins (namely terraform-provider-libvirt) may have a run time dependency on external binaries.
Success on x86_64-linux (full log) Attempted: terraform Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: terraform Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: terraform Partial log (click to expand)
|
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.
Looks good to me.
I was thinking of a more general solution where the plugins' nix-support/setup-hook
would be loaded before starting terraform but that works as well. Plus I'm not sure that setup-hook
is intended for that use-case.
@@ -64,7 +70,8 @@ let | |||
buildCommand = '' | |||
mkdir -p $out/bin/ | |||
makeWrapper "${terraform.bin}/bin/terraform" "$out/bin/terraform" \ | |||
--set NIX_TERRAFORM_PLUGIN_DIR "${buildEnv { name = "tf-plugin-env"; paths = actualPlugins; }}/bin" | |||
--set NIX_TERRAFORM_PLUGIN_DIR "${buildEnv { name = "tf-plugin-env"; paths = actualPlugins; }}/bin" \ | |||
--prefix PATH : "${lib.makeBinPath wrapperInputs}" |
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 have not tested this, but this looks like a nice alternative to my hack.
I would not abuse setup-hook for this case. This might set other build-time-only stuff we do not want to have at runtime like PYTHONHASHSEED which can be dangerous in interactive usage. |
Failure on x86_64-darwin (full log) Attempted: terraform Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: terraform Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: terraform Partial log (click to expand)
|
Motivation for this change
Plugins (namely terraform-provider-libvirt) may have a run time
dependency on external binaries.
See #37852
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)cc @Mic92 @zimbatm @peterhoeg @jgeerds