[build2] Disabling rpath linking for all update operations

Boris Kolpackov boris at codesynthesis.com
Mon Mar 25 14:32:54 UTC 2019


Matthew Krupcale <mkrupcale at matthewkrupcale.com> writes:

> Fedora build specifications divide the build process into several blocks,
> executed sequentially as %build, %install, and %check. Thus, if we `b
> configure:` and perform `b update:` during %build, the binaries are linked
> with rpath. Then, in %install we perform `b install:`, and now the targets
> must be re-linked without rpath. Finally, in %check we perform `b test:` and
> again the targets are re-linked this time again with rpath.

Actually, I think build2 fits this workflow pretty well. Firstly, instead
of the `update` operation you can use `update-for-install`. Then, for
testing, you would want to configure the tests/ subproject to run against
what's been installed. In other words (using build2 as an example):

b configure:          build2/
b update-for-install: build2/build2/               # Don't build tests/.
b install:            build2/
b configure:          build2/tests/@build2-tests/
b update:             build2-tests/
b test:               build2-tests/

If you also want to run unit tests (the tests/ subproject contains
integration tests), then this will become:

b configure:          build2/
b update:             build2/build2/
b test:               build2/build2/               # Run unit tests.
b update-for-install: build2/build2/               # Relink without rpath.
b install:            build2/
b configure:          build2/tests/@build2-tests/
b update:             build2-tests/
b test:               build2-tests/                # Run integration tests.


> I haven't spent much time thinking about this, but it seems like
> this might be as simple as hijacking the final `bool` argument to
> `rpath_libraries` in `cc::link_rule::perform_update`[3] and adding a
> user-configurable variable to disable this for all operations.

Yes, it does look like this will do the trick (in particular, we probably
still want -rpath-link). I was initially thinking of overloading
config.bin.rpath=false but I now realize that's not a good idea: one
may want to disable this "automatic dependency rpath" but still have
the custom ones.

Even if the above approach (update-for-install plus testing installed)
works out for you, we may still want to add this since I am sure someone
else will need it sooner or later.



More information about the users mailing list