Skip to content
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

Eliminate use of experimental function code:lib_dir/2 #2866

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Feb 22, 2024

The code:lib_dir/2 function was introduced to support looking into archives. Both archives and the code:lib_dir/2 are marked as experimental.

In the upcoming Erlang/OTP 27 release, code:lib_dir/2 will be deprecated. In some future release, the archive functionality will be changed (escript:extract/2 will continue to work, reading archive members using erl_prim_loader will not).

The `code:lib_dir/2` function was introduced to support looking
into archives. Both archives and the `code:lib_dir/2` are marked
as experimental.

In the upcoming Erlang/OTP 27 release, `code:lib_dir/2` will be
deprecated. In some future release, the archive functionality will
be changed (`escript:extract/2` will continue to work, reading archive
members using `erl_prim_loader` will not).
Copy link
Collaborator

@ferd ferd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No chance that we have a valid lib_dir without a valid ebin/ within it right? the .app file has to be there to be added to lib_dir in the first place, so no harm or no extra validation needing to switch places?

@bjorng
Copy link
Contributor Author

bjorng commented Feb 22, 2024

No chance that we have a valid lib_dir without a valid ebin/ within it right? the .app file has to be there to be added to lib_dir in the first place, so no harm or no extra validation needing to switch places?

code_lib:dir/2 does not validate its second argument, so as far as I understand, this change does not remove any validation. Example:

1> code:lib_dir(compiler, nonexisting).
"/usr/local/lib/erlang/lib/compiler-8.4.1/nonexisting"

@ferd
Copy link
Collaborator

ferd commented Feb 22, 2024

Perfect, thanks!

@ferd ferd merged commit 17f6861 into erlang:main Feb 22, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants