summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-02-07 17:34:44 +0100
committerThomas Haller <thaller@redhat.com>2019-02-07 17:34:44 +0100
commit7b8a9a2927103859d4f4f876b07a066d1eebf625 (patch)
tree57808f1e5da70de0721ef943ad8ec2f657218c62
parente95cf643c3853093f6910fdc8d27ea989bda5092 (diff)
parentbdac03fe9a8def21ef16bdd7bd0497dab83fbb1f (diff)
downloadNetworkManager-7b8a9a2927103859d4f4f876b07a066d1eebf625.tar.gz
gitlab-ci: merge branch 'th/gitlab-ci-clang'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/79
-rw-r--r--.gitlab-ci.yml61
-rwxr-xr-xcontrib/fedora/REQUIRED_PACKAGES1
-rwxr-xr-xcontrib/scripts/nm-ci-run.sh27
-rw-r--r--shared/nm-utils/nm-macros-internal.h14
-rw-r--r--src/devices/wifi/nm-device-iwd.c4
-rw-r--r--src/devices/wwan/nm-modem-ofono.c1
6 files changed, 67 insertions, 41 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1933aa49bf..b4dffc40b5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,10 +11,25 @@ stages:
.fedora_install: &fedora_install
before_script:
- NM_INSTALL="dnf install -y" ./contrib/fedora/REQUIRED_PACKAGES
- - dnf install -y glibc-langpack-pl
+ - dnf install -y glibc-langpack-pl ccache clang
- locale -a
- contrib/scripts/nm-ci-patch-gtkdoc.sh || true
+.fedora_script: &fedora_script
+ stage: test
+ script:
+ - CI=gitlab BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
+ - mv build/INST/share/gtk-doc/html /tmp/docs-html
+ - git clean -fdx
+ - CI=gitlab BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
+ - git clean -fdx
+ - CI=gitlab BUILD_TYPE=meson CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
+ - git clean -fdx
+ - CI=gitlab BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
+ - git clean -fdx
+ - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test
+ - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
+
checkpatch:
image: fedora:28
stage: test
@@ -27,58 +42,30 @@ checkpatch:
paths:
- checkpatch-out.txt
-f28_build_autotools:
+f28_build:
<<: *fedora_install
image: fedora:28
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=autotools contrib/scripts/nm-ci-run.sh
- - mv build/INST/share/gtk-doc/html docs-html
+ <<: *fedora_script
artifacts:
expire_in: 1 day
paths:
- - docs-html
-
-f28_build_meson:
- <<: *fedora_install
- image: fedora:28
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=meson contrib/scripts/nm-ci-run.sh
-
-f28_rpm_autotools_dbg:
- <<: *fedora_install
- image: fedora:28
- stage: test
- script:
- - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test
+ - /tmp/docs-html
-f28_rpm_meson_dbg:
- <<: *fedora_install
- image: fedora:28
- stage: test
- script:
- - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w meson -w test
-
-f_latest_build_autotools:
+f_latest_build:
<<: *fedora_install
image: fedora:latest
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=autotools contrib/scripts/nm-ci-run.sh
+ <<: *fedora_script
-f_rawhide_build_autotools:
+f_rawhide_build:
<<: *fedora_install
image: fedora:rawhide
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=autotools contrib/scripts/nm-ci-run.sh
+ <<: *fedora_script
allow_failure: true
pages:
stage: deploy
dependencies:
- - f28_build_autotools
+ - f28_build
script:
- mv docs-html public
artifacts:
diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES
index 4a0ee4452d..4938ae9162 100755
--- a/contrib/fedora/REQUIRED_PACKAGES
+++ b/contrib/fedora/REQUIRED_PACKAGES
@@ -55,6 +55,7 @@ install \
ppp-devel \
pygobject3-base \
python3-dbus \
+ python3-gobject \
qt-devel \
readline-devel \
rpm-build \
diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh
index 4ac5fd9684..c3d0cb2e54 100755
--- a/contrib/scripts/nm-ci-run.sh
+++ b/contrib/scripts/nm-ci-run.sh
@@ -5,6 +5,7 @@
# - CC
# - BUILD_TYPE
# - CFLAGS
+# - WITH_DOCS
set -exv
@@ -13,6 +14,24 @@ die() {
exit 1
}
+_is_true() {
+ case "$1" in
+ 1|y|yes|YES|Yes|on)
+ return 0
+ ;;
+ 0|n|no|NO|No|off)
+ return 1
+ ;;
+ *)
+ die "not a boolean argument \"$1\""
+ ;;
+ esac
+}
+
+if which ccache &>/dev/null; then
+ export PATH="/usr/lib64/ccache:/usr/lib/ccache${PATH:+:${PATH}}"
+fi
+
###############################################################################
if [ "$BUILD_TYPE" == meson ]; then
@@ -45,6 +64,14 @@ if [ "$CC" != gcc ]; then
_WITH_CRYPTO=nss
fi
+if [ "$WITH_DOCS" != "" ]; then
+ if _is_true "$WITH_DOCS"; then
+ _WITH_DOCS="$_TRUE"
+ else
+ _WITH_DOCS="$_FALSE"
+ fi
+fi
+
###############################################################################
_autotools_test_print_logs() {
diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h
index 3537b37d50..55cdd374da 100644
--- a/shared/nm-utils/nm-macros-internal.h
+++ b/shared/nm-utils/nm-macros-internal.h
@@ -45,6 +45,18 @@
#define nm_auto(fcn) __attribute__ ((__cleanup__(fcn)))
+/* This is required to make LTO working.
+ *
+ * See https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/76#note_112694
+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200#c28
+ */
+#ifndef __clang__
+#define _nm_externally_visible __attribute__ ((__externally_visible__))
+#else
+#define _nm_externally_visible
+#endif
+
+
#if __GNUC__ >= 7
#define _nm_fallthrough __attribute__ ((__fallthrough__))
#else
@@ -1289,7 +1301,7 @@ fcn_name (lookup_type val) \
#define _NM_BACKPORT_SYMBOL_IMPL(version, return_type, orig_func, versioned_func, args_typed, args) \
return_type versioned_func args_typed; \
-__attribute__ ((externally_visible)) return_type versioned_func args_typed \
+_nm_externally_visible return_type versioned_func args_typed \
{ \
return orig_func args; \
} \
diff --git a/src/devices/wifi/nm-device-iwd.c b/src/devices/wifi/nm-device-iwd.c
index 5fcf6dff23..ff28024cec 100644
--- a/src/devices/wifi/nm-device-iwd.c
+++ b/src/devices/wifi/nm-device-iwd.c
@@ -1549,11 +1549,11 @@ error:
* DBus interface has appeared already. If so proceed to call Start or
* StartOpen on that interface.
*/
-static void act_check_interface (NMDeviceIwd *self)
+static void
+act_check_interface (NMDeviceIwd *self)
{
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE (self);
NMDevice *device = NM_DEVICE (self);
- gs_free_error GError *error = NULL;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wireless_sec;
GDBusProxy *proxy = NULL;
diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c
index 8efe0253a6..f3c4d7a304 100644
--- a/src/devices/wwan/nm-modem-ofono.c
+++ b/src/devices/wwan/nm-modem-ofono.c
@@ -214,7 +214,6 @@ disconnect (NMModem *modem,
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
DisconnectContext *ctx;
NMModemState state = nm_modem_get_state (NM_MODEM (self));
- gs_free_error GError *error = NULL;
_LOGD ("warn: %s modem_state: %s",
warn ? "TRUE" : "FALSE",