CI is failing
brad4d opened this issue · comments
Most recent failure
https://github.com/google/closure-compiler-npm/actions/runs/2384282215
So far I haven't been able to reproduce this.
clone git@github.com:google/closure-compiler-npm.git
cd closure-compiler-npm
git submodule init
git submodule update
yarn install
=yarn install v1.22.15
sudo apt install bazel-4.2.2
./build-scripts/build_compiler.js
The build succeeded.
The error in the CI output is:
Analyzing: target //:compiler_unshaded_deploy.jar (19 packages loaded, 6 targets configured)
ERROR: While resolving toolchains for target //:compiler_unshaded: invalid registered toolchain '//toolchains:all': while parsing '//toolchains:all': no such package 'toolchains': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
- /home/runner/work/closure-compiler-npm/closure-compiler-npm/compiler/toolchains
ERROR: Analysis of target '//:compiler_unshaded_deploy.jar' failed; build aborted: invalid registered toolchain '//toolchains:all': while parsing '//toolchains:all': no such package 'toolchains': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
- /home/runner/work/closure-compiler-npm/closure-compiler-npm/compiler/toolchains
INFO: Elapsed time: [19](https://github.com/google/closure-compiler-npm/runs/6536803773?check_suite_focus=true#step:10:20).758s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (19 packages loaded, 6 targets configured)
FAILED: Build did NOT complete successfully (19 packages loaded, 6 targets configured)
/home/runner/work/closure-compiler-npm/closure-compiler-npm/build-scripts/run-command.js:67
const err = new Error(`non-zero exit code ${exitCode}`);
^
Error: non-zero exit code 1
at ChildProcess.<anonymous> (/home/runner/work/closure-compiler-npm/closure-compiler-npm/build-scripts/run-command.js:67:[21](https://github.com/google/closure-compiler-npm/runs/6536803773?check_suite_focus=true#step:10:22))
at ChildProcess.emit (node:events:5[27](https://github.com/google/closure-compiler-npm/runs/6536803773?check_suite_focus=true#step:10:28):[28](https://github.com/google/closure-compiler-npm/runs/6536803773?check_suite_focus=true#step:10:29))
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:[30](https://github.com/google/closure-compiler-npm/runs/6536803773?check_suite_focus=true#step:10:31)2:5) {
stdout: '',
stderr: '',
exitCode: 1
}
Error: Process completed with exit code 1.
It is definitely true that closure-compiler-npm/cmpiler/toolchains
does not exist for me.
$ bazel query "deps(//:compiler_unshaded_deploy.jar)" |grep toolchain
Loading: 0 packages loaded
@bazel_tools//tools/build_defs/cc/whitelists/starlark_hdrs_check:loose_header_check_allowed_in_toolchain
@bazel_tools//tools/cpp:current_cc_toolchain
@bazel_tools//tools/cpp:toolchain
@bazel_tools//tools/jdk:current_java_toolchain
@com_google_protobuf//:java_toolchain
@com_google_protobuf//java/core:toolchain
@local_config_cc//:toolchain
I don't seem to have a dependency on //toolchains:all
, even though that dependency does seem to appear in the error message above.
I realized I hadn't updated the compiler submodule to master and a few other things that get done in .github/workflows/build.yml
Also I needed to set some environment variables.
export COMPILER_NIGHTLY=true
export FORCE_COLOR=1
- cd
compiler
git checkout master
git pull https://github.com/google/closure-compiler.git master
cd ..
- I don't know what to do to simulate the "Yarn and maven cache" step
yarn install --colors=always
- `./build-scripts/build_compiler.js
still no failure
@ChadKillingsworth do you think you'd be able to help me figure out how to reproduce this problem?
I took a look at this today.
-
Last good build: https://github.com/google/closure-compiler-npm/actions/runs/2358139033
compiler commit: be4a58341ee03da20fa2104ba90792745ccb3cfb -
First broken build: https://github.com/google/closure-compiler-npm/actions/runs/2362971064
compiler commit: 0e25e01ec426ea5b70b74eb34ee3b63e777655ba
Diff: google/closure-compiler@be4a583...0e25e01
What jumps out to me is the Bazel upgrade to 5.1.1 while the build in this repo still uses v4:
I reproduced the issue in https://github.com/google/closure-compiler-npm/runs/6707025080 and updating Bazel fixes it.
Though the current submodule compiler version fails with 5.1.1. Maybe they have to be updated together.
I think using bazelisk instead of bazel might be the better option. That way it should automatically pick the correct bazel version.
@frigus02 Thanks a lot for the fix.
It's weird. I explicitly did my local build with bazel 4.2.2, because I thought it might be a bazel version problem, and it seemed to build just fine. I can't explain that...
That is indeed weird. Maybe there were a few things that had to come together to make it fail.