Page MenuHomePhabricator

scripts: add checks for minimum required OS versions
ClosedPublic

Authored by PiRK on Apr 27 2023, 08:22.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCdfa86a8c85de: scripts: add checks for minimum required OS versions
Summary

scripts: LIEF 0.11.5

https://github.com/lief-project/LIEF/blob/551ede538abeca63a158bd7c42b6b6337c92a26e/doc/sphinx/changelog.rst#L20-L21

:MachO:
  * Fix error on property :attr:`lief.MachO.BuildVersion.sdk` (see :issue:`533`)

scripts: check minimum required macOS vesion is set

We use a compile flag (-mmacosx-version-min) to set the minimum required
version of macOS needed to run our binaries. This adds a sanity check
that the version is being set as expected.

scripts: check minimum required Windows version is set

We use linker flags (-Wl,--major/minor-subsystem-version) to set the
minimum required version of Windows needed to run our binaries. This
adds a sanity check that the version is being set as expected.

scripts: check macOS SDK version is set

Clangs Darwin driver should infer the SDK version used during compilation, and
forward that through to the linker. Add a check that this has been done, and the
expected SDK version is set.

Should help prevent issues like #21771 in future.

scripts: more robustly test macOS symbol checks

build: enforce minimum required Windows version (7)

This is a backport of core#21871, core#18956 and a partial backport of core#22381
https://github.com/bitcoin/bitcoin/pull/22381/commits/1946b5f77cb5a6bb37500252079c3582cac4a6c9

Test Plan

gitian-win gitian-osx

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Apr 27 2023, 08:22

@bot gitian-win gitian-osx gitian-linux

Tail of the build log:

 * [new tag]             phabricator/diff/39863 -> phabricator/diff/39863
 * [new tag]             phabricator/diff/39865 -> phabricator/diff/39865
 * [new tag]             phabricator/diff/39866 -> phabricator/diff/39866
 * [new tag]             phabricator/diff/39868 -> phabricator/diff/39868
 * [new tag]             phabricator/diff/39869 -> phabricator/diff/39869
 * [new tag]             phabricator/diff/39871 -> phabricator/diff/39871
 * [new tag]             phabricator/diff/39880 -> phabricator/diff/39880
 * [new tag]             phabricator/diff/39881 -> phabricator/diff/39881
 * [new tag]             phabricator/diff/39885 -> phabricator/diff/39885
 * [new tag]             phabricator/diff/39886 -> phabricator/diff/39886
 * [new tag]             phabricator/diff/39891 -> phabricator/diff/39891
 * [new tag]             phabricator/diff/39903 -> phabricator/diff/39903
 * [new tag]             phabricator/diff/39904 -> phabricator/diff/39904
 * [new tag]             phabricator/diff/39905 -> phabricator/diff/39905
 * [new tag]             phabricator/diff/39914 -> phabricator/diff/39914
 * [new tag]             phabricator/diff/39921 -> phabricator/diff/39921
 * [new tag]             phabricator/diff/39925 -> phabricator/diff/39925
 * [new tag]             phabricator/diff/39926 -> phabricator/diff/39926
 * [new tag]             phabricator/diff/39928 -> phabricator/diff/39928
 * [new tag]             phabricator/diff/39929 -> phabricator/diff/39929
 * [new tag]             phabricator/diff/39945 -> phabricator/diff/39945
 * [new tag]             phabricator/diff/39947 -> phabricator/diff/39947
 * [new tag]             phabricator/diff/39957 -> phabricator/diff/39957
 * [new tag]             phabricator/diff/39958 -> phabricator/diff/39958
 * [new tag]             phabricator/diff/39959 -> phabricator/diff/39959
 * [new tag]             phabricator/diff/39963 -> phabricator/diff/39963
 * [new tag]             phabricator/diff/39970 -> phabricator/diff/39970
 * [new tag]             phabricator/diff/39971 -> phabricator/diff/39971
 * [new tag]             phabricator/diff/39972 -> phabricator/diff/39972
 * [new tag]             phabricator/diff/39974 -> phabricator/diff/39974
 * [new tag]             phabricator/diff/39977 -> phabricator/diff/39977
 * [new tag]             phabricator/diff/39982 -> phabricator/diff/39982
 * [new tag]             phabricator/diff/39984 -> phabricator/diff/39984
 * [new tag]             phabricator/diff/39987 -> phabricator/diff/39987
 * [new tag]             phabricator/diff/40009 -> phabricator/diff/40009
 * [new tag]             phabricator/diff/8992  -> phabricator/diff/8992
 * [new tag]             phabricator/diff/8993  -> phabricator/diff/8993
 * [new branch]          master                 -> master
--- Building for bullseye amd64 ---
Stopping target if it is up
Error response from daemon: No such container: gitian-target
Error: No such container: gitian-target
Making a new image copy
Starting target
Checking if target is up.
Preparing build environment
Updating apt-get repository (log in var/install.log)
Installing additional packages (log in var/install.log)
Upgrading system, may take a while (log in var/install.log)
Creating package manifest
Creating build script (var/build-script)
Running build script (log in var/build.log)
./bin/gbuild:23:in `system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError)
	from ./bin/gbuild:185:in `build_one_configuration'
	from ./bin/gbuild:339:in `block (2 levels) in <main>'
	from ./bin/gbuild:334:in `each'
	from ./bin/gbuild:334:in `block in <main>'
	from ./bin/gbuild:332:in `each'
	from ./bin/gbuild:332:in `<main>'
Build gitian-win failed with exit code 1

Tail of the build log:

 * [new tag]             phabricator/diff/39802 -> phabricator/diff/39802
 * [new tag]             phabricator/diff/39803 -> phabricator/diff/39803
 * [new tag]             phabricator/diff/39804 -> phabricator/diff/39804
 * [new tag]             phabricator/diff/39805 -> phabricator/diff/39805
 * [new tag]             phabricator/diff/39806 -> phabricator/diff/39806
 * [new tag]             phabricator/diff/39813 -> phabricator/diff/39813
 * [new tag]             phabricator/diff/39815 -> phabricator/diff/39815
 * [new tag]             phabricator/diff/39817 -> phabricator/diff/39817
 * [new tag]             phabricator/diff/39822 -> phabricator/diff/39822
 * [new tag]             phabricator/diff/39832 -> phabricator/diff/39832
 * [new tag]             phabricator/diff/39843 -> phabricator/diff/39843
 * [new tag]             phabricator/diff/39845 -> phabricator/diff/39845
 * [new tag]             phabricator/diff/39846 -> phabricator/diff/39846
 * [new tag]             phabricator/diff/39853 -> phabricator/diff/39853
 * [new tag]             phabricator/diff/39865 -> phabricator/diff/39865
 * [new tag]             phabricator/diff/39868 -> phabricator/diff/39868
 * [new tag]             phabricator/diff/39869 -> phabricator/diff/39869
 * [new tag]             phabricator/diff/39871 -> phabricator/diff/39871
 * [new tag]             phabricator/diff/39889 -> phabricator/diff/39889
 * [new tag]             phabricator/diff/39903 -> phabricator/diff/39903
 * [new tag]             phabricator/diff/39904 -> phabricator/diff/39904
 * [new tag]             phabricator/diff/39905 -> phabricator/diff/39905
 * [new tag]             phabricator/diff/39908 -> phabricator/diff/39908
 * [new tag]             phabricator/diff/39918 -> phabricator/diff/39918
 * [new tag]             phabricator/diff/39926 -> phabricator/diff/39926
 * [new tag]             phabricator/diff/39936 -> phabricator/diff/39936
 * [new tag]             phabricator/diff/39945 -> phabricator/diff/39945
 * [new tag]             phabricator/diff/39947 -> phabricator/diff/39947
 * [new tag]             phabricator/diff/39958 -> phabricator/diff/39958
 * [new tag]             phabricator/diff/39959 -> phabricator/diff/39959
 * [new tag]             phabricator/diff/39963 -> phabricator/diff/39963
 * [new tag]             phabricator/diff/39982 -> phabricator/diff/39982
 * [new tag]             phabricator/diff/39983 -> phabricator/diff/39983
 * [new tag]             phabricator/diff/39986 -> phabricator/diff/39986
 * [new tag]             phabricator/diff/40009 -> phabricator/diff/40009
 * [new tag]             phabricator/diff/8992  -> phabricator/diff/8992
 * [new tag]             phabricator/diff/8993  -> phabricator/diff/8993
 * [new branch]          master                 -> master
--- Building for bullseye amd64 ---
Stopping target if it is up
Error response from daemon: No such container: gitian-target
Error: No such container: gitian-target
Making a new image copy
Starting target
Checking if target is up.
Preparing build environment
Updating apt-get repository (log in var/install.log)
Installing additional packages (log in var/install.log)
Upgrading system, may take a while (log in var/install.log)
Creating package manifest
Creating build script (var/build-script)
Running build script (log in var/build.log)
./bin/gbuild:23:in `system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError)
	from ./bin/gbuild:185:in `build_one_configuration'
	from ./bin/gbuild:339:in `block (2 levels) in <main>'
	from ./bin/gbuild:334:in `each'
	from ./bin/gbuild:334:in `block in <main>'
	from ./bin/gbuild:332:in `each'
	from ./bin/gbuild:332:in `<main>'
Build gitian-osx failed with exit code 1
PiRK edited the summary of this revision. (Show Details)

enforce also minimum windows version (core#18956)

@bot build-win64 gitian-win

Fabien requested changes to this revision.Apr 27 2023, 13:20
Fabien added a subscriber: Fabien.

Please also bump lief in install-dependencies-bullseye.sh

contrib/devtools/symbol-check.py
221 ↗(On Diff #40013)

Macro likestamp:

This revision now requires changes to proceed.Apr 27 2023, 13:20

bump lief also in install-dependencies_bullseye, rebase

This revision is now accepted and ready to land.Apr 27 2023, 13:45