Fix some dialyzer build system errors in make (#11014)

* make amqp10_common dialyze green in make

* make rabbitmq_ct_client_helpers dialyze green with make

* fixup rabbitmq_prelaunch path ref

* Cleanup unused dep_* vars

* Fixup xref for rabbitmq_ct_helpers

I could not figure out how to make xref aware of the cli code without
also checking the cli code as well, and reporting additional errors

* remove unused file

* fix make diaylze for rabbitmq_stream_common

* update deps/oauth2_client/Makefile to match Bazel
This commit is contained in:
Rin Kuryloski 2024-04-16 13:26:51 +02:00 committed by GitHub
parent e96125bfd3
commit 4ec33c8678
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 14 additions and 81 deletions

View File

@ -33,7 +33,7 @@ XREF_SCOPE = app deps
# We add all the applications that are in non-standard paths # We add all the applications that are in non-standard paths
# so they are included in the analyses as well. # so they are included in the analyses as well.
XREF_EXTRA_APP_DIRS = $(filter-out deps/rabbitmq_cli/_build/dev/lib/rabbit_common/,$(wildcard deps/rabbitmq_cli/_build/dev/lib/*/)) deps/rabbit/apps/rabbitmq_prelaunch/ XREF_EXTRA_APP_DIRS = $(filter-out deps/rabbitmq_cli/_build/dev/lib/rabbit_common/,$(wildcard deps/rabbitmq_cli/_build/dev/lib/*/)) deps/rabbitmq_prelaunch/
# For Elixir protocols the right fix is to include the consolidated/ # For Elixir protocols the right fix is to include the consolidated/
# folders in addition to ebin/. However this creates conflicts because # folders in addition to ebin/. However this creates conflicts because

View File

@ -44,6 +44,8 @@ DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
rabbit_common/mk/rabbitmq-test.mk \ rabbit_common/mk/rabbitmq-test.mk \
rabbit_common/mk/rabbitmq-tools.mk rabbit_common/mk/rabbitmq-tools.mk
PLT_APPS = eunit
include rabbitmq-components.mk include rabbitmq-components.mk
include erlang.mk include erlang.mk

View File

@ -27,6 +27,7 @@ all() -> [test_add,
test_diff, test_diff,
test_foldl]. test_foldl].
-dialyzer({nowarn_function, test_add/1}).
test_add(_Config) -> test_add(_Config) ->
?assertEqual(1, add(0, 1)), ?assertEqual(1, add(0, 1)),
%% "Addition of a value outside the range %% "Addition of a value outside the range

View File

@ -2,35 +2,8 @@ PROJECT = oauth2_client
PROJECT_DESCRIPTION = OAuth2 client from the RabbitMQ Project PROJECT_DESCRIPTION = OAuth2 client from the RabbitMQ Project
PROJECT_MOD = oauth2_client_app PROJECT_MOD = oauth2_client_app
define PROJECT_APP_EXTRA_KEYS DEPS = rabbit rabbit_common
%% Hex.pm package informations. TEST_DEPS = rabbitmq_ct_helpers cowboy
{licenses, ["MPL-2.0"]},
{links, [
{"Website", "https://www.rabbitmq.com/"},
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/oauth2_client"}
]},
{build_tools, ["make", "rebar3"]},
{files, [
$(RABBITMQ_HEXPM_DEFAULT_FILES)
]}
endef
define HEX_TARBALL_EXTRA_METADATA
#{
licenses => [<<"MPL-2.0">>],
links => #{
<<"Website">> => <<"https://www.rabbitmq.com">>,
<<"GitHub">> => <<"https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/oauth2_client">>
}
}
endef
# Release artifacts are put in $(PACKAGES_DIR).
PACKAGES_DIR ?= $(abspath PACKAGES)
BUILD_DEPS = rabbit_common elvis_mk
DEPS = cowlib
TEST_DEPS = rabbit rabbitmq_ct_helpers cowboy
LOCAL_DEPS = ssl inets crypto public_key LOCAL_DEPS = ssl inets crypto public_key
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-test.mk DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-test.mk
@ -42,36 +15,5 @@ DEP_PLUGINS = rabbit_common/mk/rabbitmq-macros.mk \
rabbit_common/mk/rabbitmq-test.mk \ rabbit_common/mk/rabbitmq-test.mk \
rabbit_common/mk/rabbitmq-tools.mk rabbit_common/mk/rabbitmq-tools.mk
DEP_PLUGINS += elvis_mk
dep_elvis_mk = git https://github.com/inaka/elvis.mk.git master
include rabbitmq-components.mk include rabbitmq-components.mk
include erlang.mk include erlang.mk
HEX_TARBALL_FILES += rabbitmq-components.mk \
git-revisions.txt
# --------------------------------------------------------------------
# Compiler flags.
# --------------------------------------------------------------------
# gen_fsm is deprecated starting from Erlang 20, but we want to support
# Erlang 19 as well.
ERTS_VER := $(shell erl -version 2>&1 | sed -E 's/.* version //')
ERLANG_20_ERTS_VER := 9.0
ifeq ($(call compare_version,$(ERTS_VER),$(ERLANG_20_ERTS_VER),>=),true)
ERLC_OPTS += -Dnowarn_deprecated_gen_fsm
endif
# Dialyze the tests.
DIALYZER_OPTS += --src -r test
# --------------------------------------------------------------------
# ActiveMQ for the testsuite.
# --------------------------------------------------------------------
tests:: $(ACTIVEMQ)
ct ct-system: $(ACTIVEMQ)

View File

@ -6,5 +6,7 @@ DEPS = rabbit_common rabbitmq_ct_helpers amqp_client
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \ DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
rabbit_common/mk/rabbitmq-tools.mk rabbit_common/mk/rabbitmq-tools.mk
PLT_APPS = common_test
include ../../rabbitmq-components.mk include ../../rabbitmq-components.mk
include ../../erlang.mk include ../../erlang.mk

View File

@ -4,8 +4,10 @@ PROJECT_DESCRIPTION = Common Test helpers for RabbitMQ
DEPS = rabbit_common proper inet_tcp_proxy meck DEPS = rabbit_common proper inet_tcp_proxy meck
TEST_DEPS = rabbit TEST_DEPS = rabbit
dep_rabbit_common = git-subfolder https://github.com/rabbitmq/rabbitmq-server main deps/rabbit_common XREF_IGNORE = [ \
dep_rabbit = git-subfolder https://github.com/rabbitmq/rabbitmq-server main deps/rabbit {'Elixir.OptionParser',split,1}, \
{'Elixir.RabbitMQCtl',exec_command,2}]
dep_inet_tcp_proxy = git https://github.com/rabbitmq/inet_tcp_proxy master dep_inet_tcp_proxy = git https://github.com/rabbitmq/inet_tcp_proxy master
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \ DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \

View File

@ -1,18 +0,0 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel-erlang",
sha256 = "422a9222522216f59a01703a13f578c601d6bddf5617bee8da3c43e3b299fc4e",
strip_prefix = "bazel-erlang-1.1.0",
urls = ["https://github.com/rabbitmq/bazel-erlang/archive/refs/tags/1.1.0.zip"],
)
http_archive(
name = "rabbitmq-server",
strip_prefix = "rabbitmq-server-main",
urls = ["https://github.com/rabbitmq/rabbitmq-server/archive/main.zip"],
)
load("@rabbitmq-server//:workspace_helpers.bzl", "rabbitmq_external_deps")
rabbitmq_external_deps()

View File

@ -10,6 +10,8 @@ endef
DEPS = DEPS =
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers
PLT_APPS = osiris
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk