-
Notifications
You must be signed in to change notification settings - Fork 543
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
Migrate to Bzlmod for managing external dependencies #1469
Comments
Some tests are still failing with Bzlmod enabled: |
This will help make sure Bazel Downstream Pipeline is green after enabling Bzlmod at Bazel@HEAD See bazelbuild/bazel#18958 (comment) #1469
posterity: From a cursory look, I get the impression the cause is some tests aren't going through the runfiles apis, so end up not being aware of repo-remapping. |
This will help make sure [Bazel Downstream Pipeline](https://github.com/bazelbuild/continuous-integration/blob/master/docs/downstream-testing.md) is green after enabling Bzlmod at Bazel@HEAD See bazelbuild/bazel#18958 (comment) Related issue: #1469
A few tests weren't compatible with bzlmod, so would fail when it was enabled. The various causes and fixes are: * Under bzlmod, `runfiles.CurrentRepository()` returns the empty string for the main repository. To fix, an environment variable is used to tell the test whether bzlmod is enabled or not. * Accessing data files through `TEST_SRCDIR` directly is error-prone under bzlmod because the directory name within runfiles changes from the workspace name to `_main`. To fix, use the runfiles libraries, which know how to map apparent repo names to the actual directory name. In the integration tests, the runfiles library isn't available, so just check for the `_main` directory instead. Work towards bazelbuild#1469
A few tests weren't compatible with bzlmod, so would fail when it was enabled. The various causes and fixes are: * Under bzlmod, `runfiles.CurrentRepository()` returns the empty string for the main repository. To fix, an environment variable is used to tell the test whether bzlmod is enabled or not. * Accessing data files through `TEST_SRCDIR` directly is error-prone under bzlmod because the directory name within runfiles changes from the workspace name to `_main`. To fix, use the runfiles libraries, which know how to map apparent repo names to the actual directory name. In the integration tests, the runfiles library isn't available, so just check for the `_main` directory instead. Work towards bazelbuild#1469
A few tests weren't compatible with bzlmod, so would fail when it was enabled. The various causes and fixes are: * Under bzlmod, `runfiles.CurrentRepository()` returns the empty string for the main repository. To fix, an environment variable is used to tell the test whether bzlmod is enabled or not. * Accessing data files through `TEST_SRCDIR` directly is error-prone under bzlmod because the directory name within runfiles changes from the workspace name to `_main`. To fix, use the runfiles libraries, which know how to map apparent repo names to the actual directory name. In the integration tests, the runfiles library isn't available, so just check for the `_main` directory instead. Work towards bazelbuild#1469
PR #1482 out to fix this. It's as I thought -- the runfiles directory changing to |
A few tests weren't compatible with bzlmod, so would fail when it was enabled. The various causes and fixes are: * Under bzlmod, `runfiles.CurrentRepository()` returns the empty string for the main repository. To fix, an environment variable is used to tell the test whether bzlmod is enabled or not. * Accessing data files through `TEST_SRCDIR` directly is error-prone under bzlmod because the directory name within runfiles changes from the workspace name to `_main`. To fix, use the runfiles libraries, which know how to map apparent repo names to the actual directory name. In the integration tests, the runfiles library isn't available, so just check for the `_main` directory instead. Work towards bazelbuild#1469
A few tests weren't compatible with bzlmod, so would fail when it was enabled. The various causes and fixes are: * Under bzlmod, `runfiles.CurrentRepository()` returns the empty string for the main repository. To fix, an environment variable is used to tell the test whether bzlmod is enabled or not. * Accessing data files through `TEST_SRCDIR` directly is error-prone under bzlmod because the directory name within runfiles changes from the workspace name to `_main`. To fix, use the runfiles libraries, which know how to map apparent repo names to the actual directory name. In the integration tests, the runfiles library isn't available, so just check for the `_main` directory instead. Work towards #1469
1482 is merged, so this should be fixed now |
This makes the necessary changes to the toolchains acceptance tests and also moves the tests to the `//tests` directory as this is the current convention. Fixes bazelbuild#1469.
With future Bazel LTS versions, Bzlmod will become the default system for external dependencies management.
Please consider migrating all your external dependencies in WORKSPACE to MODULE.bazel
For more information, please check bazelbuild/bazel#18958
The text was updated successfully, but these errors were encountered: