This repository was archived by the owner on Feb 25, 2025. It is now read-only.
fuchsia: remove use of replace_as_executable (second try)#17313
Merged
zarvox merged 1 commit intoflutter:masterfrom Mar 25, 2020
Merged
fuchsia: remove use of replace_as_executable (second try)#17313zarvox merged 1 commit intoflutter:masterfrom
zarvox merged 1 commit intoflutter:masterfrom
Conversation
On Fuchsia, we can now get executable VMOs from trusted backing filesystems. This allows us to remove the use of replace_as_executable in favor of opening files with `fdio_open_fd_at` with the `OPEN_RIGHT_EXECUTABLE` flag and getting VMOs by calling `fdio_get_vmo_exec`. By moving the responsibility for executability into the filesystem, we are able to remove `deprecated-ambient-replace-as-executable` from component manifests for non-JIT runners (the JIT runners still call replace_as_executable in Dart's allocator). It wasn't abundantly clear whether .cmx files for tests were used purely in AOT runtime environments or also saw JIT usage, so I left those as-is. For context: this is a second attempt at flutter#16690, which was reverted because it broke the Dart JIT runner. The primary difference is that this time around, we correctly handle absolute vs relative paths, depending on whether library loading bottoms out in `fdio_open_fd` or `fdio_open_fd_at`. I've added additional assertions to help ensure any new usages use the correct shape of path. Testing: I verified locally that the flutter product runner works on Astro, and also successfully ran the Dart JIT example test (which was the thing blocking the google3 roll with the previous attempt at this patchset).
chinmaygarde
approved these changes
Mar 25, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Mar 25, 2020
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This is a second attempt at #16690, which was reverted because it broke the Dart JIT runner. The primary differences are that this time around, we correctly handle absolute vs relative paths, depending on whether library loading bottoms out in
fdio_open_fdorfdio_open_fd_at. I've added additional assertions.On Fuchsia, we can now get executable VMOs from trusted backing
filesystems. This allows us to remove the use of replace_as_executable
in favor of opening files with
fdio_open_fd_atwith theOPEN_RIGHT_EXECUTABLEflag and getting VMOs by callingfdio_get_vmo_exec.By moving the responsibility for executability into the filesystem, we
are able to remove
deprecated-ambient-replace-as-executablefromcomponent manifests for non-JIT runners (the JIT runners still call
replace_as_executable in Dart's allocator). It wasn't abundantly clear
whether .cmx files for tests were used purely in AOT runtime
environments or also saw JIT usage, so I left those as-is.
Testing: I verified locally that the flutter product runner works on
Astro, and also successfully ran the Dart JIT example test (which was
the thing blocking the google3 roll with the previous attempt at this
patchset). If there's any additional pre-flight checks you'd like me to do, let me know!