Skip to content

Conversation

@jeffhodsdon
Copy link

Description

Related Issue

Motivation and Context

I believe this is a bug — however I could be wrong.

Ran into issues with the RUNFILES_DIR var undefined while .apply from a github action runner environment. This PR fixed the issue for me. Opening this PR for a discussion or for this fix to be validated and merged.

How Has This Been Tested?

Via internal GH actions

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Add RUNFILES_DIR=${RUNFILES} to async function so that child bash
scripts (like .push scripts) can find runfiles.bash. Without this,
child scripts fail with "runfiles.bash initializer cannot find
bazel_tools/tools/bash/runfiles/runfiles.bash" error.

The issue occurs because:
- Parent scripts only export PYTHON_RUNFILES (Python-specific)
- Child bash scripts check RUNFILES_DIR environment variable
- Without RUNFILES_DIR, runfiles.bash initialization fails
Add RUNFILES_DIR=${RUNFILES} to async function in k8s_gitops.sh.tpl.
This template is used by k8s_deploy.apply (not k8s_test_namespace.sh.tpl
which is for tests only).
Add RUNFILES_DIR=${RUNFILES} to async function in kubectl.sh.tpl.
This is the actual template used by the kubectl rule which generates
the k8s_deploy.apply target.
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.

1 participant