Fix Compilation failed

This commit is contained in:
houyingchao 2022-04-07 17:26:45 +08:00
parent e3f376fd1d
commit 8b437abb1d
7 changed files with 85 additions and 242 deletions

View File

@ -10,8 +10,8 @@
%global __with_java 1
%global __with_wxwidgets 1
Name: erlang
Version: 21.3.3
Release: 3
Version: 23.3.4.9
Release: 1
Summary: General-purpose programming language and runtime environment
License: ASL 2.0
URL: https://www.erlang.org
@ -30,9 +30,7 @@ Patch6: otp-0006-Do-not-install-erlang-sources.patch
Patch7: otp-0007-Add-extra-search-directory.patch
Patch8: otp-0008-Avoid-forking-sed-to-get-basename.patch
Patch9: otp-0009-Load-man-pages-from-system-wide-directory.patch
Patch10: otp-0010-Improve-nodes-querying.patch
Patch11: extern-ei-default-socket-callbacks.patch
BuildRequires: gcc gcc-c++ flex
BuildRequires: gcc gcc-c++ flex make
%if %{with doc}
%if 0%{?need_bootstrap} < 1
BuildRequires: erlang
@ -888,6 +886,8 @@ useradd -r -g epmd -d /dev/null -s /sbin/nologin \
%files erl_interface
%{_libdir}/erlang/lib/erl_interface-*/
%{_libdir}/erlang/bin/erl_call
%{_libdir}/erlang/erts-*/bin/erl_call
%if %{with doc}
%{_mandir}/man1/erl_call.*
%{_mandir}/man3/ei.*
@ -946,6 +946,7 @@ useradd -r -g epmd -d /dev/null -s /sbin/nologin \
%{_libdir}/erlang/erts-*/bin/start.src
%{_libdir}/erlang/erts-*/bin/start_erl.src
%{_libdir}/erlang/erts-*/bin/to_erl
%{_libdir}/erlang/erts-*/bin/yielding_c_fun
%{_libdir}/erlang/erts-*/include
%{_libdir}/erlang/erts-*/lib/
%{_libdir}/erlang/erts-*/src/
@ -1187,7 +1188,6 @@ useradd -r -g epmd -d /dev/null -s /sbin/nologin \
%endif
%files otp_mibs
%{_libdir}/erlang/lib/otp_mibs-*/
%if %{with doc}
%{_mandir}/man3/otp_mib.*
%endif
@ -1724,6 +1724,9 @@ useradd -r -g epmd -d /dev/null -s /sbin/nologin \
%endif
%changelog
* Thu Apr 07 2022 houyingchao <houyingchao@h-partners.com>
- Fix compilation failed
* Fri Jul 30 2021 liping <liping136@huawei.com> - 21.3.3-3
- Support parallel compilation

View File

@ -1,11 +0,0 @@
--- a/lib/erl_interface/src/misc/ei_portio.h 2021-08-03 11:40:41.087250211 +0800
+++ b/lib/erl_interface/src/misc/ei_portio.h 2021-08-03 11:40:19.690906742 +0800
@@ -47,7 +47,7 @@
int ei_socket_callbacks_have_writev__(ei_socket_callbacks *cbs);
#endif
-ei_socket_callbacks ei_default_socket_callbacks;
+extern ei_socket_callbacks ei_default_socket_callbacks;
#define EI_FD_AS_CTX__(FD) \
((void *) (long) (FD))

View File

