-
Notifications
You must be signed in to change notification settings - Fork 37.7k
scripts: add checks for minimum required OS versions #21871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Concep ACK. Was working on similar preventing #21771 right now :) |
8774070
to
c14211c
Compare
Updated to fix a typo, and address the CI failure. |
Are we going to wait for LIEF 0.12 with a fix, or macOS SDK version check could be added in a separated PR? |
I've just added one here. Apparently LIEF 0.12 wont be released until September / October. |
https://cirrus-ci.com/task/5407569322704896?logs=lint#L855:
|
How about to check the solely --- a/contrib/devtools/test-symbol-check.py
+++ b/contrib/devtools/test-symbol-check.py
@@ -142,6 +142,19 @@ class TestSymbolChecks(unittest.TestCase):
self.assertEqual(call_symbol_check(cc, source, executable, ['-mmacosx-version-min=10.14', '-Wl,-platform_version', '-Wl,macos', '-Wl,10.14', '-Wl,10.15.6']),
(0, ''))
+ source = 'test5.c'
+ executable = 'test5'
+ with open(source, 'w', encoding="utf8") as f:
+ f.write('''
+ int main()
+ {
+ return 0;
+ }
+ ''')
+
+ self.assertEqual(call_symbol_check(cc, source, executable, ['-mmacosx-version-min=10.14', '-Wl,-platform_version', '-Wl,macos', '-Wl,10.15.6', '-Wl,10.15.6']),
+ (1, executable + ': failed MIN_OS'))
+
def test_PE(self):
source = 'test1.c'
executable = 'test1.exe' ? |
Maybe add a test for the |
|
ae6a06d
to
af717c1
Compare
Addressed.
There is some overlap between the
Added a test for this. |
Assuming that At least #20980 allows to After rebasing this PR on top of #20980 getting an error:
|
The fix is included in LIEF 0.11.5.
|
af717c1
to
f015e1c
Compare
Well, not an error, but changed behavior: |
I understand. I'm asking is what is the underlying cause of the failure. I assume it's the compiler/linker not accepting some of the newly added flags. |
From #bitcoin-builds channel on 2021-03-13:
|
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.
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.
f015e1c
to
763437b
Compare
I've removed the macOS SDK check from test-security-check. I don't think it adds much value, and given we don't control the SDK version being used in the CI, we can't necessarily test for/using the same SDK version we expect in our binaries. |
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 bitcoin#21771 in future.
763437b
to
aa80b57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK aa80b57, tested by breaking tests:
- macOS changes -- on macOS Big Sur 11.4 (20F71)
- Windows changes -- on Linux Mint 20.1 (x86_64) with providing
CC
like
$ CC=x86_64-w64-mingw32-gcc contrib/devtools/test-symbol-check.py TestSymbolChecks.test_PE
Concept ACK |
…ions aa80b57 scripts: check macOS SDK version is set (fanquake) c972345 scripts: check minimum required Windows version is set (fanquake) 29615ae scripts: check minimum required macOS vesion is set (fanquake) 8732f7b scripts: LIEF 0.11.5 (fanquake) Pull request description: macOS: We use a compile flag ([-mmacosx-version-min=10.14](https://github.com/bitcoin/bitcoin/blob/master/depends/hosts/darwin.mk#L96)) 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. 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 bitcoin#21771 in future. Windows: We use linker flags ([-Wl,--major/minor-subsystem-version](https://github.com/bitcoin/bitcoin/blob/master/configure.ac#L683)) 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. Gitian builds: ```bash # macOS: 8b6fcd61d75001c37b2af3fceb5ae09f5d2fe85e97d361f684214bd91c27954a bitcoin-f015e1c2cac9-osx-unsigned.dmg 3c1e412bc7f5a7a5d0f78e2cd84b7096831414e1304c1307211aa3e135d89bbf bitcoin-f015e1c2cac9-osx-unsigned.tar.gz 50b7b2804e8481f63c69c78e3e8a71c0d811bf2db8895dd6d3edae9c46a738ae bitcoin-f015e1c2cac9-osx64.tar.gz fe6b5c0a550096b76b6727efee30e85b60163a41c83f21868c849fdd9876b675 src/bitcoin-f015e1c2cac9.tar.gz 8a20f21b20673dfc8c23e22b20ae0839bcaf65bf0e02f62381cdf5e7922936f0 bitcoin-core-osx-22-res.yml # Windows: b01fcdc2a5673387050d6c6c4f96f1d350976a121155fde3f76c2af309111f9d bitcoin-f015e1c2cac9-win-unsigned.tar.gz b95bdcbef638804030671d2332d58011f8c4ed4c1db87d6ffd211515c32c9d02 bitcoin-f015e1c2cac9-win64-debug.zip 350bf180252d24a3d40f05e22398fec7bb00e06d812204eb5a421100a8e10638 bitcoin-f015e1c2cac9-win64-setup-unsigned.exe 2730ddabe246d99913c9a779e97edcadb2d55309933d46f1dffd0d23ecf9aae5 bitcoin-f015e1c2cac9-win64.zip fe6b5c0a550096b76b6727efee30e85b60163a41c83f21868c849fdd9876b675 src/bitcoin-f015e1c2cac9.tar.gz aa60d7a753e8cb2d4323cfbbf4d964ad3645e74c918cccd66862888f8646d80f bitcoin-core-win-22-res.yml ``` ACKs for top commit: hebasto: ACK aa80b57, tested by breaking tests: Tree-SHA512: 10150219910e8131715fbfe20edaa15778387616ef3bfe1a5152c7acd3958fe8f88c74961c3d3641074eb72824680c22764bb1dc01a19e92e946c2d4962a8d2c
macOS:
We use a compile flag (-mmacosx-version-min=10.14) 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.
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.
Windows:
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.
Gitian builds: