Skip to content

Conversation

@pavlix
Copy link
Contributor

@pavlix pavlix commented Jan 3, 2018

I know we were talking about keeping the NetworkManager --run-from-build-dir option but right now it feels much easier to just use ./autogen.sh --enable-develop and have the feature cleanly applied just to the development build and nowhere else.

This way we can try to keep devel builds safe from loading system NetworkManager libraries and plugins and at the same time the system build doesn't get polluted by code that only applies to the build directory.

I propose to merge this pull request now because it's extremely useful to have the feature in master and thus be able to build branches in develop mode immediately. We can reconsider the approach later if needed.

pavlix added 4 commits January 3, 2018 22:46
It used to be possible to successfully run NetworkManager from the build
directory at least using `--run-from-build-dir`. The code is relatively
complicated for that simple task and doesn't even achieve the results.

For example the path to device plugins is hardcoded and the actual device
plugins are in their own different build directories. There is no trivial
way to fix that.

In future we should probably implement running from build directory using a
set of environment variables with search paths and other tweaks together
with `NetworkManager` and `nmcli` shell wrappers that would make it all
work. In addition to plugin and helper search paths there appears to be a
problem with the dbus and polkit configurations in the running system. This
seems to be a drawback related to the usage of D-Bus for all communication.
In some cases we might want to load device plugins from multiple
directories. A special case that I have in mind is to load plugins from
build directory subdirectories in order to run NetworkManager from the
build directory.
Many of the configured directories default to being defined using existing
directory configuration. As a result you usually don't see the actual
directories that will be used. With the added directories you can at least
assemble the information and thus see which directories will be used.
The combination of `./develop.sh` for bootstrap and configuration and the
`./NetworkManager` and `./nmcli` makes it easy to build NetworkManager and
then run it from the build directory.
@thom311
Copy link
Collaborator

thom311 commented Jan 10, 2018

I merged two patches from the branch to master (96658d2).
It needed some trivial adjustments.

There are two patches left:

  • remove --run-from-build-dir option from NetworkManager
  • development: make it possible to run NetworkManager from build directory

I am not convinced about a compile time option. Changing a configure option is cumbersome, because it requires rebuild most of the code. Also, you effectively cannot make install such a build. How about:

  • keep --run-from-build-dir option. All the decisions that are done with #if DEVELOP can also be made at runtime, with a global variable nm_global_option_run_from_build_dir.
  • additionally, only enable --run-from-build-dir and nm_global_option_run_from_build_dir when compiling --with-more-asserts. That means, guard it with #if NM_MORE_ASSERTS. I think it makes sense that if you don't do a devel build, you can also not run from the build directory. That especially applies when the NM binary is installed. At that point, the option makes no more sense and will not be present in release builds (--without-more-asserts).

@thom311
Copy link
Collaborator

thom311 commented Feb 9, 2018

As I said, I think the remaining two patches need some rework.

I am closing this pull request for now, please re-open, if there is anything new. Thank you!

@thom311 thom311 closed this Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants