Commit Graph

385 Commits

Author SHA1 Message Date
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
Thomas Haller
ad836541cb contrib/rpm: use "%ldconfig_scriptlets" for Fedora 30+
https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets

5c6421bc88
2019-03-07 09:53:50 +01:00
Thomas Haller
0024485b5a contrib/rpm: require "vala" instead of "vala-tools" for Fedora 30+
The "vala-tools" package was merged into "vala" [1]. While "vala"
now "Provides: vala-tools", update the build requirements for
Fedora 30 and newer.

[1] 82b21cc302

f6c878a04a
2019-03-07 09:53:50 +01:00
Thomas Haller
53aac0233c build/ci: enable --werror for meson builds
This enables -Werror for meson builds on gitlab-ci and semaphore.
Not on Travis, the compiler there is too old, giving too many bogus
warnings.

This reverts commit 928d68d04a ("m4:
disable -Wmissing-braces for newer clang").
2019-02-08 20:14:50 +01:00
Thomas Haller
ff5944ce03 contrib/rpm: enable warnings and fatal-warnings with meson build 2019-02-08 20:14:50 +01:00
Thomas Haller
45f4f573ca contrib/rpm: add comment to "20-connectivity-{fedora,redhat}.conf" about rp_filter 2019-02-08 16:24:25 +01:00
Thomas Haller
bdac03fe9a gitlab-ci: build with clang and do multiple builds in one test-step
Also, let one docker image do multiple builds. We fetch a fedora docker
image, and then install 250 MB of packages. That alone takes a lot of
time and resources. Instead of running a large number of docker images
that only do one build, let one image do several builds.

Also, install ccache. Hopefully this way we can benefit from
building the same sources multiple times.

Also note that building docs does not work currently with clang,
due to g-ir-scanner. See commit 05568860cce5332977d92b85f7c25b8ed646cd58.
2019-02-07 17:31:37 +01:00
Thomas Haller
389197fa81 gitlab-ci: allow enabling/disabling building documentation in "nm-ci-run.sh"
g-ir-scanner does not support building with clang, due to [1], [2], [3].

It triggers

    checking if /usr/bin/g-ir-scanner works... no (compiler failure -- check config.log)
    configure: error: introspection enabled but can't be used

with

    clang-7: error: unknown argument: '-fstack-clash-protection'

See also commit 99b92fd992, which adds this configure
check.

Honor the environment variable WITH_DOCS to allow the caller to overwrite
the automatic detection that the script does.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=757934
[2] https://gitlab.gnome.org/GNOME/gobject-introspection/issues/150
[3] c14d037228
2019-02-07 17:31:31 +01:00
Thomas Haller
6505a781cf contrib: install python3-gobject as REQUIRED_PACKAGES
To run the tests with python3, we need python3-gobject.

Note that "contrib/fedora/REQUIRED_PACKAGES" is called by
"contrib/scripts/nm-ci-run.sh" script to install the packages
in Fedora.
2019-02-07 17:31:05 +01:00
Thomas Haller
a0b976ac8b contrib/rpm: quote snapshot/git_sha variables in spec-file
Otherwise the following fails:

    $ ./contrib/fedora/rpm/build_clean.sh -g -s x.1
    ...
    error: parse error in expression
    error: /data/src/_NetworkManager/contrib/fedora/rpm/NetworkManager.20190207-165257.XOkW4i/SPECS/NetworkManager.spec:35: bad %if condition
    ERROR: rpmbuild FAILED

Even with the fix, not all characters are allowed:

    $ ./contrib/fedora/rpm/build_clean.sh -g -s x-1
    ...
    error: line 112: Illegal char '-' (0x2d) in: Release: 22165.x-1.25b13e2053.fc29
    ERROR: rpmbuild FAILED
2019-02-07 16:55:31 +01:00
Thomas Haller
f1714b485d gitlab-ci: minor cleanup of "contrib/scripts/nm-ci-run.sh" script 2019-02-05 13:49:20 +01:00
Thomas Haller
9891217a78 contrib/rpm: add option to enable LTO for RPM build 2019-02-04 10:55:25 +01:00
Rafael Fontenelle
d81e10942f all: fix misspellings
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/64
2019-01-24 17:19:44 +01:00
Thomas Haller
1ffa40872f contrib/rpm: remove unused 00-server-dhcp-client-id.conf configuration snippet
Now that the default for the internal client is "mac", we don't need
this snippet anymore. Drop it.

Don't renumber the source files but leave the gap at Source3. Everytime
we add config snippets the numbers need to be shuffled, so don't fill
the gap and maybe use it in the future.

https://bugzilla.redhat.com/show_bug.cgi?id=1661165
2019-01-07 17:13:23 +01:00
Thomas Haller
cce3c0c63d contrib: adjust NM-log for changes to platform logging
Fixes: 8f107f5c00
2018-12-30 15:17:11 +01:00
Thomas Haller
e498f594bb checkpatch: warn if there is a file "TODO.txt"
This allows us to add a file "TODO.txt" in the top level directory.
This file is not intended to be merged to master, but keep track of
stuff that is still to do before merging a branch.

Let checkpatch.pl warn about the presence of such a file.
2018-12-30 15:17:11 +01:00
Thomas Haller
fc052494d1 checkpatch: warn about suspicious gtk-doc annotations
It's

    (allow-none):

and

    (transfer none):

That's confusing enough. Add a check.
2018-12-30 15:17:11 +01:00
Iñigo Martínez
4b32bbc820 build: meson: Remove polkit_dir option
meson is able to get variables defined in pkg-config files such as
directory paths. PolicyKit defines in its pkg-config file the path to
the directory where `policy` files are present.

This removes the `polkit_dir` option to ease the move to start using
those variables. The `polkit` variable has also been converted to
boolean.

Fedora spec script has also been updated accordingly.
2018-12-20 13:50:34 +01:00
Thomas Haller
3627601bde contrib/rpm: adjust match-device spec for 00-server-dhcp-client-id.conf
For older NetworkManager versions, a match spec that only contained except:
specifiers could never yield a positive match. That is not very useful and
got fixed by commit 242de347adbf653a709607979d36a0da1ca3ff0b (core: fix
device spec matching for a list of "except:").

Still, adjust the configuration snippet so that it also works with
configurations that predate the fix.
2018-12-11 14:01:41 +01:00
Thomas Haller
122aa550d2 gitlab-ci: patch gtk-doc to generate valid documentation
We generate documentation for pages ([1], [2]), hence, we need to patch
gtk-doc [3].

[1] https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/
[2] https://networkmanager.pages.freedesktop.org/NetworkManager/libnm/
[3] https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2
2018-12-01 08:55:44 +01:00
Thomas Haller
763cb8d486 ci: use common script for tests on travis and gitlab
For one, it's not unreasonable that we want to run the same
tests both for gitlab and travis.

Move the actual tests into a script, which is called by both
CI environments.

We still can do something different, based on the environment.
The advantage here is, that the common part will be shared, and
the places where we differ can easily be spot.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/44
2018-11-12 11:29:37 +01:00
Beniamino Galvani
570c41aae4 rpm: disable ebpf support on RHEL
The ebpf syscall doesn't work on RHEL even if the linux/bpf.h header
is available: let's explicitly disable it.

On Fedora explicitly enable eBPF instead of autodetecting it.
2018-11-09 11:36:25 +01:00
Lubomir Rintel
32857a093b modemu: fall back to a virtual bus
This allows us to somehow work with no PCI (or USB for that matter), such
as some virtual machines. Old ModemManager doesn't like this though, but
there doesn't seem to be a way around it.

https://github.com/NetworkManager/NetworkManager/pull/246
2018-11-07 14:50:21 +01:00
Lubomir Rintel
bbb1a36020 modemu: fix subsystem hash endianness
Tested on a really really big endian IBM POWER. Also turn an accompanying
comment into a slightly more sensible one.

https://github.com/NetworkManager/NetworkManager/pull/246
2018-11-07 14:50:18 +01:00
Lubomir Rintel
adc0150e7f rpm: add a bundled(systemd) provide
Required by Fedora Packaging Standards [1] and also really useful.

[1] https://fedoraproject.org/wiki/Bundled_Libraries?rd=Packaging:Bundled_Libraries#Requirement_if_you_bundle

https://github.com/NetworkManager/NetworkManager/pull/247
2018-11-07 14:46:11 +01:00
Thomas Haller
7a46ccff00 contrib/rpm: add "00-server-dhcp-client-id.conf"
While this is packaged in "NetworkManager-config-server.rpm"
sub-package, it's not in "00-server.conf" file. The reason
is that a convenient way to disable configuration from
"/usr/lib/NetworkManager/conf.d", is by putting a (possibly empty)
file into /etc directory with the same name. If the sub-package
only provides one large "00-server.conf" file, this is no longer
possible at a granular level.
2018-11-01 11:17:12 +01:00
Thomas Haller
f8fed7dd52 checkpatch: complain about XXX markers in code
We have a few source code tags like "TODO" and "FIXME".
"XXX" is not intended to be merged, it is for marking
places in code while still working on it.
2018-10-25 11:20:10 +02:00
Thomas Haller
b660a41c7c build: fix build_clean.sh script to enable ibft
autotools build has/had a bug, where ibft test files would only be disted
if the ibft plugin was enabled.

Regardless of that, `build_clean.sh --release` is our suggested way to
create a release tarball. It should always enable the ibft plugin.

It didn't do so, due to a bug.
2018-10-24 21:43:17 +02:00
Thomas Haller
6978558e8c contrib: adjust NM-log for changes to platform logging
Fixes: 8f107f5c00
2018-10-23 12:03:59 +02:00
Thomas Haller
301d703bc3 checkpatch: quote variable in "checkpatch-feature-branch.sh" 2018-10-22 18:21:41 +02:00
Thomas Haller
669bd33022 contrib/rpm: don't depend NetworkManager-ovs package on openvswitch on RHEL
On RHEL, openvswitch package is not in the base set of packages. Hence,
we cannot depend NetworkManager-ovs package on openvswitch.

This isn't really a problem, because NetworkManager's OVS plugin must
anyway behave graceful when openvswich service is not running or not
available. It only means, that a user who wants to use the OVS plugin
needs to explicitly install the openvswitch package.

https://bugzilla.redhat.com/show_bug.cgi?id=1629178
https://bugzilla.redhat.com/show_bug.cgi?id=1633190
2018-10-22 16:34:51 +02:00
Thomas Haller
924a895a1a checkpatch: support ranges for "checkpatch-feature-branch.sh"
Improve "checkpatch-feature-branch.sh" to support accepting
range as argument.
2018-10-22 14:09:47 +02:00
Thomas Haller
4543785438 checkpatch: fix "checkpatch-feature-branch.sh" for master branch
The main purpose of "checkpatch-feature-branch.sh" is to test all
patches of a feature branch. When we run the script against master
(or nm-1-*), then there is no feature branch.

Previously, the script would just error out.

That is not very useful, in particular as we call this from gitlab-ci,
which also runs on master.

Instead, in that case, test the HEAD.
2018-10-22 13:35:20 +02:00
Thomas Haller
369446eae6 checkpatch: add "contrib/scripts/checkpatch-feature-branch.sh" script
This takes current HEAD branch, and finds all the commits what
are not on master or one of the nm-1-* branches, and runs
checkpatch.pl on each.

The use is to run checkpatch.pl on all patches of a feature
branch.
2018-10-22 13:19:15 +02:00
Thomas Haller
a487d34fc4 contrib: make "contrib/fedora/REQUIRED_PACKAGES" executable script
It will be called by .gitlab-ci.yml to install the packages.
2018-10-22 13:19:15 +02:00
Thomas Haller
8221f824f3 checkpatch: complain about Emacs file variables in source code 2018-10-18 12:16:55 +02:00
Michael Biebl
90f71c0f99 systemd: don't make NetworkManager D-Bus activatable
If the NetworkManager daemon has been stopped manually we don't want it
to be autostarted by a client request.

[lkundrak@v3.sk: The auto-activation is probably more surprising than useful.
Services that need NetworkManager API should depend on NetworkManager service
directly.

I have no idea what purpose does the D-Bus service file serve nowadays,
but it looks rather hacky (really, activating /bin/false) and the comment
in it suggests that the autoactivating behavior was not intended anyway.
Debian has been shipping this for quite some time and no complains have been
heard.]

https://github.com/NetworkManager/NetworkManager/pull/230
2018-10-12 12:54:02 +02:00
Lubomir Rintel
0d3c6072f5 contrib/checkpatch: remove the first character off a diff
Otherwise the leading whitespace checks won't work on patches.
2018-10-07 15:46:02 +02:00
Lubomir Rintel
587f006690 contrib/checkpatch: check some more whitespace trouble 2018-10-07 15:46:02 +02:00