diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c6b131aaa..f8258e457a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,18 +10,29 @@ stages: .fedora_install: &fedora_install before_script: - - date '+%Y%m%d-%H%M%S'; NM_INSTALL="dnf install -y" ./contrib/fedora/REQUIRED_PACKAGES - - date '+%Y%m%d-%H%M%S'; dnf install -y glibc-langpack-pl ccache clang + + # enable EPEL on CentOS + - date '+%Y%m%d-%H%M%S'; ! grep -q '^NAME=.*\(CentOS\)' /etc/os-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + + - date '+%Y%m%d-%H%M%S'; ! grep -q '^NAME=.*\(CentOS\)' /etc/os-release || (yum install -y glibc-common && localedef -c -i pl_PL -f UTF-8 pl_PL.UTF-8 && locale -a) + + - date '+%Y%m%d-%H%M%S'; NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES + - date '+%Y%m%d-%H%M%S'; yum install -y glibc-langpack-pl ccache clang which # containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html # to generate proper documentation. - - date '+%Y%m%d-%H%M%S'; dnf reinstall -y --setopt='tsflags=' glib2-doc + - date '+%Y%m%d-%H%M%S'; yum reinstall -y --setopt='tsflags=' glib2-doc - - date '+%Y%m%d-%H%M%S'; dnf install -y python3-dnf-plugins-core - - date '+%Y%m%d-%H%M%S'; dnf debuginfo-install -y glib2 + - date '+%Y%m%d-%H%M%S'; ! grep -q '^NAME=.*\(CentOS\)' /etc/os-release || yum install -y python36-dbus python36-gobject-base + + - date '+%Y%m%d-%H%M%S'; ! which dnf || dnf install -y python3-dnf-plugins-core + - date '+%Y%m%d-%H%M%S'; ! which dnf || dnf debuginfo-install -y glib2 + - date '+%Y%m%d-%H%M%S'; which dnf || debuginfo-install -y glib2 - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-patch-gtkdoc.sh || true + - date '+%Y%m%d-%H%M%S'; test -x /usr/bin/ninja || ! test -x /usr/bin/ninja-build || ln -s /usr/bin/ninja-build /usr/bin/ninja + .debian_install: &debian_install before_script: - date '+%Y%m%d-%H%M%S'; apt-get update @@ -39,22 +50,22 @@ stages: - date '+%Y%m%d-%H%M%S'; locale -a - date '+%Y%m%d-%H%M%S'; env - date '+%Y%m%d-%H%M%S'; meson --version - - date '+%Y%m%d-%H%M%S'; ! which dnf || dnf list --installed - date '+%Y%m%d-%H%M%S'; ! which dpkg || dpkg -l + - date '+%Y%m%d-%H%M%S'; ! which yum || yum list installed - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh - date '+%Y%m%d-%H%M%S'; rm -rf /tmp/nm-docs-html; mv build/INST/share/gtk-doc/html /tmp/nm-docs-html - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=Fedora' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=Fedora' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson + - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\|CentOS\)' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson + - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\)' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson - date '+%Y%m%d-%H%M%S'; git clean -fdx ; test "$NM_BUILD_TARBALL" != 1 || ( ./contrib/fedora/rpm/build_clean.sh -r && mv ./NetworkManager-1*.tar.xz /tmp/ && mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm /tmp/ ) - date '+%Y%m%d-%H%M%S'; git clean -fdx - date '+%Y%m%d-%H%M%S'; mv /tmp/nm-docs-html ./docs-html - date '+%Y%m%d-%H%M%S'; test "$NM_BUILD_TARBALL" != 1 || mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./ checkpatch: - image: fedora:28 + image: fedora:29 stage: test script: - date '+%Y%m%d-%H%M%S'; dnf install -y git @@ -95,6 +106,17 @@ t_fedora:rawhide: allow_failure: true when: manual +t_centos:7.5.1804: + <<: *fedora_install + image: centos:7.5.1804 + <<: *do_build + when: manual + +t_centos:7.6.1810: + <<: *fedora_install + image: centos:7.6.1810 + <<: *do_build + t_ubuntu:16.04: <<: *debian_install image: ubuntu:16.04 diff --git a/clients/tests/test-client.py b/clients/tests/test-client.py index b2411d6e52..ff5a3604dd 100755 --- a/clients/tests/test-client.py +++ b/clients/tests/test-client.py @@ -324,7 +324,7 @@ class NMStubServer: nmobj = self._conn_get_main_object(self._conn) if nmobj is not None: break - if (NM.utils_get_timestamp_msec() - start) >= 2000: + if (NM.utils_get_timestamp_msec() - start) >= 4000: p.stdin.close() p.kill() Util.popen_wait(p, 1000) diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES index 9928cf0000..00164cc669 100755 --- a/contrib/fedora/REQUIRED_PACKAGES +++ b/contrib/fedora/REQUIRED_PACKAGES @@ -52,8 +52,10 @@ install \ newt-devel \ nss-devel \ polkit-devel \ + ppp \ ppp-devel \ pygobject3-base \ + python-gobject-base \ python3-dbus \ python3-gobject \ qt-devel \ diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index 1d4b573439..dd8fd28457 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -126,7 +126,7 @@ _print_test_logs() { echo ">>>> PRINT TEST LOGS $1 (done)" if _with_valgrind; then echo ">>>> PRINT VALGRIND LOGS $1 (start)" - find -name '*.valgrind-log' -print0 | xargs -0 grep -H ^ + find -name '*.valgrind-log' -print0 | xargs -0 grep -H ^ || true echo ">>>> PRINT VALGRIND LOGS $1 (done)" fi } diff --git a/m4/compiler_options.m4 b/m4/compiler_options.m4 index 9f167a103b..5235e037df 100644 --- a/m4/compiler_options.m4 +++ b/m4/compiler_options.m4 @@ -89,6 +89,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then -Wno-missing-field-initializers \ -Wno-pragmas \ -Wno-sign-compare \ + -Wno-unknown-pragmas \ -Wno-unused-parameter \ ; do dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning) diff --git a/meson.build b/meson.build index e6b220c62b..af4faa4bc6 100644 --- a/meson.build +++ b/meson.build @@ -152,6 +152,7 @@ if nm_debug '-Wno-missing-field-initializers', '-Wno-pragmas', '-Wno-sign-compare', + '-Wno-unknown-pragmas', '-Wno-unused-parameter', '-Wparentheses-equality', '-Wpointer-arith', diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h index 1ff90dc5d4..fa2792ec88 100644 --- a/shared/nm-glib-aux/nm-macros-internal.h +++ b/shared/nm-glib-aux/nm-macros-internal.h @@ -635,7 +635,11 @@ NM_G_ERROR_MSG (GError *error) * It's useful to check the let the compiler ensure that @value is * of a certain type. */ #define _NM_ENSURE_TYPE(type, value) (_Generic ((value), type: (value))) -#define _NM_ENSURE_TYPE_CONST(type, value) (_Generic ((value), const type: ((const type) (value)), type: ((const type) (value)))) +#define _NM_ENSURE_TYPE_CONST(type, value) (_Generic ((value), \ + const type : ((const type) (value)), \ + const type const: ((const type) (value)), \ + type : ((const type) (value)), \ + type const: ((const type) (value)))) #else #define _NM_ENSURE_TYPE(type, value) (value) #define _NM_ENSURE_TYPE_CONST(type, value) ((const type) (value)) diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index a6b5f2c4c3..8c0a8764e2 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -919,28 +919,28 @@ extern volatile int _nm_platform_kernel_support_state[_NM_PLATFORM_KERNEL_SUPPOR int _nm_platform_kernel_support_init (NMPlatformKernelSupportType type, int value); -#define _nm_platform_kernel_support_detected(type) \ - G_LIKELY (({ \ - const NMPlatformKernelSupportType _type = (type); \ - \ - nm_assert (_NM_INT_NOT_NEGATIVE (_type) && _type < G_N_ELEMENTS (_nm_platform_kernel_support_state)); \ - \ - (_nm_platform_kernel_support_state[_type] != 0); \ - })) +static inline gboolean +_nm_platform_kernel_support_detected (NMPlatformKernelSupportType type) +{ + nm_assert ( _NM_INT_NOT_NEGATIVE (type) + && type < G_N_ELEMENTS (_nm_platform_kernel_support_state)); -#define nm_platform_kernel_support_get(type) \ - ({ \ - const NMPlatformKernelSupportType _type = (type); \ - int _v; \ - \ - nm_assert (_NM_INT_NOT_NEGATIVE (_type) && _type < G_N_ELEMENTS (_nm_platform_kernel_support_state)); \ - \ - _v = _nm_platform_kernel_support_state[_type]; \ - if (G_UNLIKELY (_v == 0)) \ - _v = _nm_platform_kernel_support_init (_type, 0); \ - \ - (_v >= 0); \ - }) + return G_LIKELY (_nm_platform_kernel_support_state[type] != 0); +} + +static inline gboolean +nm_platform_kernel_support_get (NMPlatformKernelSupportType type) +{ + int v; + + nm_assert (_NM_INT_NOT_NEGATIVE (type) + && type < G_N_ELEMENTS (_nm_platform_kernel_support_state)); + + v = _nm_platform_kernel_support_state[type]; + if (G_UNLIKELY (v == 0)) + v = _nm_platform_kernel_support_init (type, 0); + return (v >= 0); +} /*****************************************************************************/ diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c index 0d20100cae..792c4e7b84 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -398,7 +398,7 @@ _idx_obj_part (const DedupMultiIdxType *idx_type, if (h) { nm_hash_update_vals (h, idx_type->cache_id_type, - NMP_OBJECT_CAST_OBJ_WITH_IFINDEX (obj_a)->ifindex); + obj_a->obj_with_ifindex.ifindex); } return 1;