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

image.sh.tpl is too unhermetically hermetic! #473

Closed
GregBowyer opened this issue Jan 24, 2024 · 4 comments · Fixed by #569
Closed

image.sh.tpl is too unhermetically hermetic! #473

GregBowyer opened this issue Jan 24, 2024 · 4 comments · Fixed by #569
Milestone

Comments

@GregBowyer
Copy link

I suspect this is rendered moot by #459, but.

We run an aggressive hermetic setup on top of NixOS, I suspect this might happen for others who are being highly hermetic.

Presently, image.bzl is as follows:

    ctx.actions.run(
        inputs = depset(transitive = inputs_depsets),
        arguments = [args],
        outputs = [output],
        env = action_env,
        executable = util.maybe_wrap_launcher_for_windows(ctx, launcher),
        tools = [crane.crane_info.binary, registry.registry_info.launcher, registry.registry_info.registry, jq.jqinfo.bin],
        mnemonic = "OCIImage",
        progress_message = "OCI Image %{label}",
    )

This fails as Bazel wipes out $PATH and as a result, mktemp (and well everything) is basically none functional.

It appears that adding in the dreaded use_default_shell_env = True fixes this.

GregBowyer added a commit to ticketmaster/rules_oci that referenced this issue Jan 24, 2024
This is a small fix for being unable to build containers as bazel wipes out `$PATH` on which lives things the stump script likes to use, for instance `mktemp`

This is a small hack for now to allow images to build.

See: bazel-contrib#473

Signed-off-by: Greg Bowyer <greg.bowyer@ticketmaster.com>
@rickvanprim
Copy link
Contributor

That should be fixed by #459. Apologies for the slow progress.

@GregBowyer
Copy link
Author

No, it's all good, getting hermetic is hard, and it's fun to learn what is not a shell built-in ;)

We did a hack for now on the rules, but will track for the cleaner fix you are building,

@thesayyn thesayyn added this to the 2.0 milestone May 8, 2024
@thesayyn
Copy link
Collaborator

will be fixed by #569

@thesayyn
Copy link
Collaborator

fixed by #569

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 a pull request may close this issue.

3 participants