-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check additional applications when comparing bazel and make results (#…
…8209) * Check additional applications when comparing bazel and make results * Sync bazel/make for amqp_client * Do not fail-fast in build system comparison * promethus -> prometheus * Regenerate BUILD.redbug * When comparing build systems & .app files ignore empty 'registered' It's listed as a required key in https://www.erlang.org/doc/man/app.html, but the same docs state the default is "[]". It seems to ignore it if it's empty. * Copy bazel/BUILD.osiris from BUILD.bazel in the osiris repo Normally it would be generated with `bazel run gazelle-update-repos -- -args osiris@1.5.1=github.com/rabbitmq/osiris@v1.5.1`, but in this case we just want to match it's compilation with erlang.mk with some manual tweaks. * Use elixir 1.15, otherwise mix format fails * Sync bazel/make for rabbitmq_web_dispatch, rabbitmq_management_agent (cherry picked from commit ca1806d) # Conflicts: # .github/workflows/check-build-system-equivalence.yaml # MODULE.bazel
- Loading branch information
1 parent
d63e1fe
commit 3b36275
Showing
10 changed files
with
218 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
load("@rules_erlang//:erlang_app.bzl", "erlang_app", "test_erlang_app") | ||
load("@rules_erlang//:xref2.bzl", "xref") | ||
load("@rules_erlang//:dialyze.bzl", "DEFAULT_PLT_APPS", "dialyze", "plt") | ||
load("@rules_erlang//:eunit2.bzl", "eunit") | ||
load("@rules_erlang//:ct.bzl", "assert_suites2", "ct_suite") | ||
|
||
NAME = "osiris" | ||
|
||
VERSION = "1.5.1" | ||
|
||
DESCRIPTION = "New project" | ||
|
||
APP_ENV = """[ | ||
{data_dir, "/tmp/osiris"}, | ||
{port_range, {6000, 6500}}, | ||
{max_segment_size_chunks, 256000}, | ||
{replication_transport, tcp}, | ||
{replica_forced_gc_default_interval, 4999} | ||
]""" | ||
|
||
EXTRA_APPS = [ | ||
"sasl", | ||
"crypto", | ||
] | ||
|
||
DEPS = [ | ||
"@gen_batch_server//:erlang_app", | ||
] | ||
|
||
RUNTIME_DEPS = [ | ||
"@seshat//:erlang_app", | ||
] | ||
|
||
erlang_app( | ||
app_description = DESCRIPTION, | ||
app_env = APP_ENV, | ||
app_name = NAME, | ||
app_version = VERSION, | ||
extra_apps = EXTRA_APPS, | ||
runtime_deps = RUNTIME_DEPS, | ||
deps = DEPS, | ||
) | ||
|
||
test_erlang_app( | ||
app_description = DESCRIPTION, | ||
app_env = APP_ENV, | ||
app_name = NAME, | ||
app_version = VERSION, | ||
extra_apps = EXTRA_APPS, | ||
runtime_deps = RUNTIME_DEPS, | ||
deps = DEPS, | ||
) | ||
|
||
xref() | ||
|
||
PLT_APPS = DEFAULT_PLT_APPS + [ | ||
"compiler", | ||
"crypto", | ||
"tools", | ||
"runtime_tools", | ||
"mnesia", | ||
"public_key", | ||
"asn1", | ||
"ssl", | ||
"inets", | ||
] | ||
|
||
plt( | ||
name = "deps_plt", | ||
apps = PLT_APPS, | ||
for_target = ":erlang_app", | ||
) | ||
|
||
dialyze( | ||
name = "dialyze", | ||
size = "small", | ||
dialyzer_opts = [ | ||
"-Werror_handling", | ||
"-Wunmatched_returns", | ||
], | ||
plt = ":deps_plt", | ||
target = ":erlang_app", | ||
) | ||
|
||
plt( | ||
name = "test_deps_plt", | ||
apps = PLT_APPS + [ | ||
"eunit", | ||
"common_test", | ||
"debugger", | ||
"xmerl", | ||
"ftp", | ||
"ssh", | ||
"snmp", | ||
"wx", | ||
"syntax_tools", | ||
], | ||
for_target = ":test_erlang_app", | ||
) | ||
|
||
dialyze( | ||
name = "dialyze_tests", | ||
size = "small", | ||
beam = [ | ||
f.replace("test/", "").replace(".erl", "_beam_files") | ||
for f in glob(["test/*_SUITE.erl"]) | ||
], | ||
dialyzer_opts = [ | ||
"-Werror_handling", | ||
"-Wunmatched_returns", | ||
], | ||
plt = ":test_deps_plt", | ||
) | ||
|
||
eunit( | ||
name = "eunit", | ||
eunit_opts = [ | ||
"no_tty", | ||
"{report, {eunit_progress, [colored, profile]}}", | ||
], | ||
target = ":test_erlang_app", | ||
deps = [ | ||
"@eunit_formatters//:erlang_app", | ||
], | ||
) | ||
|
||
[ct_suite( | ||
name = f.replace("test/", "").replace(".erl", ""), | ||
) for f in glob( | ||
["test/*_SUITE.erl"], | ||
exclude = ["test/osiris_SUITE.erl"], | ||
)] | ||
|
||
ct_suite( | ||
name = "osiris_SUITE", | ||
data = [ | ||
"@tls_gen//:basic", | ||
], | ||
test_env = { | ||
"DEPS_DIR": "$TEST_SRCDIR/$TEST_WORKSPACE/external", | ||
}, | ||
) | ||
|
||
assert_suites2() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,62 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
set -uo pipefail | ||
|
||
GOLDEN=$1 | ||
SECOND=$2 | ||
|
||
failure_count=0 | ||
|
||
echo "Check both have INSTALL" | ||
test -f $GOLDEN/rabbitmq_server-${VERSION}/INSTALL | ||
test -f $SECOND/rabbitmq_server-${VERSION}/INSTALL | ||
test -f $GOLDEN/rabbitmq_server-${VERSION}/INSTALL || ((failure_count++)) | ||
test -f $SECOND/rabbitmq_server-${VERSION}/INSTALL || ((failure_count++)) | ||
|
||
echo "Check LICENSEs" | ||
diff \ | ||
<(grep LICENSE make.manifest) \ | ||
<(grep LICENSE bazel.manifest | grep -v ".md" | grep -v ".txt") | ||
<(grep LICENSE bazel.manifest | grep -v ".md" | grep -v ".txt") \ | ||
|| ((failure_count++)) | ||
|
||
echo "Check plugins" | ||
plugins_rel=rabbitmq_server-${VERSION}/plugins | ||
diff <(grep $plugins_rel make.manifest | grep -v ".ez") <(grep $plugins_rel bazel.manifest | grep -v ".ez") | ||
diff \ | ||
<(grep $plugins_rel make.manifest | grep -v ".ez") \ | ||
<(grep $plugins_rel bazel.manifest | grep -v ".ez") \ | ||
|| ((failure_count++)) | ||
|
||
echo "Plugins exist with same version and deps" | ||
for p in ${PLUGINS}; do | ||
for p in ${PLUGINS} ${EXTRA_PLUGINS}; do | ||
echo "$p" | ||
f="$(cd $GOLDEN && ls -d $plugins_rel/$p-*)" | ||
test -f $GOLDEN/$f/ebin/$p.app || (echo "$GOLDEN/$f/ebin/$p.app does not exist"; exit 1) | ||
test -d $SECOND/$f || (echo "$SECOND/$f does not exist"; exit 1) | ||
test -f $SECOND/$f/ebin/$p.app || (echo "$SECOND/$f/ebin/$p.app does not exist"; exit 1) | ||
test -f $GOLDEN/$f/ebin/$p.app || (echo "$GOLDEN/$f/ebin/$p.app does not exist"; ((failure_count++))) | ||
test -d $SECOND/$f || (echo "$SECOND/$f does not exist"; ((failure_count++))) | ||
test -f $SECOND/$f/ebin/$p.app || (echo "$SECOND/$f/ebin/$p.app does not exist"; ((failure_count++))) | ||
./rabbitmq-server/tools/erlang_app_equal \ | ||
$GOLDEN/$f/ebin/$p.app \ | ||
$SECOND/$f/ebin/$p.app | ||
$GOLDEN/$f/ebin/$p.app \ | ||
$SECOND/$f/ebin/$p.app \ | ||
|| ((failure_count++)) | ||
done | ||
|
||
echo "Both have escript" | ||
escript_rel=rabbitmq_server-${VERSION}/escript | ||
diff <(grep $escript_rel make.manifest) <(grep $escript_rel bazel.manifest) | ||
diff \ | ||
<(grep $escript_rel make.manifest) \ | ||
<(grep $escript_rel bazel.manifest) \ | ||
|| ((failure_count++)) | ||
|
||
echo "Both have sbin" | ||
sbin_rel=rabbitmq_server-${VERSION}/sbin | ||
diff <(grep $sbin_rel make.manifest) <(grep $sbin_rel bazel.manifest) | ||
diff \ | ||
<(grep $sbin_rel make.manifest) \ | ||
<(grep $sbin_rel bazel.manifest) \ | ||
|| ((failure_count++)) | ||
|
||
echo "Both have manpages" | ||
manpages_rel=rabbitmq_server-${VERSION}/share/man | ||
diff <(grep $manpages_rel make.manifest) <(grep $manpages_rel bazel.manifest) | ||
diff \ | ||
<(grep $manpages_rel make.manifest) \ | ||
<(grep $manpages_rel bazel.manifest) \ | ||
|| ((failure_count++)) | ||
|
||
echo "There were $failure_count failures." | ||
|
||
echo "PASS" | ||
exit $failure_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters