Commit Graph

42 Commits

Author SHA1 Message Date
Rin Kuryloski 3465eef2cd Use the latest rules_erlang & rules_elixir 2024-06-20 11:13:02 +02:00
Rin Kuryloski 46250dce11 ensure that csv and json elixir deps are embedded in the cli escript
also set 'cfg =' appropriately
2024-06-18 16:50:02 +02:00
Rin Kuryloski f2add661f4 Check that the cli can compile with --warnings-as-errors in ci
It's technically a build target, so we didn't need to create a whole
new test rule, but it's marked as "manual" so that it doesn't cause
bazel build //... to fail
2024-06-18 14:50:35 +02:00
Rin Kuryloski 662ad8edf4 amqp_client system_SUITE apparently needs the cli on the code path
I'm not actually sure why the changes to rabbitmqctl compilation
necessitated this change, but it seems to be the case
2024-06-18 14:50:35 +02:00
Rin Kuryloski ba8cf2c2f7 Set the locale with elixir 2024-06-18 14:50:34 +02:00
Rin Kuryloski 35171ebdeb Add erlang binaries to the path in rabbitmq-run.sh
As they are no longer added automatically by the enclosing rule
2024-06-18 14:50:34 +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
Marcial Rosales 41237fbb3b Fix gaxelle issues around oauth2 dependencies 2024-02-14 18:55:39 +01:00
Michael Davis cc12d73b91
Add Bazel test for compiling rabbitmqctl with warnings-as-errors
This test should fail when `mix compile --warnings-as-errors` gives
any warnings.
2024-02-01 15:39:47 -05:00
Michal Kuratczyk db56f662af
Revert "Bazel bits for #9926"
This reverts commit 8d402e75b7.
2023-11-17 13:07:28 +01:00
Michael Klishin 8d402e75b7
Bazel bits for #9926 2023-11-16 09:46:19 -05:00
Michal Kuratczyk b2c01e3e8e
Remove dialyxir from bazel 2023-11-10 15:37:11 +01:00
Rin Kuryloski 4abee60c4d Run cli format check on elixir 1.15 only 2023-07-04 17:45:50 +02:00
GitHub 823b983474 bazel run gazelle 2023-05-27 04:03:48 +00:00
Michal Kuratczyk fb3655610c
Update CSV to 3.0.5;; remove unused dep 2023-05-26 18:04:42 +02:00
GitHub a29b6fd84d bazel run gazelle 2023-05-17 04:02:31 +00:00
GitHub c344240d30 bazel run gazelle 2023-05-13 04:02:10 +00:00
Rin Kuryloski ea895a0023 Account for Elixir containing several core applications
- eex
- elixir
- ex_unit
- iex
- logger
- mix

So that apps (like rabbitmq_cli) can dialyze against the extra
components
2023-05-12 08:26:42 +02:00
Rin Kuryloski 08061144ad Pass csv and json to rabbitmq_cli plt
So that they are no longer reported as unknown in
//deps/rabbitmq_cli:dialyze
2023-05-12 08:26:42 +02:00
Rin Kuryloski 19f4abd55b Build cli deps as .ez archives
This provides an elixir/erlang agnostic way of providing them other
erlang rules
2023-05-12 08:26:42 +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 8a7eee6a86 Ignore warnings when building plt files for dependencies
As we don't generally care if a dependency has warnings, only the
target
2023-04-17 10:09:24 +02:00
Rin Kuryloski 12153ed823 Fetch github.com/hexpm/hex via bzlmod
This fixes a visibility issue when a bazel module depends on
rabbitmq-server
2023-04-13 09:45:28 +02:00
Rin Kuryloski f09b31e8c5
Fetch all cli deps with bazel (#7875)
* Fetch all prod cli deps with bazel

This avoids issues with hex and OTP 26, and is needed for offline
bazel builds anyway

* Fetch test cli deps with bazel

* mix format
2023-04-12 16:27:32 +04:00
Rin Kuryloski eba1d531c9 Fetch cli prod deps via bazel or erlang.mk instead of mix
In preparation for offline bazel builds
2023-03-14 23:11:36 +01:00
Rin Kuryloski e66e5ed62d Pin rabbitmq_cli non-test deps
- Use the same stdout_formatter copy for both erlang and rabbitmq_cli
- Use the same observer_cli copy for both erlang and rabbitmq_cli
2023-03-01 09:54:35 +01:00
Alexey Lebedeff 949b53543d Fix all dependencies for the dialyzer
This is the latest commit in the series, it fixes (almost) all the
problems with missing and circular dependencies for typing.

The only 2 unsolved problems are:

- `lg` dependency for `rabbit` - the problem is that it's the only
  dependency that contains NIF. And there is no way to make dialyzer
  ignore it - looks like unknown check is not suppressable by dialyzer
  directives. In the future making `lg` a proper dependency can be a
  good thing anyway.

- some missing elixir function in `rabbitmq_cli` (CSV, JSON and
  logging related).

- `eetcd` dependency for `rabbitmq_peer_discovery_etcd` - this one
  uses sub-directories in `src/`, which confuses dialyzer (or our bazel
  machinery is not able to properly handle it). I've tried the latest
  rules_erlang which flattens directory for .beam files, but it wasn't
  enough for dialyzer - it wasn't able to find core erlang files. This
  is a niche plugin and an unusual dependency, so probably not worth
  investigating further.
2023-02-13 17:37:44 +01:00
Rin Kuryloski bdb2046185
Add rabbitmq_cli dialyze to bazel (#7066)
* Add rabbitmq_cli dialyze to bazel

and fix a number of warnings

Because we stop mix from recompiling rabbit_common in bazel, many
unknown functions are reported, so this dialyzer analysis is somewhat
incomplete.

* Use erlang dialyzer for rabbitmq_cli rather than mix dialyzer

Since this resolves all of the rabbit functions, there are far fewer
unknown functions.

Requires yet to be released rules_erlang 3.9.2

* Temporarily use pre-release rules_erlang

So that checks can run on this PR without a release

* Fix additional dialyzer warnings in rabbitmq_cli

* rabbitmq_cli: mix format

* Additional fixes for ignored return values

* Revert "Temporarily use pre-release rules_erlang"

This reverts commit c16b5b6815.

* Use rules_erlang 3.9.2
2023-01-31 15:05:52 +01:00
Rin Kuryloski dd9a8c96f1 Change `alias` to `test_suite` in deps/rabbitmq_cli/BUILD.bazel
bazel test won't work correctly on an alias, apparently:
https://docs.bazel.build/versions/2.2.0/be/general.html#alias

the recommended workaround is to use a test_suite instead
2023-01-19 22:06:56 +01:00
Michael Klishin 1b1fdfbed5
Merge pull request #6316 from rabbitmq/rabbitmq-server-6289
CLI tools: discover commands in plugins that are enabled indirectly as dependencies; rework plugin state assertions
2022-11-03 17:19:27 +04:00
Philip Kuryloski 6c3664d871 Filter the rabbitmq_cli format check out on windows
When I ran it manually, all files were reported as mis-formatted. I
didn't investigate further, may line endings or encoding is an issue?
It seems worth it to skip the check for now since we don't run
integration test on windows with bazel yet anyway.
2022-11-02 14:24:44 +01:00
Rin Kuryloski cb935a034e Reduce unnecessary setup in rabbitmq_cli formatting check 2022-11-02 10:41:30 +01:00
Rin Kuryloski d15599940d Split rabbitmq_cli format check into a separate test target in bazel
`bazel test //deps/rabbitmq_cli:all` runs tests and format check
`bazel test //deps/rabbitmq_cli:tests` runs just the tests
`bazel test //deps/rabbitmq_cli:check_formatted` runs just the format
check
2022-11-02 10:17:08 +01:00
Simon Unge cd1ac5b66c
See Issue 6020. Add rabbitmq_stream_management plugin to test suite 2022-11-02 13:08:44 +04:00
Rin Kuryloski a71ff1341e Add 'mix format --check-formatted' to the rabbitmqctl_tests in bazel
to match the check on the Makefile side that was recently introduced
2022-10-04 14:59:45 +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 f52efbb909 Fixup rabbitmqctl build for missing formatters & otp 25 2022-06-13 12:08:57 +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 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 3eac3cf8a8 Remove unused load statements from bazel files 2021-07-12 12:10:26 +02:00
Philip Kuryloski c5eb1ab725 Mark the rabbitmq_cli suite flaky in bazel
It fails occassionally due to elixir compiler flakiness
2021-05-03 10:27:36 +02:00
Philip Kuryloski 388654c542
Add a partial Bazel build (#2938)
Adds WORKSPACE.bazel, BUILD.bazel & *.bzl files for partial build & test with Bazel. Introduces a build-time dependency on https://github.com/rabbitmq/bazel-erlang
2021-03-29 11:01:43 +02:00