roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.06k stars 213 forks source link

Rework scons install target #316

Open gavv opened 4 years ago

gavv commented 4 years ago

Last revised: Oct 2023

Problem

Current scons install implementation has a problem: scons install should be called with exactly same options and arguments as scons was invoked earlier when building the project.

Example from our cookbook:

# build libraries and tools
$ scons -Q --build-3rdparty=libuv,libatomic_ops,openfec

# install libraries and tools
$ sudo scons -Q --build-3rdparty=libuv,libatomic_ops,openfec install

The second scons invocation can't be just sudo scons install. It should also have --enable-pulseaudio-modules --build-3rdparty=openfec,pulseaudio because these options were present in the first scons invocation.

The reason is that internally, scons install creates an install target which depends on the build target, and the build target properties are defined by scons options and arguments. If you call scons install with options, it'll decide that the build target is not up-to-date, since it was previously built with other properties, and will try to rebuild it, with empty options (and will likely fail or at least build something other than the user wants).

Solution

Rework scons install implementation:

This way, scons install will just install results of the last build, without trying to build anything by itself.

Additional changes

We should also update our user cookbook after implementing this.

It would be nice to add scons install to our CI scripts. Currently this functionality is not covered by CI.

Info

Search for "AddDistFile" and "AddDistAction" in the source code.

Unfortunately, our scons internal are not documented. Discussions in PR #347 may give some hints.