Commit Graph

69 Commits

Author SHA1 Message Date
Loïc Hoguin a64d1e67fc
Remove looking_glass
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.
2024-06-26 09:56:46 +02:00
Rin Kuryloski 5debebfaf3 Use rules_elixir to build the cli without mix
Certain elixir-native deps are still build with mix, but this can be
corrected later
2024-06-18 14:50:34 +02:00
Rin Kuryloski c9ab302e79
Remove rules_docker in favor of rules_oci (#10869)
Local builds of images are extremely slow, but buildbuddy runners
don't have the emulator available
2024-04-02 19:04:38 +02:00
Rin Kuryloski fc5f22b205 Clean up moduleindex.yaml by regenerating it 2024-02-20 11:11:33 +01:00
Michal Kuratczyk 9373661a33
Revert "Remove Elixir json dep in a few more places #9926"
This reverts commit 50e1fed344.
2023-11-17 13:08:26 +01:00
Michael Klishin 50e1fed344
Remove Elixir json dep in a few more places #9926
(cherry picked from commit d419b0a431)
2023-11-16 10:59:42 -05:00
GitHub 6a78a2bb9b bazel run gazelle 2023-09-20 04:03:13 +00:00
Michael Klishin 439bc35916
BUILD.bazel: fix a few typos 2023-09-19 18:39:24 -04:00
Simon Unge 588f932e33 Expose the "stop-broker" CMD 2023-09-19 19:53:05 +00:00
Simon Unge 203eceb85b Expose the "start-background-broker" CMD 2023-09-19 17:45:33 +00:00
Rin Kuryloski c0bbb78033 Gazelle: ignore test deps fetched by make
Accidentally running gazelle before `git clean -xffd deps` should
produce less of a confusing diff
2023-08-28 18:08:15 +02:00
Rin Kuryloski 2c2b11689e Add `bazel run rabbitmq-upgrade` 2023-06-01 11:54:32 +02:00
Rin Kuryloski 55d3d22bca Place looking_glass in the broker plugins file if `-c dbg` is set
in bazel
2023-05-30 10:34:01 +02:00
Rin Kuryloski eb94a58bc9 Add a workflow to compare the bazel/erlang.mk output
To catch any drift between the builds
2023-05-15 13:54:14 +02:00
Rin Kuryloski 4c9f31473a Also exclude the .erlang.mk directory in gazelle 2023-05-15 13:06:37 +02:00
Rin Kuryloski 11b79f37a8 Exclude nested deps fetched by make from gazelle 2023-05-15 09:55:33 +02:00
Rin Kuryloski dad871e86c Update rules_pkg to 0.9.1 2023-05-12 12:45:01 +02:00
Rin Kuryloski a944439fba Replace globs in bazel with explicit lists of files
As this is preferred in rules_erlang 3.9.14
2023-04-25 17:29:12 +02:00
Rin Kuryloski 8de8f59d47 Use gazelle generated bazel files
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.
2023-04-17 18:13:18 +02:00
Rin Kuryloski 42268d8c75 Use rules_erlang 3.9.12 which has the new plt attrs 2023-04-14 11:41:37 +02:00
Rin Kuryloski c8db137ada Fix dialyzer errors for rabbitmq_shovel on OTP 26
`-Wunknown` is on by default in OTP 26, so for some plugins we must
now set `-Wno_unknown`
2023-04-13 22:39:25 +02:00
Rin Kuryloski 6209180f80 Use pkg_files rules to avoid extra tars
in package-generic-unix and source_archive macros
2023-03-14 23:18:00 +01:00
Rin Kuryloski 778ee998a6 Further annotate test deps with new rules_erlang 3.9.9 features 2023-02-28 16:47:02 +01:00
Rin Kuryloski 2c7b37d7af
Use gazelle for external erlang deps (#6935)
* 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
2023-01-25 09:41:56 +01:00
Rin Kuryloski 06a330f553 format with buildifier 2023-01-05 12:39:25 +01:00
Michael Klishin dc14942a2f
Merge pull request #6704 from SimonUnge/bazel-minor-updates
Bazel minor updates
2022-12-20 23:23:48 +04:00
Simon Unge 5a7c4d6556 See #6703. Add rabbit-queues target 2022-12-20 15:26:13 +01:00
Rin Kuryloski 3db02f7f9f Update `//:test-logs` and `//:test-node-data`
to handle the new ct_logdir flag
2022-12-19 13:49:07 +01:00
Simon Unge 20b23526e7 See #6645. Improving error output 2022-12-12 11:42:05 -08:00
Rin Kuryloski ce69ff1c58 Allow `bazel run rabbitmq-streams` 2022-12-08 13:03:17 +01:00
Michal Kuratczyk d35ccd60c7
Fix string quotes
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.
2022-11-21 12:35:44 +01:00
Rin Kuryloski 535ac31542 Rework package_generic_unix & source_archive bazel macros
So that they are usable in other bazel modules depending on
rabbitmq-server (such as plugins)
2022-10-27 13:13:25 +02:00
Rin Kuryloski 102e6cf964 Use @rules_erlang//:debug_build instead of //:debug_build
This avoids the need for modules depening on rabbitmq-server to
declare their own copy of it
2022-10-27 09:27:20 +02:00
Rin Kuryloski 4cf410b268 Add a --test_build flag for building the broker for mixed versions 2022-10-19 13:51:49 +02:00
Rin Kuryloski 8537d0428b Use rules_erlang 3.6.3
Use the new @erlang_config repo from rules_erlang 3.6+ for simplified
config and the elimiation of the need for --config=local
2022-09-19 16:43:10 +02:00
Rin Kuryloski 27cad09e01 Fixup the source_archive macro in dist.bzl 2022-07-14 16:15:11 +02:00
Philip Kuryloski e2ca5d4190 Use keyword args in bazel macros as per buildifier linter 2022-07-11 18:16:25 +02:00
Philip Kuryloski 3f3df481de Adjust macros in dist.bzl to be used more generally
and not just at the root of this repo
2022-07-11 17:52:34 +02:00
David Ansari 107b8a4de1 Add `bazel run test-logs` fallback for non-desktop session
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.
2022-07-05 10:10:58 +00:00
David Ansari b08ef4583e Add Bazel targets start-cluster and stop-cluster
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"
```
2022-07-04 13:54:26 +00:00
Philip Kuryloski 8facde8f8d Allow `bazel run test-logs` to work when logs are compressed
As happens if the spawn_strategy is not set to local

Also makes the implementaion of related commands more consistent
2022-06-20 18:18:22 +02:00
Philip Kuryloski 34db1a3c38 Add a rule for building a source archive
that includes the external dependencies
2022-06-14 10:44:09 +02:00
Philip Kuryloski 327f075d57 Make rabbitmq-server work with rules_erlang 3
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
2022-06-08 14:04:53 +02:00
Philip Kuryloski 5f61a11224 rename test-node-logs -> test-node-data 2022-05-09 11:01:54 +02:00
Philip Kuryloski 28f1455542 Add test-node-logs and remote-test-node-logs rules for bazel
For convenience when opening up the directory containing the rabbitmq
node logs produced by integration tests
2022-05-09 10:51:44 +02:00
Philip Kuryloski 7c0d26c150 Add helpers for quickly opening test logs from bazel
e.g. :
bazel run test-logs //deps/rabbitmq_auth_backend_oauth2:unit_SUITE
bazel run remote-test-logs //deps/rabbitmq_auth_backend_oauth2:unit_SUITE
2022-04-26 11:55:26 +02:00
Philip Kuryloski efcd881658 Use rules_erlang v2
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
2022-01-18 13:43:46 +01:00
Philip Kuryloski 70ef6b6984 Disable +deterministic in compilation_mode dbg under bazel
This allows compiling and reloading code from the erlang shell when
running the broker with `bazel run -c dbg broker`
2022-01-03 12:38:06 +01:00
Philip Kuryloski c8bc41f465 Cleanup BUILD.bazel 2021-12-17 17:08:16 +01:00
Philip Kuryloski da53d4018a Remove incorrect comment 2021-11-18 21:36:48 +01:00