Commit graph

423 commits

Author SHA1 Message Date
Thomas Haller
a6e92c2342 contrib/rpm: fix bare words in spec file for %{ibft_enabled}
error: bare words are no longer supported, please use "...":  no != yes
  error:                                                        ^
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200420-192728.bRtN05/SPECS/NetworkManager.spec:614: bad %if condition:  no != yes
2020-04-20 21:46:23 +02:00
Thomas Haller
362d528f5e checkpatch: catch "gs_free GError *" declations
(cherry picked from commit ec0adbfaf0)
(cherry picked from commit 2fa4827eb9)
(cherry picked from commit 00cf235a7a)
2020-04-20 12:12:45 +02:00
Lubomir Rintel
c694a8c935 contrib/checkpatch: fix the systemd code path
(cherry picked from commit ae6668ae85)
(cherry picked from commit 24d40570a7)
2020-04-20 12:12:39 +02:00
Lubomir Rintel
570030a687 contrib/checkpatch: allow empty lines within continuations
This chunk from nm-device.c is, in fact, okay:

               |<-tab->nm_assert (   !new_config
               |<-tab->           || (   new_config
               |<-tab->               && ({
               |<-tab->                    int ip_ifindex = ...
 empty line -> |
               |<-tab->                    (   ip_ifindex > 0
               |<-tab->                     && ip_ifindex == ...
               |<-tab->                  })));

(cherry picked from commit a5dd31afeb)
2020-04-20 12:11:36 +02:00
Lubomir Rintel
8e11e4b98c contrib/checkpatch: be a bit stricter about whitespace
In continations (that use spaces for alignment), don't allow the number
of leading tabs to change. Previously only removal of tabs was
disallowed, but addition doesn't make sense either, as only spaces
should be used for further alignemnt.

This catches situations like this:

  |<-tab->all_work_and_no_play (makes,
  |<-tab->                      jack,
  |<-tab-><-tab->               a dull boy);

(cherry picked from commit da312e6220)
2020-04-20 12:11:20 +02:00
Lubomir Rintel
744c821bbd contrib/checkpatch: discourage g_assert*()
(cherry picked from commit 5ff19ea8d2)
2020-04-20 12:10:43 +02:00
Lubomir Rintel
5dd1c6db65 contrib/checkpatch: properly determine the commit id boundary
It doesn't have to be at the end of line, there may be more words
following.

Fixes: d66a1ace23 ('contrib/checkpatch: avoid command injection in checkpatch.pl script')
(cherry picked from commit f3f8e21bd3)
2020-04-20 12:10:28 +02:00
Thomas Haller
ae23ef8b3c contrib/REQUIRED_PACKAGES: ignore for non-existing packages "dbus-python", "pygobject3-base" on Fedora 32
These packages no longer exist on Fedora 32 and dnf fails due to
that. Ignore such errors.

(cherry picked from commit bdd45e6afa)
(cherry picked from commit 27664ff425)
(cherry picked from commit e573f77855)
2020-04-20 12:04:21 +02:00
Thomas Haller
29e068cfe5 contrib/REQUIRED_PACKAGES: fix script to work without GNU which installed
`which` is convenient, but not installed in Fedora container images.
Fix detection of whether to use `dnf` or `yum`.

(cherry picked from commit 5cc8ca4038)
(cherry picked from commit 68fa338e34)
(cherry picked from commit ceb602cab1)
2020-04-20 12:03:34 +02:00
Thomas Haller
8a15ffabc3 contrib/rpm: drop BuildRequires to deprecated "wireless-tools-devel"
"wireless-tools-devel" is long depreacted and not used by
NetworkManager, not even for WEXT.

Drop it from the build dependencies.

(cherry picked from commit 9fc4490513)
(cherry picked from commit 35a2a71801)
2020-04-20 12:03:15 +02:00
Thomas Haller
627dc8a933 contrib/rpm: use proper check for nmtui conditional build
(cherry picked from commit 0f4819ab36)
(cherry picked from commit cca752af94)
2020-04-20 11:45:42 +02:00
Thomas Haller
2d3df2e6ef contrib/rpm: fix parsing of %real_version_major for ".0" versions
(cherry picked from commit 6c9880f8ca)
(cherry picked from commit d734a4766c)
2020-04-20 11:45:22 +02:00
Thomas Haller
74ef5f7f05 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != "yes"
  error:                                                        ^
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-170120.dp5cp5/SPECS/NetworkManager.spec:596: bad %if condition:  no != "yes"

(cherry picked from commit ed94ab6e23)
(cherry picked from commit 1667be7cf5)
(cherry picked from commit 719d492f4a)
(cherry picked from commit 71d4e261f6)
2020-04-20 11:44:48 +02:00
Thomas Haller
49d314cb76 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != yes
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-163008.VM582H/SPECS/NetworkManager.spec:596: bad %if condition:  no != yes

(cherry picked from commit be78a12012)
(cherry picked from commit c869d792a2)
(cherry picked from commit 5735e267cd)
(cherry picked from commit 3fcc337770)
2020-04-20 11:44:47 +02:00
Thomas Haller
d7cf55849c contrib/rpm: avoid warning in specfile about tokens after %endif
warning: extra tokens at the end of %endif directive in line 717:  %endif # end autotools
warning: extra tokens at the end of %endif directive in line 775:  %endif # end autotools
(cherry picked from commit 0521e06ff1)
(cherry picked from commit 43aa1f7ff1)
2020-04-20 11:43:57 +02:00
Thomas Haller
6e8582a08f contrib/rpm: avoid bare words in spec file
error: bare words are no longer supported, please use "...":  "x" != x
   error:                                                               ^
   error: /root/nm-build/NetworkManager/contrib/fedora/rpm/NetworkManager.20200402-030113.Hk7EGs/SPECS/NetworkManager.spec:32: bad %if condition:  "x" != x
   ERROR: rpmbuild FAILED

(cherry picked from commit 68b38a09d1)
(cherry picked from commit 045194760e)
(cherry picked from commit 477c6c3e70)
2020-04-02 09:37:57 +02:00
Thomas Haller
67128fe6c0 checkpatch,gitlab-ci: let checkpatch script compare against latest upstream master
When opening a merge request from a fork of NetworkManager, then the
pipeline runs with the a checkout of the fork. That means, checkpatch
would compare the branch against "master" (or "nm-x-y" stable branches)
of the fork, instead of upstream.

That doesn't seem too useful. Instead, also add upstream NetworkManager
as git remote, fetch the branches, and use the branches from there as
base for checkpatch.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/255
(cherry picked from commit 3019648b4b)
(cherry picked from commit 9a37702311)
2019-10-08 15:26:52 +02:00
Thomas Haller
543daa0f5d tests: don't install bzip2 as REQUIRED_PACKAGES on Fedora/RHEL
(cherry picked from commit 3a1b2b9885)
(cherry picked from commit 2b01ac0932)
2019-10-08 15:26:51 +02:00
Thomas Haller
ce79b9a9b5 tests: don't install unnecessary package in gitlab-ci tests
REQUIRED_PACKAGES has two uses:

 - to setup a system for developing NetworkManager. This installs
   convenience packages like "cscope".

 - to install the packages required for unit testing in gitlab-ci.

For gitlab-ci we should only install the packages that we actually
need.

(cherry picked from commit 1a2a5b37b4)
(cherry picked from commit 6ff16a48bb)
2019-10-08 15:26:51 +02:00
Thomas Haller
8845384e06 tests: fix failure installing non-existing packages in REQUIRED_PACKAGES
Previously, dnf/yum used to ignore packages that didn't exist.
In Fedora 32, dnf starts to fail the entire command:

  No match for argument: python-gobject-base
  Error: Unable to find a match: python-gobject-base

Since this script is supposed to work with different RHEL/Fedora
versions, it's expected that not all packages are available everywhere.

Fix that, by installing packages that we know that they might be missing
one by one (and ignore the error).

(cherry picked from commit 185567559c)
(cherry picked from commit 888718d6f4)
2019-10-08 15:26:51 +02:00
Thomas Haller
66980f57ab contrib/rpm: "Suggest" wpa_supplicant for NetworkManager-wifi package
"NetworkManager-wifi" package requires either wpa_supplicant or iwd.
When installing the package without explicitly installing supplicant
or iwd (and not having it installed yet), then we want to drag in
wpa_supplicant by default. That is accomplished by suggesting wpa_supplicant
package.

Otherwise, the user installing NetworkManager-wifi might get iwd,
which is only functioning if the user explicitly enables the backend
in "NetworkManager.conf".

https://bugzilla.redhat.com/show_bug.cgi?id=1743585
(cherry picked from commit 4b1cb404fd)
(cherry picked from commit c44c796a90)
2019-10-08 15:26:51 +02:00
Thomas Haller
656109c3d0 gitlab-ci: also build on CentOS 7.5 and 7.6
(cherry picked from commit 896dc7d4d9)
2019-10-08 15:26:50 +02:00
Thomas Haller
87c0e8dc83 gitlab-ci: disable valgrind on Fedora 30 and Fedora 31 depending on glib2 package
Valgrind is known to report many false positives with certain glib2
versions. Workaround that by disabling it based on the installed
package version.

See-also: https://bugzilla.redhat.com/show_bug.cgi?id=1710417
See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/155
(cherry picked from commit 5e11d4bf1f)
2019-10-08 15:26:50 +02:00
Thomas Haller
3c9d9b0f51 gitlab-ci: run unit tests under valgrind in gitlab-ci
On Ubuntu 16.04 (trusty) valgrind fails due to rdrand being advertised
but not implemented.

Work around that by installing valgrind from Ubuntu 18.04 (bionic) via
the "contrib/scripts/nm-ci-install-valgrind-in-ubuntu1604.sh" script.

(cherry picked from commit 6d76a0974e)
2019-10-08 15:26:49 +02:00
Thomas Haller
05576bd9cf tests: use "/run" instead of "/var/run"
(cherry picked from commit 10688e3d88)
2019-10-08 15:26:49 +02:00
Thomas Haller
cd8c375849 ci: randomize tests during our CI
This affects gitlab-ci and travis-ci, which both run this script.

(cherry picked from commit 70487d9ff8)
2019-10-08 15:26:49 +02:00
Thomas Haller
a96f601c8a contrib/rpm: fix comment in ./build_clean.sh -h output
(cherry picked from commit c307f07207)
2019-10-08 15:26:49 +02:00
Lubomir Rintel
23d244dee1 all: codespell fixes
Codespel run with the same arguments as described in
commit 58510ed566 ('docs: misc. typos pt2').

(cherry picked from commit 3c6644db32)
2019-07-24 13:32:45 +02:00
Thomas Haller
f43fb59b6d gitlab-ci: install glib2-doc via "contrib/fedora/REQUIRED_PACKAGES"
We also generate a source tarball and artifact it.

Hence, we need proper gtk-doc links. This requires files in
/usr/share/gtk-doc/html for adding cross links. Install glib2-doc
package.

Note that in containers dnf is configured to not install documentation
files. We need to override that.

(cherry picked from commit a0f31e4038)
2019-04-20 21:02:16 +02:00
Thomas Haller
7973680ca2 gitlab-ci: build on Ubuntu 16.04, 18.04 and Debian stretch (9), testing, sid
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/119
(cherry picked from commit 1ca380f69f)
2019-04-19 08:22:14 +02:00
Till Maas
51aee380c0 contrib/rpm: Provide list of units to %systemd_postun
%systemd_postun is meant to be run with arguments and Fedora Rawhide
seems to enforce this now. Therefore provide the units there, too.

https://github.com/NetworkManager/NetworkManager/pull/348
(cherry picked from commit 7d62f81e2e)
2019-04-18 21:51:35 +02:00
Thomas Haller
c210ad9d26 Revert "contrib/rpm: drop --with-libnm-glib from build_clean"
Since we restored libnm-glib in commit b027723e00,
also revert this commit.

This reverts commit 0750ff1f81.
2019-04-11 11:40:20 +02:00
Thomas Haller
0d16b037f5 contrib/rpm: disable eBPF for package builds on Fedora
We have random failures to build on gitlab-ci. Something is wrong,
at least, eBPF is not working reliably. Disable it for now.
2019-04-09 16:01:30 +02:00
Thomas Haller
b3997312bf contrib/rpm: make spec file more similar to rhel-7's 2019-04-09 15:41:21 +02:00
Thomas Haller
b1f556bae2 contrib/rpm: from Fedora 31 onwards use internal DHCP client by default
In RHEL-8.0 we already switched the default DHCP plugin.
It's past time that we do the same for Fedora.
2019-04-09 13:56:38 +02:00
Thomas Haller
a5869d1b35 gitlab-ci: run unit tests for n-acd with eBPF disabled
Enabling eBPF causes src/devices/tests/test-acd to fail:

    strace: bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=8, map_flags=0, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0}, 112) = -1 EPERM (Operation not permitted)

    NetworkManager-Message: 10:07:04.404: <warn>  [1554631624.4046] acd[0xa2b400,10]: couldn't init ACD for announcing addresses on interface 'nm-test-veth0': Operation not permitted

