Skip to content

Allow building with OTP-29#2996

Open
mikpe wants to merge 13 commits intoerlang:mainfrom
mikpe:allow-building-with-otp29
Open

Allow building with OTP-29#2996
mikpe wants to merge 13 commits intoerlang:mainfrom
mikpe:allow-building-with-otp29

Conversation

@mikpe
Copy link
Contributor

@mikpe mikpe commented Feb 21, 2026

rebar3 currently doesn't build with OTP-29.0-rc1 due to new warnings about deprecated language features. This fixes them. Some notes:

  • The rebar_user module uses "interesting" control flow that depends on old-style catch semantics in at least one place, possibly more. Where I wasn't absolutely sure no such dependency existed, I used a helper function to emulate old-style catches. This can hopefully be cleaned up in the future.
  • The rebar_prv_cover:cover_compile_file/1 function uses catch to turn any exit or error in the call into a case_clause error. The rewrite preserves that.
  • ec_talk:get_integer/1 had an error (it spelled 'EXIT' wrong) which has been corrected as part of eliminating the old-style catch.

end.

%% This module has "interesting" control-flow, so where it's not obvious that
%% it's not needed, we use this emulation of old-style catches.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This module is vendored from the user module in Erlang/OTP. We'll need to grab a refreshed copy of it ideally, but this will do for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like rebar_user.erl is based on OTP-18's user.erl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OTP's user.erl was deleted after OTP-25, so if you're looking for changes in the upcoming OTP-29 to eliminate old-style catches in it you won't find any.

ct:pal("~p", [try file:list_dir(RootDir ++ "_build/default/lib/") catch _:_ -> error end]),
ct:pal("~p", [try file:list_dir(RootDir ++ "_build/default/lib/rp_b/") catch _:_ -> error end]),
ct:pal("~p", [try file:list_dir(RootDir ++ "_build/default/lib/rp_b/ebin") catch _:_ -> error end]),
ct:pal("~p", [try b:module_info() catch _:_ -> error end]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

These obfuscate the error, it might be nicer to grab the error and reason, but I understand that this is inconvenient due to needing not to pollute the scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add helper functions to do these operations and return useful error terms in case of error.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That would probably better such that if there's a problem we get good signal.

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.

Sorry for taking a while to review this. I think we'll need to not quite merge this yet because the vendored dependencies need to be fixed and reimported. We don't want to maintain large patch sets independently; I'll have to put it on the list to tackle these and see about upstream publication.

@mikpe mikpe force-pushed the allow-building-with-otp29 branch from a44e7d4 to 78ca18c Compare March 1, 2026 15:34
@mikpe
Copy link
Contributor Author

mikpe commented Mar 1, 2026

Rebased to resolve merge conflict in rebar.config.

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