diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c86377e9a..981689dc5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,11 +60,11 @@ variables: # # This is done by running `ci-fairy generate-template` and possibly bumping # ".default_tag". - ALPINE_TAG: 'tag-94fd546ecdd9' - CENTOS_TAG: 'tag-ec274fe113f5' - DEBIAN_TAG: 'tag-cae73089725c' - FEDORA_TAG: 'tag-ec274fe113f5' - UBUNTU_TAG: 'tag-cae73089725c' + ALPINE_TAG: 'tag-ee13da0f38c7' + CENTOS_TAG: 'tag-5d3b59c9dd4b' + DEBIAN_TAG: 'tag-b274cbc4bddd' + FEDORA_TAG: 'tag-5d3b59c9dd4b' + UBUNTU_TAG: 'tag-b274cbc4bddd' ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh' CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh' @@ -680,7 +680,7 @@ coverity: - if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly" script: - dnf install -y curl - - BUILD_TYPE=meson CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh + - CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh - cd build - ../.gitlab-ci/coverity.sh download - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index d1a421f84..e7a7c0e55 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -261,7 +261,7 @@ coverity: - if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly" script: - dnf install -y curl - - BUILD_TYPE=meson CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh + - CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh - cd build - ../.gitlab-ci/coverity.sh download - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh index 4091cdd40..2ae72f28e 100755 --- a/.gitlab-ci/run-test.sh +++ b/.gitlab-ci/run-test.sh @@ -107,11 +107,11 @@ check_run_clean() { } if check_run_clean meson+gcc+docs+valgrind ; then - BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh + CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh mv INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html" fi -check_run_clean meson+clang && BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh +check_run_clean meson+clang && CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh check_run_clean rpm+meson && test $IS_FEDORA = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then @@ -121,7 +121,7 @@ if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then do_clean fi -check_run_clean tarball+meson && BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh +check_run_clean tarball+meson && CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh ############################################################################### diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh index 37436c1b6..3300877f5 100755 --- a/contrib/fedora/rpm/build_clean.sh +++ b/contrib/fedora/rpm/build_clean.sh @@ -21,8 +21,6 @@ usage() { echo " -g|--git: create tarball from current git HEAD (skips make dist)" echo " -Q|--quick: only create the distribution tarball, without running checks" echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`" - echo " -m|--meson: (default) use meson to create the source tarball" - echo " -A|--autotools: use autotools to create the source tarball" echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug" echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug" echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)" @@ -99,14 +97,6 @@ while [[ $# -gt 0 ]]; do IGNORE_DIRTY=1 SOURCE_FROM_GIT=1 ;; - -m|--meson) - [ "$USE_AUTOTOOLS" = 1 ] && die "conflicting argument: $A when building with autotools is requested"; - USE_MESON=1 - ;; - -A|--autotools) - [ "$USE_MESON" = 1 ] && die "conflicting argument: $A when building with meson is explicitly requested"; - USE_AUTOTOOLS=1 - ;; -Q|--quick) QUICK=1 ;; @@ -203,96 +193,48 @@ get_version_meson() { } if [[ $NO_DIST != 1 ]]; then - if [[ $USE_AUTOTOOLS != 1 ]]; then - meson setup "$GITDIR/build" \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sbindir=/usr/sbin \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --includedir=/usr/include \ - --libdir=/usr/lib \ - --libexecdir=/usr/libexec \ - --localstatedir=/var \ - --sharedstatedir=/var/lib \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - -Ddocs=true \ - -Dintrospection=true \ - -Difcfg_rh=true \ - -Difupdown=true \ - -Dconfig_logging_backend_default=syslog \ - -Dconfig_wifi_backend_default=wpa_supplicant \ - -Dlibaudit=yes-disabled-by-default \ - -Dpolkit=true \ - -Dnm_cloud_setup=true \ - -Ddhclient=/usr/sbin/dhclient \ - -Dconfig_dhcp_default=internal \ - -Dconfig_dns_rc_manager_default=auto \ - -Diptables=/usr/sbin/iptables \ - -Dnft=/usr/bin/nft \ - || die "Error meson setup" + meson setup "$GITDIR/build" \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --libdir=/usr/lib \ + --libexecdir=/usr/libexec \ + --localstatedir=/var \ + --sharedstatedir=/var/lib \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + -Ddocs=true \ + -Dintrospection=true \ + -Difcfg_rh=true \ + -Difupdown=true \ + -Dconfig_logging_backend_default=syslog \ + -Dconfig_wifi_backend_default=wpa_supplicant \ + -Dlibaudit=yes-disabled-by-default \ + -Dpolkit=true \ + -Dnm_cloud_setup=true \ + -Ddhclient=/usr/sbin/dhclient \ + -Dconfig_dhcp_default=internal \ + -Dconfig_dns_rc_manager_default=auto \ + -Diptables=/usr/sbin/iptables \ + -Dnft=/usr/bin/nft \ + || die "Error meson setup" - VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}" - if [[ $QUICK == 1 ]]; then - meson dist --allow-dirty -C "$GITDIR/build/" --no-tests || die "Error meson dist" - else - meson dist --allow-dirty -C "$GITDIR/build/" || die "Error meson dist with tests" - fi - export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)" - else - ./autogen.sh \ - --with-runstatedir=/run \ - --program-prefix= \ - --prefix=/usr \ - --exec-prefix=/usr \ - --bindir=/usr/bin \ - --sbindir=/usr/sbin \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --includedir=/usr/include \ - --libdir=/usr/lib \ - --libexecdir=/usr/libexec \ - --localstatedir=/var \ - --sharedstatedir=/var/lib \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - \ - --disable-dependency-tracking \ - --enable-gtk-doc \ - --enable-introspection \ - --enable-ifcfg-rh \ - --enable-ifupdown \ - --with-config-logging-backend-default=syslog \ - --with-config-wifi-backend-default=wpa_supplicant \ - --with-libaudit=yes-disabled-by-default \ - --enable-polkit=yes \ - --with-nm-cloud-setup=yes \ - --with-dhclient=yes \ - --with-config-dhcp-default=internal \ - --with-config-dns-rc-manager-default=auto \ - \ - --with-iptables=/usr/sbin/iptables \ - --with-nft=/usr/sbin/nft \ - --disable-autotools-deprecation \ - \ - || die "Error autogen.sh" - if [[ $QUICK == 1 ]]; then - make dist -j 7 || die "Error make dist" - else - make distcheck -j 7 || die "Error make distcheck" - fi + VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}" + TEST_FLAG="" + if [[ $QUICK == 1 ]]; then + TEST_FLAG="--no-tests" fi + meson dist --allow-dirty -C "$GITDIR/build/" $TEST_FLAG || die "Error meson dist" + export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)" fi if [[ "$ADD_WITH_TEST" == 1 ]]; then WITH_LIST=("${WITH_LIST[@]}" "--with" "test") fi -if [[ "$USE_AUTOTOOLS" != 1 ]]; then - WITH_LIST=("${WITH_LIST[@]}" "--with" "meson") -fi - export SOURCE_FROM_GIT export BUILDTYPE export NM_RPMBUILD_ARGS="${WITH_LIST[@]}" diff --git a/contrib/fedora/rpm/configure-for-system.sh b/contrib/fedora/rpm/configure-for-system.sh index ee017d6e5..5b61a1805 100755 --- a/contrib/fedora/rpm/configure-for-system.sh +++ b/contrib/fedora/rpm/configure-for-system.sh @@ -30,7 +30,7 @@ vars_with_vals() { } usage() { - echo "$ $0 [-m|--meson ] [-a|--autotools] [-s|--show] [-B|--no-build] [-h|--help]" + echo "$ $0 [-m|--meson ] [-s|--show] [-B|--no-build] [-h|--help]" echo "" echo "Configure NetworkManager in a way that is similar to when building" echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`make install\`" @@ -142,7 +142,6 @@ P_NOBUILD="${NOBUILD-0}" P_DEBUG="${DEBUG-1}" -P_BUILD_TYPE="${BUILD_TYPE-meson}" P_MESON_BUILDDIR="${MESON_BUILDDIR-./build}" [ -n "$MESON_BUILDDIR" ] && P_MESON_BUILDDIR_FORCE=1 P_CFLAGS="${CFLAGS-}" @@ -306,14 +305,10 @@ while [[ $# -gt 0 ]] ; do shift case "$A" in --meson|-m) - P_BUILD_TYPE=meson P_MESON_BUILDDIR="$1" P_MESON_BUILDDIR_FORCE=1 shift ;; - --autotools|-a) - P_BUILD_TYPE=autotools - ;; -s|--show) SHOW_CMD=show_cmd ;; @@ -331,7 +326,7 @@ while [[ $# -gt 0 ]] ; do esac done -if [ "$P_BUILD_TYPE" = meson -a "$P_MESON_BUILDDIR_FORCE" != 1 ]; then +if [ "$P_MESON_BUILDDIR_FORCE" != 1 ]; then if [ -d "$P_MESON_BUILDDIR" ]; then echo "Build directory '$P_MESON_BUILDDIR' chosen by default, but it exists and will be overwritten." \ "If you really want that, pass '--meson \"$P_MESON_BUILDDIR\"'." >&2 @@ -341,181 +336,89 @@ fi vars_with_vals -if [ "$P_BUILD_TYPE" == meson ] ; then - MESON_RECONFIGURE= - if test -d "$P_MESON_BUILDDIR" ; then - MESON_RECONFIGURE="--reconfigure" - fi - - $SHOW_CMD \ - env \ - CC="$P_CC" \ - CFLAGS="$P_CFLAGS" \ - meson setup\ - $MESON_RECONFIGURE \ - --buildtype=plain \ - --prefix="$D_PREFIX" \ - --libdir="$D_LIBDIR" \ - --libexecdir="$D_LIBEXECDIR" \ - --bindir="$D_BINDIR" \ - --sbindir="$D_SBINDIR" \ - --includedir="$D_INCLUDEDIR" \ - --datadir="$D_DATADIR" \ - --mandir="$D_MANDIR" \ - --infodir="$D_INFODIR" \ - --localedir="$D_DATADIR"/locale \ - --sysconfdir="$D_SYSCONFDIR" \ - --localstatedir="$D_LOCALSTATEDIR" \ - --sharedstatedir="$D_SHAREDSTATEDIR" \ - --wrap-mode=nodownload \ - --auto-features=enabled \ - -Db_ndebug=false \ - --warnlevel 2 \ - $(args_enable "$P_TEST" --werror) \ - -Dnft="${D_SBINDIR}/nft" \ - -Diptables="${D_SBINDIR}/iptables" \ - -Ddhclient="${D_SBINDIR}/dhclient" \ - -Ddhcpcanon=no \ - -Ddhcpcd=no \ - -Dconfig_dhcp_default="$P_DHCP_DEFAULT" \ - "-Dcrypto=$P_CRYPTO" \ - $(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \ - $(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \ - -Dld_gc=true \ - -Db_lto="$(bool_true "$P_LTO")" \ - -Dlibaudit=yes-disabled-by-default \ - -Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \ - $(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \ - $(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \ - -Diwd="$(bool_true "$P_IWD")" \ - -Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \ - -Dnmtui="$(bool_true "$P_NMTUI")" \ - -Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \ - -Dvapi=true \ - -Dintrospection=true \ - -Ddocs="$(bool_true "$P_REGEN_DOCS")" \ - -Dteamdctl="$(bool_true "$P_TEAM")" \ - -Dovs="$(bool_true "$P_OVS")" \ - -Dselinux=true \ - -Dpolkit=true \ - -Dconfig_auth_polkit_default=true \ - -Dmodify_system=true \ - -Dconcheck=true \ - -Dlibpsl="$(bool_true "$P_FEDORA")" \ - -Debpf="$(bool_true "$P_EBPF_ENABLED")" \ - -Dsession_tracking=systemd \ - -Dsuspend_resume=systemd \ - -Dsystemdsystemunitdir=/usr/lib/systemd/system \ - -Dsystem_ca_path=/etc/pki/tls/cert.pem \ - -Ddbus_conf_dir="$P_DBUS_SYS_DIR" \ - -Dtests=yes \ - -Dvalgrind=no \ - -Difcfg_rh=true \ - -Difupdown=false \ - $(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \ - $(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \ - -Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \ - -Ddist_version="$P_VERSION-$P_RELEASE" \ - $(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \ - -Dresolvconf=no \ - -Dnetconfig=no \ - -Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \ - -Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \ - \ - "$P_MESON_BUILDDIR" \ - ; -else - if ! test -x ./configure ; then - if [ -z "$SHOW_CMD" ]; then - NOCONFIGURE=yes ./autogen.sh - fi - fi - $SHOW_CMD \ - ./configure \ - --build=x86_64-redhat-linux-gnu \ - --host=x86_64-redhat-linux-gnu \ - --program-prefix= \ - --prefix="$D_PREFIX" \ - --exec-prefix=/usr \ - --bindir="$D_BINDIR" \ - --sbindir="$D_SBINDIR" \ - --sysconfdir="$D_SYSCONFDIR" \ - --datadir="$D_DATADIR" \ - --includedir="$D_INCLUDEDIR" \ - --libdir="$D_LIBDIR" \ - --libexecdir="$D_LIBEXECDIR" \ - --localstatedir="$D_LOCALSTATEDIR" \ - --sharedstatedir="$D_SHAREDSTATEDIR" \ - --mandir="$D_MANDIR" \ - --infodir="$D_INFODIR" \ - \ - CC="$P_CC" \ - CFLAGS="$P_CFLAGS" \ - \ - --enable-dependency-tracking=yes \ - \ - --with-runstatedir="$D_RUNDIR" \ - --enable-silent-rules="$(bool_yes "$P_SILENT_RULES")" \ - --enable-static=no \ - --with-nft="${D_SBINDIR}/nft" \ - --with-iptables="${D_SBINDIR}/iptables" \ - --with-dhclient="${D_SBINDIR}/dhclient" \ - --with-dhcpcd=no \ - --with-dhcpcanon=no \ - --with-config-dhcp-default="$P_DHCP_DEFAULT" \ - --with-crypto="$P_CRYPTO" \ - $(args_enable "$P_SANITIZER" --with-address-sanitizer=exec --enable-undefined-sanitizer="$( (bool "$P_FEDORA" || test "$P_RHEL" -ge 8) && echo yes || echo no)" ) \ - $(args_enable "$(bool_not_true "$P_SANITIZER")" --with-address-sanitizer=no --enable-undefined-sanitizer=no ) \ - $(args_enable "$P_DEBUG" --enable-more-logging=yes --with-more-asserts=10000) \ - $(args_enable "$(bool_not_true "$P_DEBUG")" --enable-more-logging=no --with-more-asserts=0 ) \ - --enable-ld-gc=yes \ - --enable-lto="$(bool_yes "$P_LTO")" \ - --with-libaudit=yes-disabled-by-default \ - --with-modem-manager-1="$(bool_yes "$P_MODEM_MANAGER_1")" \ - $(args_enable "$P_WIFI" --enable-wifi=yes --with-wext="$(bool_yes "$P_FEDORA")") \ - $(args_enable "$(bool_not_true "$P_WIFI")" --enable-wifi=no ) \ - --with-iwd="$(bool_yes "$P_IWD")" \ - --enable-bluez5-dun="$(bool_yes "$P_BLUETOOTH")" \ - --with-nmtui="$(bool_yes "$P_NMTUI")" \ - --with-nm-cloud-setup="$(bool_yes "$P_NM_CLOUD_SETUP")" \ - --enable-vala=yes \ - --enable-introspection=yes \ - --enable-gtk-doc="$(bool_yes "$P_REGEN_DOCS")" \ - --enable-teamdctl="$(bool_yes "$P_TEAM")" \ - --enable-ovs="$(bool_yes "$P_OVS")" \ - --with-selinux=yes \ - --enable-polkit=yes \ - --enable-modify-system=yes \ - --enable-concheck=yes \ - --with-libpsl="$(bool_yes "$P_FEDORA")" \ - --with-ebpf="$(bool_yes "$P_EBPF_ENABLED")" \ - --with-session-tracking=systemd \ - --with-suspend-resume=systemd \ - --with-systemdsystemunitdir=/usr/lib/systemd/system \ - --with-system-ca-path=/etc/pki/tls/cert.pem \ - --with-dbus-sys-dir="$P_DBUS_SYS_DIR" \ - --with-tests=yes \ - --enable-more-warnings="$(bool "$P_TEST" && echo error || echo yes)" \ - --with-valgrind=no \ - --enable-ifcfg-rh=yes \ - --enable-ifupdown=no \ - $(args_enable "$P_PPP" --enable-ppp=yes --with-pppd="$D_SBINDIR/pppd" --with-pppd-plugin-dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \ - $(args_enable "$(bool_not_true "$P_PPP")" --enable-ppp=no ) \ - --enable-firewalld-zone="$(bool_yes "$P_FIREWALLD_ZONE")" \ - --with-dist-version="$P_VERSION-$P_RELEASE" \ - $(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" --with-config-plugins-default=ifcfg-rh) \ - --with-resolvconf=no \ - --with-netconfig=no \ - --with-config-dns-rc-manager-default="$P_DNS_RC_MANAGER_DEFAULT" \ - --with-config-logging-backend-default="$P_LOGGING_BACKEND_DEFAULT" \ - --disable-autotools-deprecation \ - ; +MESON_RECONFIGURE= +if test -d "$P_MESON_BUILDDIR" ; then + MESON_RECONFIGURE="--reconfigure" fi +$SHOW_CMD \ +env \ +CC="$P_CC" \ +CFLAGS="$P_CFLAGS" \ +meson setup\ + $MESON_RECONFIGURE \ + --buildtype=plain \ + --prefix="$D_PREFIX" \ + --libdir="$D_LIBDIR" \ + --libexecdir="$D_LIBEXECDIR" \ + --bindir="$D_BINDIR" \ + --sbindir="$D_SBINDIR" \ + --includedir="$D_INCLUDEDIR" \ + --datadir="$D_DATADIR" \ + --mandir="$D_MANDIR" \ + --infodir="$D_INFODIR" \ + --localedir="$D_DATADIR"/locale \ + --sysconfdir="$D_SYSCONFDIR" \ + --localstatedir="$D_LOCALSTATEDIR" \ + --sharedstatedir="$D_SHAREDSTATEDIR" \ + --wrap-mode=nodownload \ + --auto-features=enabled \ + -Db_ndebug=false \ + --warnlevel 2 \ + $(args_enable "$P_TEST" --werror) \ + -Dnft="${D_SBINDIR}/nft" \ + -Diptables="${D_SBINDIR}/iptables" \ + -Ddhclient="${D_SBINDIR}/dhclient" \ + -Ddhcpcanon=no \ + -Ddhcpcd=no \ + -Dconfig_dhcp_default="$P_DHCP_DEFAULT" \ + "-Dcrypto=$P_CRYPTO" \ + $(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \ + $(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \ + -Dld_gc=true \ + -Db_lto="$(bool_true "$P_LTO")" \ + -Dlibaudit=yes-disabled-by-default \ + -Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \ + $(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \ + $(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \ + -Diwd="$(bool_true "$P_IWD")" \ + -Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \ + -Dnmtui="$(bool_true "$P_NMTUI")" \ + -Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \ + -Dvapi=true \ + -Dintrospection=true \ + -Ddocs="$(bool_true "$P_REGEN_DOCS")" \ + -Dteamdctl="$(bool_true "$P_TEAM")" \ + -Dovs="$(bool_true "$P_OVS")" \ + -Dselinux=true \ + -Dpolkit=true \ + -Dconfig_auth_polkit_default=true \ + -Dmodify_system=true \ + -Dconcheck=true \ + -Dlibpsl="$(bool_true "$P_FEDORA")" \ + -Debpf="$(bool_true "$P_EBPF_ENABLED")" \ + -Dsession_tracking=systemd \ + -Dsuspend_resume=systemd \ + -Dsystemdsystemunitdir=/usr/lib/systemd/system \ + -Dsystem_ca_path=/etc/pki/tls/cert.pem \ + -Ddbus_conf_dir="$P_DBUS_SYS_DIR" \ + -Dtests=yes \ + -Dvalgrind=no \ + -Difcfg_rh=true \ + -Difupdown=false \ + $(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \ + $(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \ + -Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \ + -Ddist_version="$P_VERSION-$P_RELEASE" \ + $(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \ + -Dresolvconf=no \ + -Dnetconfig=no \ + -Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \ + -Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \ + \ + "$P_MESON_BUILDDIR" \ + ; + if ! bool "$P_NOBUILD" ; then - if [ "$P_BUILD_TYPE" == meson ] ; then - $SHOW_CMD ninja -C "$P_MESON_BUILDDIR" - else - $SHOW_CMD make -j 10 - fi + $SHOW_CMD ninja -C "$P_MESON_BUILDDIR" fi diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index 162b9da18..09fdc21b0 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -3,7 +3,6 @@ # Arguments via environment variables: # - CI # - CC -# - BUILD_TYPE # - CFLAGS # - WITH_DOCS @@ -50,23 +49,13 @@ grep -q '^NAME=.*\(Alpine\)' /etc/os-release && IS_ALPINE=1 ############################################################################### -if [ "$BUILD_TYPE" == meson ]; then - _TRUE=true - _FALSE=false -elif [ "$BUILD_TYPE" == autotools ]; then - _TRUE=yes - _FALSE=no -else - die "invalid \$BUILD_TYPE \"$BUILD_TYPE\"" -fi - _WITH_CRYPTO="gnutls" _WITH_WERROR=1 -_WITH_LIBTEAM="$_TRUE" -_WITH_DOCS="$_TRUE" -_WITH_SYSTEMD_LOGIND="$_TRUE" +_WITH_LIBTEAM="true" +_WITH_DOCS="true" +_WITH_SYSTEMD_LOGIND="true" if [ $IS_ALPINE = 1 ]; then - _WITH_SYSTEMD_LOGIND="$_FALSE" + _WITH_SYSTEMD_LOGIND="false" fi if [ -z "${NMTST_SEED_RAND+x}" ]; then @@ -92,9 +81,9 @@ fi if [ "$WITH_DOCS" != "" ]; then if _is_true "$WITH_DOCS"; then - _WITH_DOCS="$_TRUE" + _WITH_DOCS="true" else - _WITH_DOCS="$_FALSE" + _WITH_DOCS="false" fi fi @@ -149,149 +138,72 @@ _print_test_logs() { fi } -run_autotools() { - NOCONFIGURE=1 ./autogen.sh - mkdir ./build - if [ "$_WITH_WERROR" == 1 ]; then - _WITH_WERROR_VAL="error" - else - _WITH_WERROR_VAL="yes" - fi - DISABLE_DEPENDENCY_TRACKING= - if [ $IS_ALPINE = 1 ]; then - DISABLE_DEPENDENCY_TRACKING='--disable-dependency-tracking' - fi - pushd ./build - ../configure \ - --prefix="$PWD/INST" \ - $DISABLE_DEPENDENCY_TRACKING \ - \ - --enable-introspection=$_WITH_DOCS \ - --enable-gtk-doc=$_WITH_DOCS \ - --with-systemd-logind=$_WITH_SYSTEMD_LOGIND \ - --enable-more-warnings="$_WITH_WERROR_VAL" \ - --enable-tests=yes \ - --with-crypto=$_WITH_CRYPTO \ - \ - --with-ebpf=no \ - \ - --with-iwd=yes \ - --with-ofono=yes \ - --enable-teamdctl=$_WITH_LIBTEAM \ - \ - --with-dhcpcanon=yes \ - --with-dhcpcd=yes \ - --with-dhclient=yes \ - \ - --with-netconfig=/bin/nowhere/netconfig \ - --with-resolvconf=/bin/nowhere/resolvconf \ - \ - --enable-ifcfg-rh=yes \ - --enable-ifupdown=yes \ - --disable-autotools-deprecation \ - \ - #end - - if [ "$CONFIGURE_ONLY" != 1 ]; then - make -j 6 - make install - - export NM_TEST_CLIENT_CHECK_L10N=1 - - if ! make check -j 6 -k ; then - _print_test_logs "first-test" - echo ">>>> RUN SECOND TEST (start)" - NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || : - echo ">>>> RUN SECOND TEST (done)" - _print_test_logs "second-test" - die "autotools test failed" - fi - - if _with_valgrind; then - if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then - _print_test_logs "(valgrind test)" - die "autotools+valgrind test failed" - fi - fi - fi - popd -} - ############################################################################### -run_meson() { - if [ "$_WITH_WERROR" == 1 ]; then - _WITH_WERROR_VAL="--werror" - else - _WITH_WERROR_VAL="" +if [ "$_WITH_WERROR" == 1 ]; then + _WITH_WERROR_VAL="--werror" +else + _WITH_WERROR_VAL="" +fi + +meson setup build \ + \ + -Dprefix="$PWD/INST" \ + \ + --warnlevel 2 \ + $_WITH_WERROR_VAL \ + \ + -D ld_gc=false \ + -D session_tracking=no \ + -D systemdsystemunitdir=no \ + -D systemd_journal=false \ + -D selinux=false \ + -D libaudit=no \ + -D libpsl=false \ + -D vapi=false \ + -D introspection=$_WITH_DOCS \ + -D qt=false \ + -D crypto=$_WITH_CRYPTO \ + -D docs=$_WITH_DOCS \ + \ + -D ebpf=false \ + \ + -D iwd=true \ + -D ofono=true \ + -D teamdctl=$_WITH_LIBTEAM \ + \ + -D dhclient=/bin/nowhere/dhclient \ + -D dhcpcanon=/bin/nowhere/dhcpcanon \ + -D dhcpcd=/bin/nowhere/dhcpd \ + \ + -D netconfig=/bin/nowhere/netconfig \ + -D resolvconf=/bin/nowhere/resolvconf \ + \ + -D ifcfg_rh=false \ + -D ifupdown=true \ + \ + #end + +export NM_TEST_CLIENT_CHECK_L10N=1 + +if [ "$CONFIGURE_ONLY" != 1 ]; then + ninja -C build -v + ninja -C build install + + if ! meson test -C build -v --print-errorlogs ; then + echo ">>>> RUN SECOND TEST (start)" + NMTST_DEBUG="debug,TRACE,no-expect-message" \ + meson test -C build -v --print-errorlogs || : + echo ">>>> RUN SECOND TEST (done)" + die "meson test failed" fi - meson setup build \ - \ - -Dprefix="$PWD/INST" \ - \ - --warnlevel 2 \ - $_WITH_WERROR_VAL \ - \ - -D ld_gc=false \ - -D session_tracking=no \ - -D systemdsystemunitdir=no \ - -D systemd_journal=false \ - -D selinux=false \ - -D libaudit=no \ - -D libpsl=false \ - -D vapi=false \ - -D introspection=$_WITH_DOCS \ - -D qt=false \ - -D crypto=$_WITH_CRYPTO \ - -D docs=$_WITH_DOCS \ - \ - -D ebpf=false \ - \ - -D iwd=true \ - -D ofono=true \ - -D teamdctl=$_WITH_LIBTEAM \ - \ - -D dhclient=/bin/nowhere/dhclient \ - -D dhcpcanon=/bin/nowhere/dhcpcanon \ - -D dhcpcd=/bin/nowhere/dhcpd \ - \ - -D netconfig=/bin/nowhere/netconfig \ - -D resolvconf=/bin/nowhere/resolvconf \ - \ - -D ifcfg_rh=false \ - -D ifupdown=true \ - \ - #end - export NM_TEST_CLIENT_CHECK_L10N=1 - - if [ "$CONFIGURE_ONLY" != 1 ]; then - ninja -C build -v - ninja -C build install - - if ! meson test -C build -v --print-errorlogs ; then - echo ">>>> RUN SECOND TEST (start)" - NMTST_DEBUG="debug,TRACE,no-expect-message" \ - meson test -C build -v --print-errorlogs || : - echo ">>>> RUN SECOND TEST (done)" - die "meson test failed" - fi - - if _with_valgrind; then - if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then - _print_test_logs "(valgrind test)" - die "meson+valgrind test failed" - fi + if _with_valgrind; then + if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then + _print_test_logs "(valgrind test)" + die "meson+valgrind test failed" fi fi -} - -############################################################################### - -if [ "$BUILD_TYPE" == autotools ]; then - run_autotools -elif [ "$BUILD_TYPE" == meson ]; then - run_meson fi if [ "$USE_CCACHE" = 1 ]; then diff --git a/tools/create-exports-NetworkManager.sh b/tools/create-exports-NetworkManager.sh index 855d83752..38bcdaf68 100755 --- a/tools/create-exports-NetworkManager.sh +++ b/tools/create-exports-NetworkManager.sh @@ -13,24 +13,6 @@ die() { # plugins. Note that this depends on how NetworkManager and # the plugins are build. For example, compiling without # --with-more-asserts will yield less symbols. -# -# _build re-builds NetworkManager with relevant compile time -# options to yield the most symbols. -_build() { - git clean -fdx - ./autogen.sh --enable-ld-gc \ - --enable-ifcfg-rh \ - --enable-ifupdown \ - --enable-teamdctl \ - --enable-wifi \ - --with-modem-manager-1 \ - --with-ofono \ - --with-more-asserts \ - --with-more-logging \ - --disable-autotools-deprecation - make -j20 -} - _sort() { LANG=C sort -u } @@ -75,16 +57,6 @@ pretty() { sed 's/.*/\t&;/' } -do_build() { - do_update - make -} - -do_rebuild() { - _build - do_build -} - do_update() { do_generate > ./src/core/NetworkManager.ver } @@ -117,14 +89,6 @@ EOF test -f ./src/core/${libs}libNetworkManager.a || die "must be called from NetworkManager top build dir after building the tree" case "$1" in - rebuild) - [ -n "$from_meson" ] && die "can't do a build when called from meson" - do_rebuild - ;; - build) - [ -n "$from_meson" ] && die "can't do a build when called from meson" - do_build - ;; --called-from-build) if test -z "${NM_BUILD_NO_CREATE_EXPORTS+x}"; then do_update diff --git a/tools/nm-guest-data/bin-nm-deploy.sh.in b/tools/nm-guest-data/bin-nm-deploy.sh.in index 9b5385b1e..77b51d0ca 100644 --- a/tools/nm-guest-data/bin-nm-deploy.sh.in +++ b/tools/nm-guest-data/bin-nm-deploy.sh.in @@ -4,11 +4,6 @@ set -ex cd /NetworkManager -if [ -f ./config.log ] ; then - make -j 5 install -else - meson install -C build -fi - +meson install -C build systemctl daemon-reload systemctl restart NetworkManager.service diff --git a/tools/nm-guest-data/etc-bashrc.my.in b/tools/nm-guest-data/etc-bashrc.my.in index 88f2f9aa2..f6936c4db 100644 --- a/tools/nm-guest-data/etc-bashrc.my.in +++ b/tools/nm-guest-data/etc-bashrc.my.in @@ -1,4 +1,3 @@ -alias m="make -j 8" alias n="ninja -C build" alias l='ls -l --color=auto' diff --git a/tools/nm-in-container b/tools/nm-in-container index c6884cd58..755d8d502 100755 --- a/tools/nm-in-container +++ b/tools/nm-in-container @@ -229,7 +229,6 @@ RUN dnf install -y \\ libtool \\ libubsan \\ libuuid-devel \\ - make \\ meson \\ mlocate \\ mobile-broadband-provider-info-devel \\ diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh index 264fc48d0..9f0a65319 100755 --- a/tools/run-nm-test.sh +++ b/tools/run-nm-test.sh @@ -35,9 +35,7 @@ usage() { echo " the automatism to always launch a D-Bus session" echo " --no-launch-dbus|-D: prevent launching a D-Bus session" echo " --no-libtool: when running with valgrind, the script tries automatically to" - echo " use libtool as necessary. This disables libtool usage" - echo " --make-first|-m: before running the test, make it (only works with autotools build)" - echo " --no-make-first|-M: disable --make-first option" + echo " use libtool as necessary. This disables libtool usage" echo " --valgrind|-v: run under valgrind" echo " --no-valgrind|-V: disable running under valgrind (overrides NMTST_USE_VALGRIND=1)" echo " -d: set NMTST_DEBUG=d" @@ -126,8 +124,6 @@ if [ "$CALLED_FROM_MAKE" == 1 ]; then NMTST_LAUNCH_DBUS=0 fi TEST="$1"; shift - NMTST_MAKE_FIRST=0 - TEST_ARGV=("$@") else if [[ -z "${NMTST_USE_VALGRIND+x}" ]]; then @@ -162,14 +158,6 @@ else NMTST_LIBTOOL=() shift ;; - --make-first|-m) - NMTST_MAKE_FIRST=1 - shift - ;; - --no-make-first|-M) - NMTST_MAKE_FIRST=0 - shift - ;; "--valgrind"|-v) NMTST_USE_VALGRIND=1 shift; @@ -235,14 +223,6 @@ fi [ -n "$TEST" ] || die "Missing test name. Specify it on the command line." -if _is_true "$NMTST_MAKE_FIRST" 0; then - git_dir="$(readlink -f "$(git rev-parse --show-toplevel)")" - rel_path="$(realpath --relative-to="$git_dir" -m "$TEST" 2>/dev/null)" || die "cannot resolve test-name \"$TEST\". Did you call the script properly?" - cd "$git_dir" - make -j5 "$rel_path" || die "make of $TEST failed ($git_dir / $rel_path)" - cd - 1>/dev/null -fi - [ -x "$TEST" ] || die "Test \"$TEST\" does not exist" TEST_PATH="$(readlink -f "$(dirname "$TEST")")" TEST_NAME="${TEST##*/}" diff --git a/tools/test-build.sh b/tools/test-build.sh deleted file mode 100755 index 04d33b6ae..000000000 --- a/tools/test-build.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -set -e - -die() { - echo "$@" - exit 1 -} - -if [[ "x$(LANG=C git clean -ndx)" != x ]]; then - die "The working directory is not clean. Refuse to run. Try \`git clean -dx -n\`" -fi -if [[ "x$(git status --porcelain)" != x ]]; then - die "The working directory has local changes. Refuse to run. Try \`git reset --hard\`" -fi - -build_out_of_tree() { - local TARGET="$1" - local C="$2" - local M="$3" - ( - git clean -fdx || return 1 - NOCONFIGURE=x ./autogen.sh || return 1 - mkdir -p x/y || return 1 - cd x/y || return 1 - ../../configure $C $NMTST_CONFIGURE || return 1 - make $TARGET $M $NMTST_MAKE || return 1 - ) -} - -TARGETS=("$@") -if [ "${#TARGETS}" -lt 1 ]; then - TARGETS=( - dispatcher/nm-dispatcher - src/core/NetworkManager - src/core/dhcp/nm-dhcp-helper - src/core/ndisc/tests/test-ndisc-linux - src/core/platform/tests/monitor - src/nm-online/nm-online - src/nmcli/nmcli - src/nmtui/nmtui - $(git grep -h '\.l\?a\>' Makefile.am | sed 's/[a-zA-Z.0-9_-/]\+/\n\0\n/g' | sort -u | grep '\.l\?a$') - ) -fi - -set -x - -cd "$(dirname "$(readlink -f "$0")")/.." - -IDX=($(seq 0 $((${#TARGETS[@]} - 1)))) -IDX=($(printf '%s\n' "${IDX[@]}" | sort -R)) -for idx in "${IDX[@]}"; do - TARGET="${TARGETS[$idx]}" - echo "### $idx: TARGET=$TARGET" - build_out_of_tree "$TARGET" "--enable-gtk-doc" "-j 5" -done