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

Bzlmod support is broken #233

Closed
agluszak opened this issue Oct 26, 2023 · 9 comments
Closed

Bzlmod support is broken #233

agluszak opened this issue Oct 26, 2023 · 9 comments

Comments

@agluszak
Copy link

If I depend on rules_bazel_integration_test via WORKSPACE my integration tests work fine. If I depend using bzlmod the same tests (I didn't change anything in BUILD file) fails to build with this error message:

ERROR: /home/andrzej/code/bazel/bazel-bsp/e2e/BUILD:27:24: no such package '@[unknown repo 'build_bazel_bazel_6_3_2' requested from @]//': The repository '@[unknown repo 'build_bazel_bazel_6_3_2' requested from @]' could not be resolved: No repository visible as '@build_bazel_bazel_6_3_2' from main repository and referenced by '//e2e:remote_jdk_test_bazel_6_3_2'

In both cases I used version 0.18

@cgrindel
Copy link
Member

In your MODULE.bazel, did you declare the Bazel binaries that you use for testing?

@agluszak
Copy link
Author

Yup

@agluszak
Copy link
Author

https://github.com/JetBrains/bazel-bsp/blob/7acf76fffe9d984d13027643499d18d3ff78d93c/MODULE.bazel

@cgrindel
Copy link
Member

I just cloned that repo, created a branch from that commit and ran bazel test //.... I am seeing errors like the following:

FAIL: //server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages:LanguagePluginServiceTest (see /private/var/tmp/_bazel_chuck/4a2395da91466e2f61576a416d362f53/execroot/_main/bazel-out/darwin-fastbuild/testlogs/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginServiceTest/test.log)
INFO: From Testing //server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages:LanguagePluginServiceTest:
==================== Test output for //server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages:LanguagePluginServiceTest:
/private/var/tmp/_bazel_chuck/4a2395da91466e2f61576a416d362f53/sandbox/darwin-sandbox/935/execroot/_main/bazel-out/darwin-fastbuild/bin/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginServiceTest.runfiles/_main/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginServiceTest: line 396: /private/var/tmp/_bazel_chuck/4a2395da91466e2f61576a416d362f53/sandbox/darwin-sandbox/935/execroot/_main/bazel-out/darwin-fastbuild/bin/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginServiceTest.runfiles/_main/external/rules_java~6.5.1~toolchains~local_jdk/bin/java: No such file or directory
/private/var/tmp/_bazel_chuck/4a2395da91466e2f61576a416d362f53/sandbox/darwin-sandbox/935/execroot/_main/bazel-out/darwin-fastbuild/bin/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginServiceTest.runfiles/_main/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginServiceTest: line 396: exec: /private/var/tmp/_bazel_chuck/4a2395da91466e2f61576a416d362f53/sandbox/darwin-sandbox/935/execroot/_main/bazel-out/darwin-fastbuild/bin/server/src/test/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginServiceTest.runfiles/_main/external/rules_java~6.5.1~toolchains~local_jdk/bin/java: cannot execute: No such file or directory
================================================================================

Is there some additional set up that needs to be performed?

@cgrindel
Copy link
Member

I am able to reproduce the error by querying bazel cquery //e2e:all. I see the calls being made that should declare the build_bazel_bazel_xxx repositories. I am still not sure why they are not working in this case. 🤔

@cgrindel
Copy link
Member

#234 and #235 are follow up issues. For now, to workaround your immediate issue, please try the following:

  1. Add the following to your MODULE.bazel: bazel_dep(name = "cgrindel_bazel_starlib", version = "0.18.0")
  2. Replace your current use_repo(bazel_binaries, "bazel_binaries") with the following:
use_repo(
    bazel_binaries,
    "bazel_binaries",
    "build_bazel_bazel_.bazelversion",
    "build_bazel_bazel_5_3_2",
    "build_bazel_bazel_6_3_2",
)

@cgrindel
Copy link
Member

@agluszak Please let me know if that unblocks you. I will work on fixing the other two issues, tomorrow.

@agluszak
Copy link
Author

Yup, that fixes the issues that I had :) thanks!

@cgrindel
Copy link
Member

Great. I will close this issue.

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

No branches or pull requests

2 participants