-
Notifications
You must be signed in to change notification settings - Fork 19
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
[easy][antlir][oss] fix distro toolchain on oss #274
Closed
Closed
Conversation
This file contains 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
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Jan 3, 2025
This pull request was exported from Phabricator. Differential Revision: D67799115 |
facebook-github-bot
force-pushed
the
export-D67799115
branch
from
January 3, 2025 18:54
01e339c
to
7adf36c
Compare
This pull request was exported from Phabricator. Differential Revision: D67799115 |
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 3, 2025
Summary: The default code for this in the prelude https://www.internalfb.com/code/fbsource/[d9e5d887126868e28dd50b8911721d351f73a38a]/fbcode/buck2/prelude/cxx/cxx_toolchain_macro_layer.bzl?lines=13-19 https://github.com/facebook/buck2/blob/main/prelude/cxx/cxx_toolchain_macro_layer.bzl#L13-L19 relies on config settings that do not exist in the opensource prelude Test Plan: Export to PR Reviewed By: sergeyfd Differential Revision: D67799115
facebook-github-bot
force-pushed
the
export-D67799115
branch
from
January 3, 2025 19:04
7adf36c
to
60aa826
Compare
This pull request was exported from Phabricator. Differential Revision: D67799115 |
Summary: The complicated part of `unshare_userns` involves two `fork()`s with logic in between the `fork()` and `exec()` in the child process. This comes with a bunch of rules, the most annoying being no safe way to allocate memory. Previously, I tried to "enforce" this by making the Rust crate `#![no_std]`, but in fbcode, `std` is always unconditionally added as a buck2 dependency, so there was nothing preventing `std` from being used (and thus, lots of things that can do dynamic memory allocations). `std` usage was accidentally introduced in D67157487. To prevent this from happening again, to properly enforce these constraints, and to fix the OSS build, I am rewriting the post-`fork()` logic in C. This is a direct translation of the Rust code, which was already very C-like do to the low-level syscalls being done. Test Plan: ``` ❯ buck2 test fbcode//antlir/antlir2/features/user/tests: fbcode//antlir/antlir2/features/install/tests: Buck UI: https://www.internalfb.com/buck2/db4a7f57-d8a5-41d5-861c-4508eb80410a Test UI: https://www.internalfb.com/intern/testinfra/testrun/5910974770074096 Tests finished: Pass 39. Fail 0. Fatal 0. Skip 0. Build failure 0 ❯ buck2 test -c antlir2.rootless=1 fbcode//antlir/antlir2/features/user/tests: fbcode//antlir/antlir2/features/install/tests: Buck UI: https://www.internalfb.com/buck2/ad2d4e89-d6ab-435c-a0a5-519560f52a3b Test UI: https://www.internalfb.com/intern/testinfra/testrun/3659174958492970 Tests finished: Pass 39. Fail 0. Fatal 0. Skip 0. Build failure 0 ``` Differential Revision: D67803947
Summary: Pull Request resolved: #274 The default code for this in the prelude https://www.internalfb.com/code/fbsource/[d9e5d887126868e28dd50b8911721d351f73a38a]/fbcode/buck2/prelude/cxx/cxx_toolchain_macro_layer.bzl?lines=13-19 https://github.com/facebook/buck2/blob/main/prelude/cxx/cxx_toolchain_macro_layer.bzl#L13-L19 relies on config settings that do not exist in the opensource prelude Test Plan: Export to PR Reviewed By: sergeyfd Differential Revision: D67799115
This pull request was exported from Phabricator. Differential Revision: D67799115 |
vmagro
force-pushed
the
export-D67799115
branch
from
January 6, 2025 16:26
60aa826
to
b874997
Compare
This pull request has been merged in 208b68c. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
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.
Summary:
The default code for this in the prelude
https://www.internalfb.com/code/fbsource/[d9e5d887126868e28dd50b8911721d351f73a38a]/fbcode/buck2/prelude/cxx/cxx_toolchain_macro_layer.bzl?lines=13-19
https://github.com/facebook/buck2/blob/main/prelude/cxx/cxx_toolchain_macro_layer.bzl#L13-L19
relies on config settings that do not exist in the opensource prelude
Test Plan: Export to PR
Differential Revision: D67799115