Skip to content

fix(test): package_naming_aggregate_test on Windows#1018

Open
rdesgroppes wants to merge 1 commit intobazelbuild:mainfrom
rdesgroppes:fix-package_naming_aggregate_test-on-windows
Open

fix(test): package_naming_aggregate_test on Windows#1018
rdesgroppes wants to merge 1 commit intobazelbuild:mainfrom
rdesgroppes:fix-package_naming_aggregate_test-on-windows

Conversation

@rdesgroppes
Copy link
Contributor

@rdesgroppes rdesgroppes commented Feb 6, 2026

The test was failing on Windows:

==================== Test output for //tests:package_naming_aggregate_test:
ls: cannot access 'C:/[...]/bin/tests/package_naming_aggregate_test.exe.runfiles/_main/tests/test_naming_some_value.deb': No such file or directory
================================================================================

It tried to directly access files in the runfiles directory, but on Windows Bazel uses by default a manifest file instead of creating actual symlinks.

The change consists in adding a minimalistic version of the rlocation() helper function that:

  • when set, reads from $RUNFILES_MANIFEST_FILE to resolve paths,
  • otherwise uses $TEST_SRCDIR directly, as before.

This allows to enable the test in Windows CI now it passes.

Note on the stricter error handling:

  • set -u is to fail fast should any of the expected TEST_* environment variables be unbound,
  • set -o pipefail is to fail fast should either side of the grep | cut pipe fail.

@rdesgroppes rdesgroppes force-pushed the fix-package_naming_aggregate_test-on-windows branch 3 times, most recently from 7550f82 to 9ce07db Compare February 7, 2026 01:03
@rdesgroppes rdesgroppes marked this pull request as ready for review February 7, 2026 01:06
@rdesgroppes rdesgroppes force-pushed the fix-package_naming_aggregate_test-on-windows branch from 9ce07db to cdc5188 Compare February 7, 2026 15:27
The test was failing on Windows:
```
==================== Test output for //tests:package_naming_aggregate_test:
ls: cannot access 'C:/[...]/bin/tests/package_naming_aggregate_test.exe.runfiles/_main/tests/test_naming_some_value.deb': No such file or directory
================================================================================
```
It tried to directly access files in the `runfiles` directory, but on
Windows Bazel uses by default a manifest file instead of creating actual
symlinks.

The change consists in adding a minimalistic version of the
[rlocation()](https://github.com/bazelbuild/rules_shell/blob/main/shell/runfiles/runfiles.bash)
helper function that:
- when set, reads from `$RUNFILES_MANIFEST_FILE` to resolve paths,
- otherwise uses `$TEST_SRCDIR` directly, as before.

This allows to enable the test in Windows CI now it passes.

Note on the stricter error handling:
- `set -u` is to fail fast should any of the expected `TEST_*`
  environment variables be unbound,
- `set -o pipefail` is to fail fast should either side of the
  `grep | cut` pipe fail.
@rdesgroppes rdesgroppes force-pushed the fix-package_naming_aggregate_test-on-windows branch from cdc5188 to 2e1411a Compare February 7, 2026 15:32
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