Interestingly it does not always fail. Seems to depend on the kernel
which is used in the containerized test environments of gitlab-ci.

For now, just disable eBPF and use the fallback implementation.
2019-04-07 12:58:08 +02:00
Thomas Haller
ef338667f8 contrib/rpm: disable NDEBUG for meson builds
For better or worse, our release builds commonly do not disable assertions.
That means,

 - NDEBUG is not set, and assert() is in effect
 - G_DISABLE_ASSERT is not set, and g_assert() is in effect
 - G_DISABLE_CHECKS is not set, and g_return*() is in effect.

On the other hand, NM_MORE_ASSERTS is not enabled by default and nm_assert()
is stripped away. That is the actual purpose of nm_assert(): it is
commonly disabled on release builds, while all other assertions are
enabled.

Note that it is fully supported to build NetworkManager with all kind of
assertions disabled. However, such a configuration is not much tested
and I would not recommend it for that reason.

%meson expands to

  $ /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled -Db_ndebug=true . x86_64-redhat-linux-gnu $OTHER_ARGS

thus passing -DNDEBUG to the meson build. Override that.
2019-04-04 09:56:19 +02:00
Lubomir Rintel
b027723e00 Revert "all: goodbye libnm-glib"
We need this for a little little longer :(

This reverts commit 1de8383ad9.
2019-04-03 08:52:38 +02:00
Lubomir Rintel
0750ff1f81 contrib/rpm: drop --with-libnm-glib from build_clean
It does nothing now.
2019-03-20 08:47:51 +01:00
Lubomir Rintel
1de8383ad9 all: goodbye libnm-glib
This removes libnm-glib, libnm-glib-vpn, and libnm-util for good.
The it has been replaced with libnm since NetworkManager 1.0, disabled
by default since 1.12 and no up-to-date distributions ship it for years
now.

Removing the libraries allows us to:

* Remove the horrible hacks that were in place to deal with accidental use
  of both the new and old library in a single process.
* Relief the translators of maintenance burden of similar yet different
  strings.
* Get rid of known bad code without chances of ever getting fixed
  (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c)
* Generally lower the footprint of the releases and our workspace

If there are some really really legacy users; they can just build
libnm-glib and friends from the NetworkManager-1.16 distribution. The
D-Bus API is stable and old libnm-glib will keep working forever.

https://github.com/NetworkManager/NetworkManager/pull/308
2019-03-19 17:15:15 +01:00
Thomas Haller
d66a1ace23 contrib/checkpatch: avoid command injection in checkpatch.pl script
The capture variables, $1, etc, are not valid unless the match
succeeded, and they're not cleared, either.

    $ git checkout -B C origin/master && \
        echo XXXXX > f.txt && \
        git add f.txt && \
        git commit -m 'this commit does something()'
    Branch 'C' set up to track remote branch 'master' from 'origin'.
    Reset branch 'C'
    Your branch is up to date with 'origin/master'.
    sh: -c: line 0: syntax error near unexpected token `('
    sh: -c: line 0: `git log --abbrev=12 --pretty=format:"%h ('%s')" -1 does something() 2>/dev/null'

    >>> VALIDATE "a169a98e14 this commit does something()"
    (commit message):4: Commit 'does something()' does not seem to exist:
    > Subject: [PATCH] this commit does something()

    (commit message):4: Refer to the commit id properly: :
    > Subject: [PATCH] this commit does something()

    The patch does not validate.
2019-03-18 11:57:04 +01:00
Thomas Haller
9992ac1cf8 platform: add routing-rule add/delete netlink functions 2019-03-13 09:03:59 +01:00
Thomas Haller
bfd6d608e2 contrib: set shift for less in NM-log 2019-03-13 09:03:58 +01:00
Lubomir Rintel
a1e6afc0b2 contrib/rpm: drop ldconfig scriptlets from Fedora 28+
In newer RPM file triggers in glibc package take care of this. While
these scriptlets whould do no harm there, removing them yields a tiny
theoretical performance improvement.
2019-03-07 15:28:56 +01:00
Lubomir Rintel
3326a87953 Revert "contrib/rpm: use "%ldconfig_scriptlets" for Fedora 30+"
This is utterly pointless. %ldconfig_scriptlets expand to an empty
string on Fedora 28+.

This reverts commit ad836541cb.
2019-03-07 15:28:56 +01:00
Lubomir Rintel
c10e61e21d contrib/rpm: drag in vala tools by the binary
The package's called either "vala" or "vala-tools". Sigh.
2019-03-07 15:28:56 +01:00
Lubomir Rintel
f8dde7014b Revert "contrib/rpm: require "vala" instead of "vala-tools" for Fedora 30+"
This is just plain ugly.

This reverts commit 0024485b5a.
2019-03-07 15:28:56 +01:00
Lubomir Rintel
27418b1851 Revert "contrib/rpm: remove Group tag for Fedora 30+"
Group tag is not required, though is harmless. We could either remove it,
or keep it, but there's absolutely no excuse for conditionalizing it.

Let's keep it for now, because rpm -i still prints it.

This reverts commit 1feeba6f1a.
2019-03-07 15:28:56 +01:00
Lubomir Rintel
f8578ddc2e contrib/checkpatch: check that we refer to commits properly 2019-03-07 10:55:30 +01:00
Thomas Haller
1feeba6f1a contrib/rpm: remove Group tag for Fedora 30+
https://fedoraproject.org/wiki/Changes/Remove_Group_Tag

62adcbc888
2019-03-07 09:53:50 +01:00