Opened 5 years ago

Closed 4 years ago

#58874 closed defect (fixed)

bazel +bash_completion: every rule of type java_runtime_alias implicitly depends upon the target '//:jdk10', but this target could not be found because of: no such target '//:jdk10': target 'jdk10' not declared in package '' defined by BUILD

Reported by: blair (Blair Zajac) Owned by: cjones051073 (Chris Jones)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: bazel

Description

At least with bazel25:

Build successful! Binary is here: /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_bazel/bazel25/work/bazel-0.25.2-dist/output/bazel
xinstall: chdir(/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_bazel/bazel25/work/bazel-0.25.2-dist/output)
xinstall: bazel -> /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_bazel/bazel25/work/bazel-0.25.2-dist/bazel
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Analyzing: target //scripts:bazel-complete.bash (1 packages loaded, 0 targets configured)
Analyzing: target //scripts:bazel-complete.bash (89 packages loaded, 607 targets configured)
Analyzing: target //scripts:bazel-complete.bash (98 packages loaded, 696 targets configured)
ERROR: /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_bazel/bazel25/work/21f0dfe7df7c5c3003d1cc296ef2570a/external/bazel_tools/tools/jdk/BUILD:63:1: every rule of type java_runtime_alias implicitly depends upon the target '//:jdk10', but this target could not be found because of: no such target '//:jdk10': target 'jdk10' not declared in package '' defined by /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_bazel/bazel25/work/bazel-0.25.2-dist/BUILD
INFO: An error occurred during the fetch of repository 'remote_java_tools_darwin'
INFO: Call stack for the definition of repository 'remote_java_tools_darwin':
 - /DEFAULT.WORKSPACE.SUFFIX:226:1
ERROR: Analysis of target '//scripts:bazel-complete.bash' failed; build aborted: Analysis failed
INFO: Elapsed time: 6.340s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (211 packages loaded, 4781 targets configured)
FAILED: Build did NOT complete successfully (211 packages loaded, 4781 targets configured)
Command failed: ./bazel --max_idle_secs=60 --output_user_root=/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_bazel/bazel25/work build -s --javabase //:jdk10 --host_javabase //:jdk10 //scripts:bazel-complete.bash
Exit code: 1

Trying to replace jdk10 with jdk11 or jdk12 didn't work for me.

Change History (5)

comment:1 Changed 5 years ago by cjones051073 (Chris Jones)

OK... Have to confess I have never actually tried the bash variant. It was there from before I started updating the port...

comment:2 Changed 5 years ago by gaming-hacker (G Alexander)

it doesn't work with current bazel 0.29 either.

instead of the current Portfile with all the complications, why not just download a working bazel and use bazel to build itself from source? or in my case having the binary is good enough without needing a complete build from source, i chopped up the Portfile to do just that.

bazel-0.29.0-installer-darwin-x86_64.sh -h
Usage: ./bazel-0.29.0-installer-darwin-x86_64.sh [options]
Options are:
  --prefix=/some/path set the prefix path (default=/usr/local).
  --bin= set the binary folder path (default=%prefix%/bin).
  --base= set the base install path (default=%prefix%/lib/bazel).
  --user configure for user install, expands to:
      --bin=$HOME/bin --base=$HOME/.bazel
  --skip-uncompress skip uncompressing the base image until the
      first bazel invocation
Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 5 years ago by cjones051073 (Chris Jones)

I am not really sure what changes to the portfile you are suggesting, you aren’t really that clear, but I dislike ports that download prebuilt binaries so no, I will not be making a change like that. I also fail to see how that would help the bash variant. If there are issues with that, someone should eventually investigate why and just fix the build options. I might eventually, but honestly do not have the time or motivation to do it at this time.

comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: bazel: +bash variant doesn't buildbazel +bash_completion: every rule of type java_runtime_alias implicitly depends upon the target '//:jdk10', but this target could not be found because of: no such target '//:jdk10': target 'jdk10' not declared in package '' defined by BUILD

Confirming the issue still exists with bazel @3.7.1+bash_completion on my macOS 10.13.6 system with AdoptOpenJDK (build 11.0.9.1+1) installed. Building from source without the bash_completion variant works fine.

comment:5 Changed 4 years ago by Jiawen (Kevin) Chen <jiawen@…>

Resolution: fixed
Status: assignedclosed

In 51ae3db2c027162da024f1b617f87af7d4c5237c/macports-ports (master):

bazel: fix build for +bash_completion variant

Closes: #58874
Closes: https://github.com/macports/macports-ports/pull/9721
Tested: edited portfile locally and installed.

Note: See TracTickets for help on using tickets.