Simplify scripts for static executables
(this MR is based on !6803 (merged))
Context
Static executables are currently built with dune build --profile static $packages
followed by dune install $packages
, where $packages
is the contents of script-inputs/static-binaries
. This has some drawbacks:
-
script-inputs/static-binaries
is redundant withscript-inputs/binaries-for-release
- if a package of
script-inputs/static-binaries
contains unreleased executables, they will be published - it's redundant with
PROFILE=static make
This MR simplifies the scripts that build static executables. It:
- removes
script-inputs/static-binaries
- introduces
make static
, equivalent toPROFILE=static make
- uses
make static
to build executables (this callsdune build --profile static
on executables directly instead of packages, and there is no need to rundune install
, as far as I know)
This solves the aforementioned drawbacks.
However, one issue is that script-inputs/binaries-for-releases
does not contain experimental executables, and we do want to build static versions of experimental executables for master
pipelines and for merge request pipelines. So this MR also:
- renames
script-inputs/binaries-for-release
intoscript-inputs/released-executables
- adds
script-inputs/experimental-executables
- tweaks the CI to specify which set of executables to use depending on the pipeline
Manually testing the MR
Check the CI. You can download static executables in the static build job artefacts and check that they are statically linked, and that they run.
To check a release pipeline, you can push a version tag to nomadic-labs/tezos
. See for instance https://gitlab.com/nomadic-labs/tezos/-/pipelines/702277031 (the last job failed because a release for this version number already exists so that's expected).
You can also try to run the build_static_binaries.sh
script yourself, but if you use Debian or Ubuntu you probably do not have the right system dependencies. Instead, you can use Docker:
# run this from the tezos repository root
source scripts/version.sh
docker run --entrypoint /bin/sh -it \
--mount type=bind,source=$PWD,destination=/home/tezos/host
registry.gitlab.com/tezos/opam-repository:runtime-build-test-dependencies--$opam_repository_tag
# run this inside Docker
cd host
ARCH=x86_64 EXECUTABLE_FILES='script-inputs/released-executables script-inputs/experimental-executables' scripts/ci/build_static_binaries.sh
This should produce files in octez-binaries/x86_64
.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR