kernel: Remove redundant check of initial code path#11350
Open
ausimian wants to merge 1 commit into
Open
Conversation
Contributor
CT Test Results 2 files 74 suites 1h 10m 17s ⏱️ For more details on these failures, see this check. Results for commit 4ffd26b. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
65bbb8d to
65e0aa6
Compare
The initial application code path is built by make_path/2, which already checks generated ebin directories. Reuse that path in add_loader_path/2 rather than validating it a second time during code server startup.
65e0aa6 to
4ffd26b
Compare
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.
Description
When the code server starts in interactive mode, it builds the initial
code path before calling
add_loader_path/2:$ROOT/libentries, produced bymake_path/2ERL_LIBSentries, also produced bymake_path/2(filtered toebindirectories)
"."Every entry emitted by
make_path/2has already passed anis_dir/1check — either the application's
ebindirectory or an archive fallbackchosen by
try_ebin_dirs/1— and bundles without a usable directory aredropped.
add_loader_path/2nevertheless ranpatch_path/1over thislist, validating each entry a second time during startup.
That second pass cannot change the list: entries that exist are kept
as-is, and the trailing
"."is kept in either case becausepatch_path/1returns its input unchanged whencheck_path/1fails. Inembedded mode the initial path is empty. This change uses the initial
path as built instead of validating it again.
Testing
code_SUITEpasses (57/57) with the change.code:get_path()is as expected on a patched build:ERL_LIBSapplications are present and"."remains the last entry.(x86_64, Ubuntu 24.04).