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

pass correct apko binary runfiles path to apko_run launcher #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Strum355
Copy link

In https://github.com/sourcegraph/sourcegraph, we've defined our own apko toolchain to integrate a patch to go-apk for the apko binary. Due to this, we pass register = False to apko_register_toolchains.

This surfaced a correctness issue when trying to run bazel run @rules_apko//apko, with the following error:

INFO: Running command line: bazel-bin/external/rules_apko/apko/_apko_run.sh
Workdir: /home/noah/Sourcegraph/sourcegraph
/home/noah/.cache/bazel/_bazel_noah/8fd1d20666a46767e7f29541678514a0/execroot/__main__/bazel-out/k8-fastbuild/bin/external/rules_apko/apko/_apko_run.sh: line 11: /home/noah/.cache/bazel/_bazel_noah/8fd1d20666a46767e7f29541678514a0/execroot/__main__/bazel-out/k8-fastbuild/bin/external/rules_apko/apko/_apko_run.sh.runfiles/__main__/bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/dev_chainguard_apko/apko_/apko: No such file or directory

From the bazel docs on runfiles location, this particular quote highlights the correct way to build the path to the apko binary's runfile path: "The path to a File under the runfiles directory corresponds to File.short_path."

The change presented works both for our case, and also bazel run //apko:apko in the rules_apko repo 🙂

@thesayyn
Copy link
Collaborator

can you sign your commits?

@Strum355
Copy link
Author

can you sign your commits?

done 👍

@sfc-gh-ptabor sfc-gh-ptabor self-requested a review May 16, 2024 17:35
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.

3 participants