It has largely been superseded by `perf`. It is no longer
generally useful. It can always be added to BUILD_DEPS for
the rare cases it is needed, or installed locally and
pointed to by setting its path to ERL_LIBS.
Bazel build files are now maintained primarily with `bazel run
gazelle`. This will analyze and merge changes into the build files as
necessitated by certain code changes (e.g. the introduction of new
modules).
In some cases there hints to gazelle in the build files, such as `#
gazelle:erlang...` or `# keep` comments. xref checks on plugins that
depend on the cli are a good example.
* Add gazelle for use with update-repos command
* Use explicit BUILD.app_name files for erlang app deps
This allows us to remove the duplicate definitions in
workspace_helpers.bzl
These files are generated with gazelle. For instance:
BUILD.ra is generated with `bazel run gazelle -- update-repos
--verbose --build_files_dir=bazel hex.pm/ra@2.4.6`
Running gazelle this way will modify the WORKSPACE file, as gazelle
does not yet support MODULE.bazel files. Such changes to the WORKSPACE
can be dropped, and should not be committed. It may also update the
`moduleindex.yaml` file. Changes to `moduleindex.yaml` should be
committed.
However
* skip the explicit bazel/BUILD.osiris file, as osiris already contains the file in its repo
* skip the explict BUILD.inet_tcp_proxy_dist file, since the repo already contains a bazel BUILD.bazel file
gazelle command: `bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
inet_tcp_proxy_dist=github.com/rabbitmq/inet_tcp_proxy@master`
* jose is imported with `bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
jose=github.com/michaelklishin/erlang-jose@d63c1c5c8f9c1a4f1438e234b886de8607a0034e`
* Move the bats dep directly to WORKSPACE, drop workspace_helpers.bzl
* Use bzlmod in windows tests
Double quotes prevented `*` from being expanded, which made test-logs
from working on sharded test:
```
/Users/mkuratczyk/data/_bazel_mkuratczyk/a92ec86c7fe51656e9891e9f586b0a9c/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/open-test-logs.sh:
line 15: cd: bazel-testlogs/deps/rabbit/rabbit_stream_queue_SUITE/shard_1_of_*/test.outputs: No such file or directory
```
This folder does exist, but the `*` should be expanded with `12` in my
case.
My workflow is developing RabbitMQ on an Ubuntu server.
Since it doesn't have a desktop or browser, let's fallback
for `bazel run test-logs` command to start an HTTP server instead.
From now on, I can run conveniently:
```
david@nuc:~/workspace/rabbitmq-server$ bazel run test-logs //deps/rabbitmq_auth_backend_oauth2:unit_SUITE --config=local
INFO: Analyzed target //:test-logs (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:test-logs up-to-date:
bazel-bin/open-test-logs.sh
INFO: Elapsed time: 0.047s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Archive: outputs.zip
Couldn't find a suitable web browser!
Set the BROWSER environment variable to your desired browser.
Warning: program returned non-zero exit code #256
/usr/bin/open: 882: www-browser: not found
/usr/bin/open: 882: links2: not found
/usr/bin/open: 882: elinks: not found
/usr/bin/open: 882: links: not found
/usr/bin/open: 882: lynx: not found
/usr/bin/open: 882: w3m: not found
xdg-open: no method available for opening 'index.html'
Open your browser at http://nuc:8000/index.html
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
```
and then open http://nuc:8000/index.html in my browser on MacOS.
to have the equivalent of `make start-cluster` and `make stop-cluster`.
To create a 3-node RabbitMQ cluster:
```
bazel run --config=local start-cluster
```
To define number of nodes or a custom directory:
```
bazel run --config=local start-cluster NODES=5 TEST_TMPDIR="$HOME/scratch/myrabbit"
```
To stop the cluster:
```
bazel run --config=local stop-cluster
```
or, if started by the 2nd command:
```
bazel run --config=local stop-cluster NODES=5 TEST_TMPDIR="$HOME/scratch/myrabbit"
```
Also rework elixir dependency handling, so we no longer rely on mix to
fetch the rabbitmq_cli deps
Also:
- Specify ra version with a commit rather than a branch
- Fixup compilation options for erlang 23
- Add missing ra reference in MODULE.bazel
- Add missing flag in oci.yaml
- Reduce bazel rbe jobs to try to save memory
- Use bazel built erlang for erlang git master tests
- Use the same cache for all the workflows but windows
- Avoid using `mix local.hex --force` in elixir rules
- Fetching seems blocked in CI, and this should reduce hex api usage in
all builds, which is always nice
- Remove xref and dialyze tags since rules_erlang 3 includes them in
the defaults
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process