gitlab-ci: merge branch 'th/gitlab-ci-clang'

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/79
This commit is contained in:
Thomas Haller 2019-02-07 17:34:44 +01:00
commit 7b8a9a2927
6 changed files with 67 additions and 41 deletions

View file

@ -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
- /tmp/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
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:

View file

@ -55,6 +55,7 @@ install \
ppp-devel \
pygobject3-base \
python3-dbus \
python3-gobject \
qt-devel \
readline-devel \
rpm-build \

View file

@ -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() {

View file

@ -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; \
} \

View file

@ -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;

View file

@ -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",