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

Could not create symlink from /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/remotejdk21_linux/WORKSPACE to /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/local_jdk/WORKSPACE #574

Closed
vorburger opened this issue Mar 1, 2024 · 3 comments
Labels
bug Something isn't working contributors Affects Contributors (not users)

Comments

@vorburger
Copy link
Member

vorburger commented Mar 1, 2024

This problem just start appearing, must probably due to and since #558:

$ ./enola help
Computing main repo mapping:
Loading:
Loading: 0 packages loaded
Analyzing: target //cli:enola_deploy.jar (1 packages loaded, 0 targets configured)
Analyzing: target //cli:enola_deploy.jar (1 packages loaded, 0 targets configured)
[0 / 1] checking cached actions
INFO: Repository local_jdk instantiated at:
  /home/vorburger/git/github.com/enola-dev/enola/WORKSPACE.bazel:84:25: in <toplevel>
  /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_jvm_external~6.0/setup.bzl:12:32: in rules_jvm_external_setup
  /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_java~7.4.0/java/repositories.bzl:525:19: in rules_java_dependencies
  /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_java~7.4.0/java/repositories.bzl:69:10: in local_jdk_repo
  /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/bazel_tools/tools/build_defs/repo/utils.bzl:240:18: in maybe
  /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_java~7.4.0/toolchains/local_java_repository.bzl:315:32: in local_java_repository
Repository rule _local_java_repository_rule defined at:
  /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_java~7.4.0/toolchains/local_java_repository.bzl:270:46: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_jdk':
   Traceback (most recent call last):
        File "/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_java~7.4.0/toolchains/local_java_repository.bzl", line 240, column 31, in _local_java_repository_impl
                repository_ctx.symlink(file, file.basename)
Error in symlink: java.io.IOException: Could not create symlink from /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/remotejdk21_linux/WORKSPACE to /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/local_jdk/WORKSPACE: /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/local_jdk/WORKSPACE (File exists)
ERROR: /home/vorburger/git/github.com/enola-dev/enola/WORKSPACE.bazel:84:25: fetching _local_java_repository_rule rule //external:local_jdk: Traceback (most recent call last):
        File "/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_java~7.4.0/toolchains/local_java_repository.bzl", line 240, column 31, in _local_java_repository_impl
                repository_ctx.symlink(file, file.basename)
Error in symlink: java.io.IOException: Could not create symlink from /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/remotejdk21_linux/WORKSPACE to /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/local_jdk/WORKSPACE: /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/local_jdk/WORKSPACE (File exists)
ERROR: Analysis of target '//cli:enola_deploy.jar' failed; build aborted: java.io.IOException: Could not create symlink from /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/remotejdk21_linux/WORKSPACE to /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/local_jdk/WORKSPACE: /home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/local_jdk/WORKSPACE (File exists)
INFO: Elapsed time: 0.427s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
@vorburger vorburger added bug Something isn't working contributors Affects Contributors (not users) labels Mar 1, 2024
@vorburger vorburger self-assigned this Mar 1, 2024
@vorburger
Copy link
Member Author

vorburger commented Mar 1, 2024

Huh, even a bazelisk clean && sudo rm -rf ~/.cache/bazel/ does not seem to fix this?!

But it only happens for ./enola, whereas bazelisk build //cli:enola_deploy.jar, and e.g. bazelisk run //cli:enola -- --version still works just fine.

I wonder if this is a hint:

WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
WARNING: Running Bazel server needs to be killed, because the startup options are different.

@vorburger
Copy link
Member Author

Oh no wait, I think this only happens on the #553 branch, not on main. I probably just need to finish cleaning that up?

@vorburger
Copy link
Member Author

This has something to do with with adding the Bazel JDK to the PATH and/or setting JAVA_HOME to it.

For now, I'll try to do #553 without that (and just use "$bazel_java_home"/bin/java in ./enola).

@vorburger vorburger removed their assignment Mar 1, 2024
@vorburger vorburger closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contributors Affects Contributors (not users)
Projects
None yet
Development

No branches or pull requests

1 participant