Repository navigation
fix: a library with a runtime of its own keeps it on Linux and FreeBSD (#3481) - #3482
Closed
nicolas-maman wants to merge 2 commits into
Closed
nicolas-maman wants to merge 2 commits into
nicolas-maman wants to merge 2 commits into
Conversation
…3481) Main's Linux / GCC leg aborts both Aether-consumer cases of the matrix since 0.861.0, and the log shows only "Aborted (core dumped)": run_app sent the program's stderr to app.err and never printed it. A failed case now prints the last lines of what the program wrote there.
5 tasks done
#3481) Main's Linux / GCC leg failed the cross-version ABI matrix since 0.861.0, both Aether-consumer cases aborting. The stderr the previous commit prints: aether: the library was made for Aether runtime 0.860.0/abi1 and runs on 0.863.0/abi1: rebuild it with the Aether of the runtime it runs on aether: panic outside any try/catch or actor: ... An `ae build` program is linked -rdynamic (std.dl and script_gateway plugins resolve runtime symbols against it), so on ELF it exports its runtime, and a library's calls into the runtime it carries bound to the program's instead. The library's code ran on a runtime it was not made for; across versions the runtime ABI check of #2957 says so and refuses, and the importer ended on the panic. Equal versions (0.860.0 against 0.860.0) and a library older than the check (against 0.859.0) passed, which is why it showed only once main moved past the release. macOS (two-level namespace) and Windows (PE) keep the copies apart and pass, and docs/abi-policy.md says a self-contained library carries its own runtime. The owner chose that model for Linux too. So: - ae links a library with a runtime of its own -Bsymbolic on ELF: its references bind to what it defines, and it still exports them for a C host. A --shared-runtime library defines no runtime and is unchanged. - The import refusal of what needs one runtime (a struct holding strings, a builder using its config, #2931) and the warning that a library's actors are not drained at exit apply on every platform; both name --shared-runtime, as on macOS and Windows. - A library of another runtime ABI linked before this (no DT_SYMBOLIC or DF_SYMBOLIC in its dynamic section, read from the file) is refused at import on ELF, naming the rebuild, instead of ending the program on its first call. The reader was checked on x86_64, aarch64 and 32-bit ARM libraries built with and without -Bsymbolic. Tests: the ABI matrix checks that this ae links SYMBOLIC on ELF, expects the refusal for an old library linked without it, and still runs the old importer with this library (which now keeps its own runtime); binary_import_actors, binary_import_ownership, binary_import_structs and sandbox_nested_libraries expect on Linux and FreeBSD what they expected on macOS and Windows. Docs: emit-lib.md, abi-policy.md and ownership-model.md. Checked here: ae builds with -Werror on Windows and compiles for x86_64 Linux with zig (-Wall -Wextra -Werror); the scripts parse. Linux and FreeBSD behaviour is CI's to show.
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main's Linux / GCC leg has failed the cross-version ABI matrix since the 0.861.0 release (#3481), so every PR is red there. This fixes it with the model the owner chose: a library that carries its own runtime keeps it on Linux and FreeBSD, as it already does on macOS and Windows.
What was wrong
The first commit makes the matrix print an Aether consumer's stderr on failure, which showed:
The chain:
ae buildlinks a program-rdynamic, because plugins loaded through std.dl and script_gateway resolve runtime symbols against it. On ELF the program therefore exports its runtime.It surfaced only when two runtimes that both have the check met with different versions:
The fix
aelinks a library with its own runtime-Bsymbolic, so its references bind to its own definitions. It still exports them, for a C host. A--shared-runtimelibrary is unchanged.aedid only on macOS and Windows now apply everywhere, both naming--shared-runtime: refusing an import that needs one runtime (a struct holding strings, a builder that uses its config, A string an --emit=lib export returns is never released (C hosts and binary imports) #2931), and warning that a library's actors are not drained at exit.-Bsymbolicis refused at import, naming the rebuild, instead of the program ending on its first call. The flag is read from the file's dynamic section (DT_SYMBOLIC, orDF_SYMBOLICinDT_FLAGS). The reader was checked on x86_64, aarch64 and 32-bit ARM libraries built with and without-Bsymbolic.What changes for Linux and FreeBSD users:
catch.--shared-runtimegives one runtime, as it already does on macOS and Windows.Tests
aelinks SYMBOLIC on ELF (it fails on main);Checked locally on Windows (there is no ELF machine here):
aebuilds with-Werror;-Wall -Wextra -Werror);CI shows Linux and FreeBSD.
Closes #3481