-
-
Couldn't load subscription status.
- Fork 233
Add dynamically linked musl distributions #541
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
Changes from 13 commits
9663760
18ff4fc
f156f44
c78bb9b
d590f87
51a5e29
7b2b0f2
2cef305
a173de8
94cadca
7b8ff31
280f345
902fcd0
b60e292
28d5d6e
01172ad
75ff237
d05620a
567768d
fd04e37
88b335b
6b6f103
6f88ed4
c0b9ce9
44c1959
4385eb8
1990014
7153487
4c685db
4670133
c4e081d
c410304
a745841
6a79ece
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,10 +220,10 @@ | |
| "license_file": "LICENSE.mpdecimal.txt", | ||
| }, | ||
| "musl": { | ||
| "url": "https://musl.libc.org/releases/musl-1.2.5.tar.gz", | ||
| "size": 1080786, | ||
| "sha256": "a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4", | ||
| "version": "1.2.5", | ||
| "url": "https://musl.libc.org/releases/musl-1.2.2.tar.gz", | ||
| "size": 1055220, | ||
| "sha256": "9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd", | ||
| "version": "1.2.2", | ||
zanieb marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use an older version for dynamic builds, for compatibility with more systems. For example, the GitHub runners we're using did not have 1.2.5. We retain the latest version for static builds, since compatibility isn't a concern. |
||
| }, | ||
| "ncurses": { | ||
| "url": "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,8 @@ const ELF_ALLOWED_LIBRARIES: &[&str] = &[ | |
| "libpthread.so.0", | ||
| "librt.so.1", | ||
| "libutil.so.1", | ||
| // musl libc | ||
| "libc.so", | ||
|
||
| ]; | ||
|
|
||
| const PE_ALLOWED_LIBRARIES: &[&str] = &[ | ||
|
|
@@ -918,10 +920,7 @@ fn validate_elf<Elf: FileHeader<Endian = Endianness>>( | |
| allowed_libraries.extend(extra.iter().map(|x| x.to_string())); | ||
| } | ||
|
|
||
| allowed_libraries.push(format!( | ||
| "$ORIGIN/../lib/libpython{}.so.1.0", | ||
| python_major_minor | ||
| )); | ||
| allowed_libraries.push(format!("libpython{}.so.1.0", python_major_minor)); | ||
| allowed_libraries.push(format!( | ||
| "$ORIGIN/../lib/libpython{}d.so.1.0", | ||
| python_major_minor | ||
|
|
@@ -935,6 +934,14 @@ fn validate_elf<Elf: FileHeader<Endian = Endianness>>( | |
| python_major_minor | ||
| )); | ||
|
|
||
| // On musl, we don't use `$ORIGIN` | ||
| if target_triple.contains("-musl") { | ||
| allowed_libraries.push(format!("libpython{}.so.1.0", python_major_minor)); | ||
| allowed_libraries.push(format!("libpython{}d.so.1.0", python_major_minor)); | ||
| allowed_libraries.push(format!("libpython{}t.so.1.0", python_major_minor)); | ||
| allowed_libraries.push(format!("libpython{}td.so.1.0", python_major_minor)); | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes from line 921 to here seem a little inconsistent, are all the changes here intentional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh thanks the changes around 924 are confusing? I'll revert that. I can also probably make this bit conditional on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| // Allow the _crypt extension module - and only it - to link against libcrypt, | ||
| // which is no longer universally present in Linux distros. | ||
| if let Some(filename) = path.file_name() { | ||
|
|
@@ -1720,7 +1727,8 @@ fn validate_distribution( | |
|
|
||
| let is_debug = dist_filename.contains("-debug-"); | ||
|
|
||
| let is_static = triple.contains("unknown-linux-musl"); | ||
| // For now, there are now static builds — this is historic | ||
| let is_static = false; | ||
zanieb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| let mut tf = crate::open_distribution_archive(dist_path)?; | ||
|
|
||
|
|
@@ -2074,12 +2082,17 @@ fn verify_distribution_behavior(dist_path: &Path) -> Result<Vec<String>> { | |
| std::fs::write(&test_file, PYTHON_VERIFICATIONS.as_bytes())?; | ||
|
|
||
| eprintln!(" running interpreter tests (output should follow)"); | ||
| let output = duct::cmd(python_exe, [test_file.display().to_string()]) | ||
| let output = duct::cmd(&python_exe, [test_file.display().to_string()]) | ||
| .stdout_to_stderr() | ||
| .unchecked() | ||
| .env("TARGET_TRIPLE", &python_json.target_triple) | ||
| .env("BUILD_OPTIONS", &python_json.build_options) | ||
| .run()?; | ||
| .run() | ||
| .context(format!( | ||
| "Failed to run `{} {}`", | ||
| python_exe.display(), | ||
| test_file.display() | ||
| ))?; | ||
|
|
||
| if !output.status.success() { | ||
| errors.push("errors running interpreter tests".to_string()); | ||
|
|
||
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.
Probably a little overzealous including all these here, but of no real consequence.
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.
I'm assuming we were previously implicitly doing this for musl?
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.
Yes. We were normalizing the triple to gnu beforehand.