Skip to content

Commit 7d6b30a

Browse files
Merge pull request #8208 from rabbitmq/mergify/bp/v3.10.x/pr-8202
Github Actions pipeline to compare build systems nightly (backport #8084) (backport #8201) (backport #8202)
2 parents 80cc89b + b92601d commit 7d6b30a

File tree

29 files changed

+315
-62
lines changed

29 files changed

+315
-62
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Check Bazel/Erlang.mk Equivalence
2+
on:
3+
schedule:
4+
- cron: '0 2 * * *'
5+
workflow_dispatch:
6+
env:
7+
erlang_version: 25.3
8+
elixir_version: 1.14
9+
VERSION: 3.13.0
10+
PLUGINS: amqp10_common amqp10_client rabbitmq_amqp1_0 rabbitmq_auth_backend_cache rabbitmq_auth_backend_http rabbitmq_auth_backend_ldap rabbitmq_auth_backend_oauth2 rabbitmq_auth_mechanism_ssl rabbitmq_consistent_hash_exchange rabbitmq_event_exchange rabbitmq_federation rabbitmq_jms_topic_exchange rabbitmq_mqtt rabbitmq_random_exchange rabbitmq_recent_history_exchange rabbitmq_sharding rabbitmq_shovel rabbitmq_stomp rabbitmq_stream rabbitmq_trust_store rabbitmq_web_dispatch rabbitmq_management_agent rabbitmq_management rabbitmq_prometheus rabbitmq_federation_management rabbitmq_shovel_management rabbitmq_stream_management rabbitmq_top rabbitmq_tracing rabbitmq_web_mqtt rabbitmq_web_mqtt_examples rabbitmq_web_stomp rabbitmq_web_stomp_examples rabbitmq_aws rabbitmq_peer_discovery_common rabbitmq_peer_discovery_aws rabbitmq_peer_discovery_k8s rabbitmq_peer_discovery_consul rabbitmq_peer_discovery_etcd
11+
jobs:
12+
build-with-bazel:
13+
name: bazel build package-generic-unix.tar.xz
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
steps:
17+
- name: CHECKOUT REPOSITORY
18+
uses: actions/checkout@v3
19+
- name: CONFIGURE ERLANG
20+
uses: erlef/[email protected]
21+
with:
22+
otp-version: ${{ env.erlang_version }}
23+
elixir-version: ${{ env.elixir_version }}
24+
- name: CONFIGURE BAZEL
25+
run: |
26+
cat << EOF >> user.bazelrc
27+
build --disk_cache=
28+
build --color=yes
29+
EOF
30+
- name: BUILD package-generic-unix.tar.xz
31+
run: |
32+
bazelisk build //:package-generic-unix
33+
- name: RESOLVE ARCHIVES_DIR
34+
run: |
35+
echo "archives_dir=$(readlink -f bazel-bin)" >> $GITHUB_ENV
36+
- name: UPLOAD package-generic-unix.tar.xz
37+
uses: actions/[email protected]
38+
with:
39+
name: bazel-package-generic-unix.tar.xz
40+
path: ${{ env.archives_dir }}/package-generic-unix.tar.xz
41+
if-no-files-found: error
42+
43+
build-with-make:
44+
name: make package-generic-unix.tar.xz
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 15
47+
steps:
48+
- name: CHECKOUT REPOSITORY
49+
uses: actions/checkout@v3
50+
with:
51+
path: rabbitmq
52+
- name: CONFIGURE ERLANG
53+
uses: erlef/[email protected]
54+
with:
55+
otp-version: ${{ env.erlang_version }}
56+
elixir-version: ${{ env.elixir_version }}
57+
- name: BUILD package-generic-unix.tar.xz
58+
env:
59+
MAKE: make
60+
run: |
61+
$MAKE -C rabbitmq \
62+
source-dist \
63+
PACKAGES_DIR="$PWD/PACKAGES" \
64+
PLUGINS="$PLUGINS" \
65+
PROJECT_VERSION="$VERSION"
66+
$MAKE -C rabbitmq/packaging \
67+
package-generic-unix \
68+
PACKAGES_DIR="$PWD/PACKAGES" \
69+
VERSION="$VERSION"
70+
- name: UPLOAD package-generic-unix.tar.xz
71+
uses: actions/[email protected]
72+
with:
73+
name: make-package-generic-unix.tar.xz
74+
path: PACKAGES/rabbitmq-server-generic-unix-*.tar.xz
75+
if-no-files-found: error
76+
77+
compare:
78+
needs:
79+
- build-with-bazel
80+
- build-with-make
81+
name: Compare package-generic-unix.tar.xz
82+
runs-on: ubuntu-latest
83+
timeout-minutes: 10
84+
steps:
85+
- name: CHECKOUT REPOSITORY
86+
uses: actions/checkout@v3
87+
with:
88+
path: rabbitmq-server
89+
- name: CONFIGURE ERLANG
90+
uses: erlef/[email protected]
91+
with:
92+
otp-version: ${{ env.erlang_version }}
93+
elixir-version: ${{ env.elixir_version }}
94+
- name: DOWNLOAD bazel-package-generic-unix.tar.xz
95+
uses: actions/download-artifact@v3
96+
with:
97+
name: bazel-package-generic-unix.tar.xz
98+
- name: DOWNLOAD make-package-generic-unix.tar.xz
99+
uses: actions/download-artifact@v3
100+
with:
101+
name: make-package-generic-unix.tar.xz
102+
- name: EXPAND & COMPARE
103+
run: |
104+
mkdir bazel
105+
pushd bazel
106+
tar -xf ${{ github.workspace }}/package-generic-unix.tar.xz
107+
find . | sort > ${{ github.workspace }}/bazel.manifest
108+
popd
109+
110+
mkdir make
111+
pushd make
112+
tar -xf ${{ github.workspace }}/rabbitmq-server-generic-unix-*.tar.xz
113+
# delete an empty directory
114+
rm -d rabbitmq_server-*/plugins/rabbitmq_random_exchange-*/include
115+
find . | sort > ${{ github.workspace }}/make.manifest
116+
popd
117+
118+
tree -L 2 bazel
119+
tree -L 2 make
120+
121+
sleep 1
122+
123+
set -x
124+
125+
./rabbitmq-server/tools/compare_dist.sh make bazel

BUILD.bazel

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ exports_files([
7070
# gazelle:exclude deps/*/deps
7171
# gazelle:exclude deps/*/.erlang.mk
7272
# gazelle:exclude deps/rabbitmq_cli/_build
73+
# gazelle:exclude extra_deps
7374
# gazelle:exclude packaging
7475
# gazelle:exclude plugins
7576
# gazelle:exclude PACKAGES
77+
# gazelle:exclude plugins
78+
# gazelle:exclude release-notes
7679
# gazelle:exclude logs
7780
# gazelle:erlang_apps_dirs deps
7881
# gazelle:erlang_skip_rules test_erlang_app
@@ -215,13 +218,7 @@ iex_eval(
215218

216219
filegroup(
217220
name = "root-licenses",
218-
srcs = glob(
219-
["LICENSE*"],
220-
exclude = [
221-
"LICENSE.md",
222-
"LICENSE.txt",
223-
],
224-
),
221+
srcs = glob(["LICENSE*"]),
225222
visibility = ["//visibility:public"],
226223
)
227224

MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ erlang_package.hex_package(
199199
erlang_package.hex_package(
200200
name = "gen_batch_server",
201201
build_file = "@rabbitmq-server//bazel:BUILD.gen_batch_server",
202-
sha256 = "94a49a528486298b009d2a1b452132c0a0d68b3e89d17d3764cb1ec879b7557a",
203-
version = "0.8.7",
202+
sha256 = "c3e6a1a2a0fb62aee631a98cfa0fd8903e9562422cbf72043953e2fb1d203017",
203+
version = "0.8.8",
204204
)
205205

206206
erlang_package.hex_package(

bazel/BUILD.ranch

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ erlc_opts(
1717

1818
erlang_bytecode(
1919
name = "behaviours",
20-
srcs = ["src/ranch_transport.erl"],
21-
outs = ["ebin/ranch_transport.beam"],
22-
hdrs = [],
20+
srcs = [
21+
"src/ranch_transport.erl",
22+
],
23+
hdrs = [":public_and_private_hdrs"],
2324
app_name = "ranch",
25+
dest = "ebin",
2426
erlc_opts = "//:erlc_opts",
2527
)
2628

@@ -44,27 +46,10 @@ erlang_bytecode(
4446
"src/ranch_sup.erl",
4547
"src/ranch_tcp.erl",
4648
],
47-
outs = [
48-
"ebin/ranch.beam",
49-
"ebin/ranch_acceptor.beam",
50-
"ebin/ranch_acceptors_sup.beam",
51-
"ebin/ranch_app.beam",
52-
"ebin/ranch_conns_sup.beam",
53-
"ebin/ranch_conns_sup_sup.beam",
54-
"ebin/ranch_crc32c.beam",
55-
"ebin/ranch_embedded_sup.beam",
56-
"ebin/ranch_listener_sup.beam",
57-
"ebin/ranch_protocol.beam",
58-
"ebin/ranch_proxy_header.beam",
59-
"ebin/ranch_server.beam",
60-
"ebin/ranch_server_proxy.beam",
61-
"ebin/ranch_ssl.beam",
62-
"ebin/ranch_sup.beam",
63-
"ebin/ranch_tcp.beam",
64-
],
65-
hdrs = [],
49+
hdrs = [":public_and_private_hdrs"],
6650
app_name = "ranch",
6751
beam = [":behaviours"],
52+
dest = "ebin",
6853
erlc_opts = "//:erlc_opts",
6954
)
7055

@@ -99,19 +84,15 @@ filegroup(
9984
],
10085
)
10186

102-
filegroup(
103-
name = "private_hdrs",
104-
srcs = [],
105-
)
87+
filegroup(name = "private_hdrs")
10688

107-
filegroup(
108-
name = "public_hdrs",
109-
srcs = [],
110-
)
89+
filegroup(name = "public_hdrs")
11190

11291
filegroup(
11392
name = "priv",
114-
srcs = [],
93+
srcs = [
94+
"ebin/ranch.appup", # keep
95+
],
11596
)
11697

11798
filegroup(
@@ -138,13 +119,23 @@ filegroup(
138119
erlang_app(
139120
name = "erlang_app",
140121
srcs = [":all_srcs"],
122+
hdrs = [":public_hdrs"],
141123
app_name = "ranch",
142124
beam_files = [":beam_files"],
143125
extra_apps = ["ssl"],
126+
license_files = [":license_files"],
127+
priv = [":priv"],
144128
)
145129

146130
alias(
147131
name = "ranch",
148132
actual = ":erlang_app",
149133
visibility = ["//visibility:public"],
150134
)
135+
136+
filegroup(
137+
name = "license_files",
138+
srcs = [
139+
"LICENSE",
140+
],
141+
)

deps/amqp10_client/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ APP_EXTRA_KEYS = """%% Hex.pm package informations.
2828
{licenses, ["MPL-2.0"]},
2929
{links, [
3030
{"Website", "https://www.rabbitmq.com/"},
31-
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/deps/amqp10_client"}
31+
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/amqp10_client"}
3232
]},
3333
{build_tools, ["make", "rebar3"]},
3434
{files, [

deps/amqp10_client/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PACKAGES_DIR ?= $(abspath PACKAGES)
3131
BUILD_DEPS = rabbit_common elvis_mk
3232
DEPS = amqp10_common
3333
TEST_DEPS = rabbit rabbitmq_amqp1_0 rabbitmq_ct_helpers
34-
LOCAL_DEPS = ssl inets crypto
34+
LOCAL_DEPS = ssl inets crypto public_key
3535

3636
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-test.mk
3737
DEP_PLUGINS = rabbit_common/mk/rabbitmq-macros.mk \

deps/amqp10_common/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ APP_EXTRA_KEYS = """%% Hex.pm package informations.
5454
{licenses, ["MPL-2.0"]},
5555
{links, [
5656
{"Website", "https://www.rabbitmq.com/"},
57-
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/deps/amqp10_common"}
57+
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/amqp10_common"}
5858
]},
5959
{build_tools, ["make", "rebar3"]},
6060
{files, [
@@ -66,7 +66,7 @@ APP_EXTRA_KEYS = """%% Hex.pm package informations.
6666
"rabbitmq-components.mk",
6767
"README",
6868
"README.md",
69-
"mk"
69+
"src"
7070
]}
7171
"""
7272

deps/rabbit/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,16 +1045,16 @@ genrule(
10451045
outs = ["manpages.tar"],
10461046
cmd = """set -euo pipefail
10471047
1048-
DESTDIR=manpages-tmp/share/man
1048+
DESTDIR=share/man
10491049
mkdir -p $${DESTDIR}
10501050
for mp in $(SRCS); do
10511051
section=$${mp##*.}
10521052
mkdir -p $${DESTDIR}/man$$section
10531053
gzip < $$mp \\
10541054
> $${DESTDIR}/man$$section/$$(basename $$mp).gz
10551055
done
1056-
tar --strip-components 1 -cf $@ manpages-tmp/*
1057-
rm -dr manpages-tmp
1056+
tar -cf $@ share
1057+
rm -dr share
10581058
""",
10591059
visibility = ["//visibility:public"],
10601060
)

deps/rabbit/app.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,7 @@ def all_srcs(name = "all_srcs"):
471471

472472
filegroup(
473473
name = "priv",
474-
srcs = [
475-
"priv/schema/.gitignore",
476-
"priv/schema/rabbit.schema",
477-
],
474+
srcs = ["priv/schema/rabbit.schema"], #keep
478475
)
479476
filegroup(
480477
name = "private_hdrs",

deps/rabbit_common/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endef
2828
LOCAL_DEPS = compiler crypto public_key sasl ssl syntax_tools tools xmerl
2929
DEPS = jsx recon credentials_obfuscation
3030

31-
dep_credentials_obfuscation = hex 3.2.0
31+
dep_credentials_obfuscation = hex 3.4.0
3232

3333
# Variables and recipes in development.*.mk are meant to be used from
3434
# any Git clone. They are excluded from the files published to Hex.pm.

0 commit comments

Comments
 (0)