@ -14,7 +14,7 @@ https://bugzilla.redhat.com/818419
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/lib/asn1/c_src/Makefile b/lib/asn1/c_src/Makefile
index 1f714df357..95835d6ed2 100644
index cb606fd74e..48a7c2f4f1 100644
--- a/lib/asn1/c_src/Makefile
+++ b/lib/asn1/c_src/Makefile
@@ -136,8 +136,6 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@ -27,10 +27,10 @@ index 1f714df357..95835d6ed2 100644
release_docs_spec:
diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in
index a4a6c158cc..13658302f5 100644
index c94f01420e..e2cae1692f 100644
--- a/lib/crypto/c_src/Makefile.in
+++ b/lib/crypto/c_src/Makefile.in
@@ -216,16 +216,11 @@ docs:
@@ -237,16 +237,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
@ -48,12 +48,12 @@ index a4a6c158cc..13658302f5 100644
release_docs_spec:
diff --git a/lib/erl_interface/src/Makefile.in b/lib/erl_interface/src/Makefile.in
index b0bb9bfadf..eeff0338c3 100644
index 7ff3f09abb..2b94ce7de0 100644
--- a/lib/erl_interface/src/Makefile.in
+++ b/lib/erl_interface/src/Makefile.in
@@ -842,14 +842,14 @@ ifneq ($(EXE_TARGETS),)
@@ -748,14 +748,13 @@ release: opt
$(INSTALL_DATA) $(OBJ_TARGETS) "$(RELEASE_PATH)/usr/lib"
$(INSTALL_PROGRAM) $(EXE_TARGETS) "$(RELSYSDIR)/bin"
endif
$(INSTALL_DATA) $(EXTRA) "$(RELSYSDIR)/src"
- $(INSTALL_DATA) connect/*.[ch] "$(RELSYSDIR)/src/connect"
- $(INSTALL_DATA) decode/*.[ch] "$(RELSYSDIR)/src/decode"
@ -61,7 +61,7 @@ index b0bb9bfadf..eeff0338c3 100644
- $(INSTALL_DATA) epmd/*.[ch] "$(RELSYSDIR)/src/epmd"
- $(INSTALL_DATA) misc/*.[ch] "$(RELSYSDIR)/src/misc"
- $(INSTALL_DATA) registry/*.[ch] "$(RELSYSDIR)/src/registry"
- $(INSTALL_DATA) legacy/*.[ch] "$(RELSYSDIR)/src/legacy"
- $(INSTALL_DATA) global/*.[ch] "$(RELSYSDIR)/src/global"
- $(INSTALL_DATA) prog/*.[ch] "$(RELSYSDIR)/src/prog"
+ $(INSTALL_DATA) connect/*.h "$(RELSYSDIR)/src/connect"
+ $(INSTALL_DATA) decode/*.h "$(RELSYSDIR)/src/decode"
@ -69,16 +69,15 @@ index b0bb9bfadf..eeff0338c3 100644
+ $(INSTALL_DATA) epmd/*.h "$(RELSYSDIR)/src/epmd"
+ $(INSTALL_DATA) misc/*.h "$(RELSYSDIR)/src/misc"
+ $(INSTALL_DATA) registry/*.h "$(RELSYSDIR)/src/registry"
+ $(INSTALL_DATA) legacy/*.h "$(RELSYSDIR)/src/legacy"
+ $(INSTALL_DATA) prog/*.h "$(RELSYSDIR)/src/prog"
release_docs:
diff --git a/lib/megaco/src/flex/Makefile.in b/lib/megaco/src/flex/Makefile.in
index c37ad4d702..09bf1efe95 100644
index cd409fa54f..c65e817385 100644
--- a/lib/megaco/src/flex/Makefile.in
+++ b/lib/megaco/src/flex/Makefile.in
@@ -271,7 +271,7 @@ release_spec: opt
@@ -251,7 +251,7 @@ release_spec: opt
$(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/flex"
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
ifeq ($(ENABLE_MEGACO_FLEX_SCANNER),true)
@ -88,7 +87,7 @@ index c37ad4d702..09bf1efe95 100644
endif
diff --git a/lib/odbc/c_src/Makefile.in b/lib/odbc/c_src/Makefile.in
index 784e73c47e..568c5e4c3e 100644
index 3c16e7e294..82fe1492ef 100644
--- a/lib/odbc/c_src/Makefile.in
+++ b/lib/odbc/c_src/Makefile.in
@@ -129,11 +129,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@ -117,10 +116,10 @@ index 27b156a2c9..f11ff303b6 100644
$(INSTALL_PROGRAM) $(TARGET_FILES) "$(RELSYSDIR)/priv/bin"
diff --git a/lib/tools/c_src/Makefile.in b/lib/tools/c_src/Makefile.in
index 289322b6fa..9e2b9b7e7c 100644
index 8e13571786..ae18ef3cf4 100644
--- a/lib/tools/c_src/Makefile.in
+++ b/lib/tools/c_src/Makefile.in
@@ -189,8 +189,6 @@ include ../vsn.mk
@@ -188,8 +188,6 @@ include ../vsn.mk
RELSYSDIR = $(RELEASE_PATH)/lib/tools-$(TOOLS_VSN)
release_spec: all

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Do not install nteventlog and related doc-files on non-win32
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/lib/os_mon/doc/src/Makefile b/lib/os_mon/doc/src/Makefile
index 354f8ed26b..12adcfbcf2 100644
index d16f2b4831..c5b721f995 100644
--- a/lib/os_mon/doc/src/Makefile
+++ b/lib/os_mon/doc/src/Makefile
@@ -36,12 +36,17 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
@@ -31,11 +31,16 @@ APPLICATION=os_mon
# Target Specs
# ----------------------------------------------------
XML_APPLICATION_FILES = ref_man.xml
@ -21,7 +21,6 @@ index 354f8ed26b..12adcfbcf2 100644
XML_REF3_FILES = cpu_sup.xml \
disksup.xml \
memsup.xml \
os_mon_mib.xml \
os_sup.xml \
- nteventlog.xml
+ $(NTEVENTLOG_DOCFILE)
@ -29,25 +28,25 @@ index 354f8ed26b..12adcfbcf2 100644
XML_REF6_FILES = os_mon_app.xml
diff --git a/lib/os_mon/src/Makefile b/lib/os_mon/src/Makefile
index fc2eb22393..e2f4d5a090 100644
index 98c5ced068..e2f4d5a090 100644
--- a/lib/os_mon/src/Makefile
+++ b/lib/os_mon/src/Makefile
@@ -34,8 +34,13 @@ RELSYSDIR = $(RELEASE_PATH)/lib/os_mon-$(VSN)
@@ -34,7 +34,13 @@ RELSYSDIR = $(RELEASE_PATH)/lib/os_mon-$(VSN)
# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------
-MODULES= disksup memsup cpu_sup os_mon os_mon_mib os_sup os_mon_sysinfo nteventlog
+ifeq ($(findstring win32,$(TARGET)),win32)
+NTEVENTLOG=nteventlog
+else
+NTEVENTLOG=
+endif
MODULES= disksup memsup cpu_sup os_mon os_mon_mib os_sup os_mon_sysinfo \
- nteventlog
+MODULES= disksup memsup cpu_sup os_mon os_mon_mib os_sup os_mon_sysinfo \
+ $(NTEVENTLOG)
INCLUDE=../include
CSRC=../c_src
@@ -79,7 +84,11 @@ docs:
@@ -78,7 +84,11 @@ docs:
# ----------------------------------------------------
$(APP_TARGET): $(APP_SRC) ../vsn.mk

View File

@ -8,10 +8,10 @@ Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Signed-off-by: Hans Ulrich Niedermann <hun@n-dimensional.de>
diff --git a/erts/preloaded/src/Makefile b/erts/preloaded/src/Makefile
index e1bd5bc295..a4833521d1 100644
index b0c205cec8..7fad1ddc75 100644
--- a/erts/preloaded/src/Makefile
+++ b/erts/preloaded/src/Makefile
@@ -94,8 +94,6 @@ $(APP_TARGET): $(APP_SRC) $(ERL_TOP)/erts/vsn.mk
@@ -121,8 +121,6 @@ $(APP_TARGET): $(APP_SRC) $(ERL_TOP)/erts/vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: $(APP_TARGET)
@ -21,10 +21,10 @@ index e1bd5bc295..a4833521d1 100644
$(INSTALL_DATA) $(STATIC_TARGET_FILES) $(APP_TARGET) "$(RELSYSDIR)/ebin"
diff --git a/lib/asn1/src/Makefile b/lib/asn1/src/Makefile
index ba459f6cd3..5565126214 100644
index a6ff72898c..35d4530f32 100644
--- a/lib/asn1/src/Makefile
+++ b/lib/asn1/src/Makefile
@@ -154,7 +154,7 @@ release_spec: opt
@@ -155,7 +155,7 @@ release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -34,10 +34,10 @@ index ba459f6cd3..5565126214 100644
$(INSTALL_DATA) $(EXAMPLES) "$(RELSYSDIR)/examples"
diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile
index 80eaed70bd..cde0c6823d 100644
index 7d7b5ed203..9151e4097b 100644
--- a/lib/common_test/src/Makefile
+++ b/lib/common_test/src/Makefile
@@ -152,7 +152,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -157,7 +157,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -63,10 +63,10 @@ index f015064b39..57f96d2929 100644
$(INSTALL_SCRIPT) $(PROGRAMS) "$(RELEASE_PATH)/test_server"
diff --git a/lib/compiler/src/Makefile b/lib/compiler/src/Makefile
index 2408c76b48..700e236964 100644
index b1531ac985..dbcfe0042c 100644
--- a/lib/compiler/src/Makefile
+++ b/lib/compiler/src/Makefile
@@ -173,8 +173,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -184,8 +184,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -78,7 +78,7 @@ index 2408c76b48..700e236964 100644
$(INSTALL_DATA) $(INSTALL_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/crypto/src/Makefile b/lib/crypto/src/Makefile
index 1753ba4f36..2cd09475e8 100644
index c3f1c859e5..0d72d6c82d 100644
--- a/lib/crypto/src/Makefile
+++ b/lib/crypto/src/Makefile
@@ -81,8 +81,6 @@ docs:
@ -104,10 +104,10 @@ index 118cb6b758..86722d8767 100644
$(INSTALL_DATA) $(TARGET_FILES) $(TARGET_TOOLBOX_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/dialyzer/src/Makefile b/lib/dialyzer/src/Makefile
index fc08e7ca2f..2464a15c3f 100644
index 1f5b308c7d..1f728c56d6 100644
--- a/lib/dialyzer/src/Makefile
+++ b/lib/dialyzer/src/Makefile
@@ -158,7 +158,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -161,7 +161,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -117,10 +117,10 @@ index fc08e7ca2f..2464a15c3f 100644
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(INSTALL_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/diameter/src/Makefile b/lib/diameter/src/Makefile
index 98636ed6e2..171846f1e4 100644
index 348cc350e1..9d87858def 100644
--- a/lib/diameter/src/Makefile
+++ b/lib/diameter/src/Makefile
@@ -250,11 +250,8 @@ release_spec: opt
@@ -260,11 +260,8 @@ release_spec: opt
$(MAKE) $(EXAMPLE_DIRS:%/=release_examples_%)
$(TARGET_DIRS:%/=release_src_%): release_src_%:
@ -168,10 +168,10 @@ index b79a537424..d0b231e5fc 100644
release_docs_spec:
diff --git a/lib/erl_docgen/src/Makefile b/lib/erl_docgen/src/Makefile
index 82d051e9bb..950fdbe177 100644
index 4c6f542ebb..d0cd6d8f68 100644
--- a/lib/erl_docgen/src/Makefile
+++ b/lib/erl_docgen/src/Makefile
@@ -90,8 +90,6 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
@@ -91,8 +91,6 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
@ -193,10 +193,10 @@ index b6347d8b6d..a695d2cc2d 100644
$(INSTALL_DIR) "$(RELSYSDIR)/include"
$(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
diff --git a/lib/eunit/src/Makefile b/lib/eunit/src/Makefile
index 3510d3cc93..9179e9b4c2 100644
index 32f75202a0..a89fa7f2d2 100644
--- a/lib/eunit/src/Makefile
+++ b/lib/eunit/src/Makefile
@@ -120,7 +120,6 @@ release_spec: opt
@@ -121,7 +121,6 @@ release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(PARSE_TRANSFORM_BIN) $(OBJECTS) "$(RELSYSDIR)/ebin"
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -205,10 +205,10 @@ index 3510d3cc93..9179e9b4c2 100644
$(INSTALL_DIR) "$(RELSYSDIR)/include"
$(INSTALL_DATA) $(INCLUDE_DELIVERABLES) "$(RELSYSDIR)/include"
diff --git a/lib/hipe/cerl/Makefile b/lib/hipe/cerl/Makefile
index f653dce36f..7cc5c06528 100644
index affbb10ff6..44598beff2 100644
--- a/lib/hipe/cerl/Makefile
+++ b/lib/hipe/cerl/Makefile
@@ -102,7 +102,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -105,7 +105,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/cerl"
@ -244,10 +244,10 @@ index b220bc16a0..d4073277be 100644
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/hipe/llvm/Makefile b/lib/hipe/llvm/Makefile
index 817ff67dcd..e50ba5e207 100644
index 5e8f2076db..06d3f2684d 100644
--- a/lib/hipe/llvm/Makefile
+++ b/lib/hipe/llvm/Makefile
@@ -101,7 +101,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -104,7 +104,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) $(RELSYSDIR)/llvm
@ -283,10 +283,10 @@ index e5033e444b..74a444b386 100644
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/hipe/rtl/Makefile b/lib/hipe/rtl/Makefile
index becdd0b7d8..da8f66343f 100644
index 67485875a6..f83a2bb9e2 100644
--- a/lib/hipe/rtl/Makefile
+++ b/lib/hipe/rtl/Makefile
@@ -105,7 +105,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -108,7 +108,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/rtl"
@ -343,10 +343,10 @@ index 8248e37c44..1f1b23184b 100644
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/inets/src/http_server/Makefile b/lib/inets/src/http_server/Makefile
index 1c05d454a5..88f9f62d3b 100644
index da9549406f..eaa14b628f 100644
--- a/lib/inets/src/http_server/Makefile
+++ b/lib/inets/src/http_server/Makefile
@@ -135,7 +135,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -134,7 +134,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/src/http_server"
@ -369,10 +369,10 @@ index ec1ae70305..88c084ef58 100644
$(INSTALL_DATA) $(EXTERNAL_HRL_FILES) "$(RELSYSDIR)/include"
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
diff --git a/lib/kernel/src/Makefile b/lib/kernel/src/Makefile
index 3d1506ea08..728fa64869 100644
index 6c75bcffee..d15bdb867a 100644
--- a/lib/kernel/src/Makefile
+++ b/lib/kernel/src/Makefile
@@ -227,7 +227,6 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -236,7 +236,6 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -394,10 +394,10 @@ index ab45548099..5c7a7f0be9 100644
$(INSTALL_DATA) $(EXTERNAL_HRL_FILES) "$(RELSYSDIR)/include"
diff --git a/lib/megaco/src/binary/Makefile b/lib/megaco/src/binary/Makefile
index b9643669f6..5b5a4cf482 100644
index 7fc90fd6d5..6ad086ed01 100644
--- a/lib/megaco/src/binary/Makefile
+++ b/lib/megaco/src/binary/Makefile
@@ -176,7 +176,7 @@ release_spec: opt
@@ -177,7 +177,7 @@ release_spec: opt
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
$(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/src/binary"
@ -420,10 +420,10 @@ index 869b516b05..fa7d774d84 100644
diff --git a/lib/megaco/src/flex/Makefile.in b/lib/megaco/src/flex/Makefile.in
index 09bf1efe95..b320b2e96f 100644
index c65e817385..3bc4dea207 100644
--- a/lib/megaco/src/flex/Makefile.in
+++ b/lib/megaco/src/flex/Makefile.in
@@ -268,7 +268,6 @@ release_spec: opt
@@ -248,7 +248,6 @@ release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src/flex"
$(INSTALL_DIR) "$(RELSYSDIR)/priv/lib"
$(INSTALL_DIR) "$(RELSYSDIR)/include"
@ -445,10 +445,10 @@ index d07db3fa4b..7f421d24cc 100644
release_docs_spec:
diff --git a/lib/megaco/src/text/Makefile b/lib/megaco/src/text/Makefile
index 8e7e82b276..2a118d24e3 100644
index 3dd24b1df7..836e163499 100644
--- a/lib/megaco/src/text/Makefile
+++ b/lib/megaco/src/text/Makefile
@@ -135,7 +135,7 @@ release_spec: opt
@@ -131,7 +131,7 @@ release_spec: opt
$(INSTALL_DATA) $(BEAM_TARGET_FILES) "$(RELSYSDIR)/ebin"
$(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/src/text"
@ -471,10 +471,10 @@ index 028a63e98e..9e11e9bfb2 100644
release_docs_spec:
diff --git a/lib/mnesia/src/Makefile b/lib/mnesia/src/Makefile
index 7d316df263..60fdefb5d0 100644
index 90e8780754..1a13d764b3 100644
--- a/lib/mnesia/src/Makefile
+++ b/lib/mnesia/src/Makefile
@@ -134,7 +134,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -135,7 +135,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -520,19 +520,6 @@ index e2f4d5a090..57f21a145b 100644
$(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/otp_mibs/src/Makefile b/lib/otp_mibs/src/Makefile
index 5c7af39c3f..a85368b4f4 100644
--- a/lib/otp_mibs/src/Makefile
+++ b/lib/otp_mibs/src/Makefile
@@ -96,8 +96,6 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) "$(RELSYSDIR)/src"
- $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGETS) "$(RELSYSDIR)/ebin"
diff --git a/lib/parsetools/src/Makefile b/lib/parsetools/src/Makefile
index ba206904ec..281cc8657c 100644
--- a/lib/parsetools/src/Makefile
@ -547,7 +534,7 @@ index ba206904ec..281cc8657c 100644
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
$(INSTALL_DIR) "$(RELSYSDIR)/include"
diff --git a/lib/public_key/asn1/Makefile b/lib/public_key/asn1/Makefile
index a920ea87ea..7672ef3470 100644
index 1fef168463..e5411b903b 100644
--- a/lib/public_key/asn1/Makefile
+++ b/lib/public_key/asn1/Makefile
@@ -96,8 +96,8 @@ release_spec: opt
@ -562,10 +549,10 @@ index a920ea87ea..7672ef3470 100644
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/public_key/src/Makefile b/lib/public_key/src/Makefile
index e61390bce3..6ed6c2cf9f 100644
index 76bdffe089..fc5e4dfa8e 100644
--- a/lib/public_key/src/Makefile
+++ b/lib/public_key/src/Makefile
@@ -109,8 +109,6 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
@@ -110,8 +110,6 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
@ -601,10 +588,10 @@ index 76286c5499..d921f9f294 100644
$(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
$(INSTALL_DIR) "$(RELSYSDIR)/examples"
diff --git a/lib/sasl/src/Makefile b/lib/sasl/src/Makefile
index 7338bdf016..a280225dad 100644
index 16a42caf11..674364281d 100644
--- a/lib/sasl/src/Makefile
+++ b/lib/sasl/src/Makefile
@@ -93,7 +93,6 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -94,7 +94,6 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -613,17 +600,17 @@ index 7338bdf016..a280225dad 100644
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
diff --git a/lib/snmp/src/agent/Makefile b/lib/snmp/src/agent/Makefile
index 2943a4d550..8203e62361 100644
index 1bde1ca972..acc42385f3 100644
--- a/lib/snmp/src/agent/Makefile
+++ b/lib/snmp/src/agent/Makefile
@@ -131,7 +131,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -140,7 +140,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/src/agent"
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src/agent"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/src/agent"
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
$(INSTALL_DATA) $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
"$(RELSYSDIR)/ebin"
diff --git a/lib/snmp/src/app/Makefile b/lib/snmp/src/app/Makefile
index 6f2b8a4077..bd062a6473 100644
@ -639,10 +626,10 @@ index 6f2b8a4077..bd062a6473 100644
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
"$(RELSYSDIR)/ebin"
diff --git a/lib/snmp/src/compile/Makefile b/lib/snmp/src/compile/Makefile
index 4093ffa9ca..18878aa5db 100644
index d9678669a5..ff9dff95d9 100644
--- a/lib/snmp/src/compile/Makefile
+++ b/lib/snmp/src/compile/Makefile
@@ -123,7 +123,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -125,7 +125,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/src/compiler"
@ -652,17 +639,17 @@ index 4093ffa9ca..18878aa5db 100644
$(INSTALL_DATA) $(EBIN_FILES) "$(RELSYSDIR)/ebin"
$(INSTALL_DIR) "$(RELSYSDIR)/bin"
diff --git a/lib/snmp/src/manager/Makefile b/lib/snmp/src/manager/Makefile
index 0cc87492f1..d203f2846a 100644
index 57ff08c160..d51f627ca5 100644
--- a/lib/snmp/src/manager/Makefile
+++ b/lib/snmp/src/manager/Makefile
@@ -114,7 +114,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -123,7 +123,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DIR) "$(RELSYSDIR)/src/manager"
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src/manager"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/src/manager"
$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
# $(INSTALL_DIR) "$(RELSYSDIR)/include"
diff --git a/lib/snmp/src/misc/Makefile b/lib/snmp/src/misc/Makefile
index adc2c4858f..89ce954e99 100644
@ -678,10 +665,10 @@ index adc2c4858f..89ce954e99 100644
$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
# $(INSTALL_DIR) "$(RELSYSDIR)/include"
diff --git a/lib/ssh/src/Makefile b/lib/ssh/src/Makefile
index 6d64a45112..5b1249ca5b 100644
index ab6137e518..bdeabca8c3 100644
--- a/lib/ssh/src/Makefile
+++ b/lib/ssh/src/Makefile
@@ -139,7 +139,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -154,7 +154,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -691,10 +678,10 @@ index 6d64a45112..5b1249ca5b 100644
$(INSTALL_DATA) $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) $(APP_TARGET) \
$(APPUP_TARGET) "$(RELSYSDIR)/ebin"
diff --git a/lib/ssl/src/Makefile b/lib/ssl/src/Makefile
index 8d1341f594..72ab265200 100644
index 5edd6cb4b9..39008882ca 100644
--- a/lib/ssl/src/Makefile
+++ b/lib/ssl/src/Makefile
@@ -149,7 +149,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -207,7 +207,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -704,10 +691,10 @@ index 8d1341f594..72ab265200 100644
$(INSTALL_DATA) $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) $(APP_TARGET) \
$(APPUP_TARGET) "$(RELSYSDIR)/ebin"
diff --git a/lib/stdlib/src/Makefile b/lib/stdlib/src/Makefile
index c95f7637f7..0f601aefb5 100644
index e3e0c9c03d..ff9bad32ab 100644
--- a/lib/stdlib/src/Makefile
+++ b/lib/stdlib/src/Makefile
@@ -214,7 +214,6 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -223,7 +223,6 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -729,10 +716,10 @@ index c21d2f49c8..03dbc74ef7 100644
$(INSTALL_DATA) $(INCLUDE_DELIVERABLES) "$(RELSYSDIR)/include"
diff --git a/lib/tftp/src/Makefile b/lib/tftp/src/Makefile
index 602ae845a4..a1f2f09a00 100644
index 029bd731bd..85c633b4f0 100644
--- a/lib/tftp/src/Makefile
+++ b/lib/tftp/src/Makefile
@@ -98,7 +98,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
@@ -101,7 +101,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/src"
@ -755,7 +742,7 @@ index cc5bee9a8f..7dfa55cb41 100644
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
"$(RELSYSDIR)/ebin"
diff --git a/lib/wx/src/Makefile b/lib/wx/src/Makefile
index 21b45af2c4..a7bf34f4f4 100644
index 52f4008e0a..dc297f1d55 100644
--- a/lib/wx/src/Makefile
+++ b/lib/wx/src/Makefile
@@ -122,9 +122,9 @@ $(EBIN)/%.beam: $(EGEN)/%.erl $(HEADER_FILES)

View File

@ -1,134 +0,0 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Wed, 24 Oct 2018 14:58:41 +0200
Subject: [PATCH] Improve nodes querying
We've got a few similar stacktraces once. See the following one for
example:
** Reason for termination ==
** {badarg,
[{ets,next,[sys_dist,'rabbitmq-cli-42@host.example.com'],[]},
{net_kernel,get_nodes,2,[{file,"net_kernel.erl"},{line,1025}]},
{net_kernel,get_nodes,2,[{file,"net_kernel.erl"},{line,1019}]},
{net_kernel,get_nodes_info,0,[{file,"net_kernel.erl"},{line,1439}]},
{rabbit_mgmt_external_stats,cluster_links,0,
[{file,"src/rabbit_mgmt_external_stats.erl"},{line,252}]},
{rabbit_mgmt_external_stats,emit_node_node_stats,1,
[{file,"src/rabbit_mgmt_external_stats.erl"},{line,366}]},
{rabbit_mgmt_external_stats,handle_info,2,
[{file,"src/rabbit_mgmt_external_stats.erl"},{line,347}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,615}]}]}
The problem is that when we're trying to query a list of connected
nodes, we're doing it in the following way:
Call for the first record in ETS
While not EOF:
Call for the next record in ETS
What happens, when some Node disconnects during the "not EOF" loop?
We'll get an exception.
Let's do it differently - query a list of nodes in one shot, and then
get info from each of the nodes in list (w/o extra calls to ets). These
individual calls care of disconnected nodes so everything will be fine
even if a node disconnects.
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl
index a9dc77837e..04025cf35b 100644
--- a/lib/kernel/src/net_kernel.erl
+++ b/lib/kernel/src/net_kernel.erl
@@ -670,24 +670,16 @@ code_change(_OldVsn, State, _Extra) ->
terminate(no_network, State) ->
lists:foreach(
- fun({Node, Type}) ->
- case Type of
- normal -> ?nodedown(Node, State);
- _ -> ok
- end
- end, get_up_nodes() ++ [{node(), normal}]);
+ fun(Node) -> ?nodedown(Node, State)
+ end, get_nodes_up_normal() ++ [node()]);
terminate(_Reason, State) ->
lists:foreach(
fun(#listen {listen = Listen,module = Mod}) ->
Mod:close(Listen)
end, State#state.listen),
lists:foreach(
- fun({Node, Type}) ->
- case Type of
- normal -> ?nodedown(Node, State);
- _ -> ok
- end
- end, get_up_nodes() ++ [{node(), normal}]).
+ fun(Node) -> ?nodedown(Node, State)
+ end, get_nodes_up_normal() ++ [node()]).
%% ------------------------------------------------------------
@@ -1139,35 +1131,10 @@ disconnect_pid(Pid, State) ->
%%
%%
%%
-get_nodes(Which) ->
- get_nodes(ets:first(sys_dist), Which).
-get_nodes('$end_of_table', _) ->
- [];
-get_nodes(Key, Which) ->
- case ets:lookup(sys_dist, Key) of
- [Conn = #connection{state = up}] ->
- [Conn#connection.node | get_nodes(ets:next(sys_dist, Key),
- Which)];
- [Conn = #connection{}] when Which =:= all ->
- [Conn#connection.node | get_nodes(ets:next(sys_dist, Key),
- Which)];
- _ ->
- get_nodes(ets:next(sys_dist, Key), Which)
- end.
-
-%% Return a list of all nodes that are 'up'.
-get_up_nodes() ->
- get_up_nodes(ets:first(sys_dist)).
-
-get_up_nodes('$end_of_table') -> [];
-get_up_nodes(Key) ->
- case ets:lookup(sys_dist, Key) of
- [#connection{state=up,node=Node,type=Type}] ->
- [{Node,Type}|get_up_nodes(ets:next(sys_dist, Key))];
- _ ->
- get_up_nodes(ets:next(sys_dist, Key))
- end.
+%% Return a list of all nodes that are 'up' and not hidden.
+get_nodes_up_normal() ->
+ ets:select(sys_dist, [{#connection{node = '$1', state = up, type = normal, _ = '_'}, [], ['$1']}]).
ticker(Kernel, Tick) when is_integer(Tick) ->
process_flag(priority, max),
@@ -1632,15 +1599,14 @@ get_node_info(Node, Key) ->
end.
get_nodes_info() ->
- get_nodes_info(get_nodes(all), []).
-
-get_nodes_info([Node|Nodes], InfoList) ->
- case get_node_info(Node) of
- {ok, Info} -> get_nodes_info(Nodes, [{Node, Info}|InfoList]);
- _ -> get_nodes_info(Nodes, InfoList)
- end;
-get_nodes_info([], InfoList) ->
- {ok, InfoList}.
+ Nodes = ets:select(sys_dist, [{#connection{node = '$1', _ = '_'}, [], ['$1']}]),
+ {ok, lists:filtermap(
+ fun(Node) ->
+ case get_node_info(Node) of
+ {ok, Info} -> {true, {Node, Info}};
+ _ -> false
+ end
+ end, Nodes)}.
%% ------------------------------------------------------------
%% Misc. functions