Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
3641-Don-t-require-compile-time-features-to-be-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3641-Don-t-require-compile-time-features-to-be-enabled-in.patch of Package erlang
From 18807814dbf097faf0b4fb26fa5e13bd6b4bd7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Thu, 9 Feb 2023 10:50:36 +0100 Subject: [PATCH] Don't require compile-time features to be enabled in the runtime Earlier during development of Erlang/OTP 26 we hard-coded the `maybe_expr` feature to be always enable in the runtime system. Remove that hack and no longer require any compile-time feature to be enabled in the runtime system. --- erts/preloaded/ebin/erlang.beam | Bin 133156 -> 132772 bytes erts/preloaded/src/erlang.erl | 29 +++++++++-------------------- erts/test/erlc_SUITE.erl | 15 ++++++--------- lib/stdlib/src/erl_features.erl | 25 +------------------------ 4 files changed, 16 insertions(+), 53 deletions(-) diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index cb32ed8ff2..87ff9624c2 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -2336,26 +2336,15 @@ is_tuple(_Term) -> | {features_not_allowed, [atom()]}. load_module(Mod, Code) -> try - Allowed = - case erlang:module_loaded(erl_features) of - true -> - erl_features:load_allowed(Code); - false -> ok - end, - case Allowed of - {not_allowed, NotEnabled} -> - {error, {features_not_allowed, NotEnabled}}; - ok -> - case erlang:prepare_loading(Mod, Code) of - {error,_}=Error -> - Error; - Prep when erlang:is_reference(Prep) -> - case erlang:finish_loading([Prep]) of - ok -> - {module,Mod}; - {Error,[Mod]} -> - {error,Error} - end + case erlang:prepare_loading(Mod, Code) of + {error,_}=Error -> + Error; + Prep when erlang:is_reference(Prep) -> + case erlang:finish_loading([Prep]) of + ok -> + {module,Mod}; + {Error,[Mod]} -> + {error,Error} end end catch diff --git a/lib/stdlib/src/erl_features.erl b/lib/stdlib/src/erl_features.erl index ac2ecd3c37..ffccfcbfb3 100644 --- a/lib/stdlib/src/erl_features.erl +++ b/lib/stdlib/src/erl_features.erl @@ -26,7 +26,6 @@ short/1, long/1, enabled/0, - load_allowed/1, keywords/0, keywords/1, keyword_fun/2, @@ -423,32 +423,6 @@ keywords() -> set_keywords(Words) -> persistent_term:put({?MODULE, keywords}, Words). -%% Check that any features used in the module are enabled in the -%% runtime system. If not, return -%% {not_allowed, <list of not enabled features>}. --spec load_allowed(binary()) -> ok | {not_allowed, [feature()]}. -load_allowed(Binary) -> - case erts_internal:beamfile_chunk(Binary, "Meta") of - undefined -> - ok; - Meta -> - MetaData = erlang:binary_to_term(Meta), - case proplists:get_value(enabled_features, MetaData) of - undefined -> - ok; - Used -> - Enabled = enabled(), - case lists:filter(fun(UFtr) -> - not lists:member(UFtr, Enabled) - end, - Used) of - [] -> ok; - NotEnabled -> - {not_allowed, NotEnabled} - end - end - end. - %% Return features used by module or beam file -spec used(module() | file:filename()) -> [feature()]. used(Module) when is_atom(Module) -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor