Closed FR4NK-W closed 2 days ago
LGTM: This fixes the described issues.
However, some other issues came up as discussed:
make bootstrapper
does not work as documentedbazel build //:scion-bootstrapper-deb
fails because of missing librpm:
$ bazel build //:scion-bootstrapper-deb
Starting local Bazel server and connecting to it...
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to https://github.com/bazelbuild/bazel/issues/18958.
INFO: Analyzed target //:scion-bootstrapper-deb (96 packages loaded, 519 targets configured).
ERROR: /home/ztilmann/work/bootstrapper/BUILD.bazel:60:8: Writing: bazel-out/k8-fastbuild/bin/scion-bootstrapper-bin.tar failed: missing input file '//:bin/bootstrapper'
ERROR: /home/ztilmann/work/bootstrapper/BUILD.bazel:60:8: Writing: bazel-out/k8-fastbuild/bin/scion-bootstrapper-bin.tar failed: 1 input file(s) do not exist
Target //:scion-bootstrapper-deb failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/ztilmann/work/bootstrapper/BUILD.bazel:60:8 Writing: bazel-out/k8-fastbuild/bin/scion-bootstrapper-bin.tar failed: 1 input file(s) do not exist
INFO: Elapsed time: 5.731s, Critical Path: 0.04s
INFO: 18 processes: 18 internal.
ERROR: Build did NOT complete successfully
make all
always executes
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=go_deps.bzl%go_deps -prune
bazel clean --expunge
make all
fails with
$ make all
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=go_deps.bzl%go_deps -prune
INFO: Analyzed target //:gazelle (1 packages loaded, 133 targets configured).
INFO: Found 1 target...
Target //:gazelle up-to-date:
bazel-bin/gazelle-runner.bash
bazel-bin/gazelle
INFO: Elapsed time: 0.289s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/gazelle update-repos '-from_file=go.mod' '-to_macro=go_deps.bzl%go_deps' -prune
bazel clean --expunge
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
rm -f bin/*
./.bazel-build-env
STABLE_PKG_VERSION_SCION_BOOTSTRAPPER v0.0.0-v0.0.7-21-ged73f2d-dirty
bazel build //:bootstrapper
Starting local Bazel server and connecting to it...
INFO: Analyzed target //:bootstrapper (178 packages loaded, 13271 targets configured).
INFO: Found 1 target...
Target //:bootstrapper up-to-date:
bazel-bin/bootstrapper
INFO: Elapsed time: 30.375s, Critical Path: 19.43s
INFO: 91 processes: 8 internal, 83 linux-sandbox.
INFO: Build completed successfully, 91 total actions
cp `bazel aquery 'outputs(".*bin/bootstrapper", //:bootstrapper)' --output=text 2>/dev/null | grep "Outputs" | sed -r 's/\s*Outputs: \[(.*)\]/\1/'` bin/
ln -sf ./bin/bootstrapper ./scion-bootstrapper
bazel test --config=unit --test_output=errors ...
ERROR: /home/ztilmann/work/bootstrapper/BUILD.bazel:133:8: in pkg_rpm rule //:scion-bootstrapper-rpm:
Traceback (most recent call last):
File "/home/ztilmann/.cache/bazel/_bazel_ztilmann/87be20ea61cc62702d6eca3dd1110526/external/rules_pkg/rpm.bzl", line 47, column 17, in _pkg_rpm_impl
fail("The rpmbuild_toolchain is not properly configured: " +
Error in fail: The rpmbuild_toolchain is not properly configured: @@rules_pkg_rpmbuild//:rpmbuild_auto
ERROR: /home/ztilmann/work/bootstrapper/BUILD.bazel:133:8: Analysis of target '//:scion-bootstrapper-rpm' failed
Use --verbose_failures to see the command lines of failed build steps.
ERROR: Analysis of target '//:scion-bootstrapper-rpm' failed; build aborted
INFO: Elapsed time: 0.375s, Critical Path: 0.10s
INFO: 28 processes: 26 internal, 2 linux-sandbox.
ERROR: Build did NOT complete successfully
//config:go_default_test NO STATUS
//fetcher:go_default_test NO STATUS
Executed 0 out of 2 tests: 2 were skipped. FAILED: Fetching repository @@com_github_stretchr_testify; starting make: *** [Makefile:61: test] Error 1
Thanks @tzaeschke for those additional comments
However, some other issues came up as discussed:
I believe with the latest commit, also those other points were addressed:
make bootstrapper
does not work as documented
I believe it does now, even for different host OSes.
bazel build //:scion-bootstrapper-deb fails because of missing librpm:
I don't believe this is the issue your error message is showing. The error message included in the message above indicates that the build
target was not executed, and hence there is no scion-bootstrapper
binary to be included in the debian package.
There is however an other issue related to the pkg_rpm
import that was triggering the detection of a missing rpm toolchain when running the test
target. This no longer happens as the tests are called explicitly (see comment on the test
target).
make all
always executes [...] gazelle
This seems to be an issue with make's dependency resolution, which we weren't able to reproduce.
The go_deps.bzl
target is never directly called and only executed if there is no go_deps.bzl
file.
make all
fails
make all
includes the test
target which was failing in case no rpm toolchain was detected. This is also resolved, see above. If the target package_rpm
is explicitly called, we now also make sure to install the rpm toolchain as part of the target.
@tzaeschke : Can you confirm that also those additional points have been addressed?
@FR4NK-W All good, seems to fine :-)
Update rules_go, Gazelle and Bazel Go version Add all tests to module BUILD.bazel
Ignore MODULE.bazel for now