Conversation
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
It looks like rebar_user.erl is based on OTP-18's user.erl.
There was a problem hiding this comment.
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]), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I can add helper functions to do these operations and return useful error terms in case of error.
There was a problem hiding this comment.
That would probably better such that if there's a problem we get good signal.
ferd
left a comment
There was a problem hiding this comment.
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.
a44e7d4 to
78ca18c
Compare
|
Rebased to resolve merge conflict in rebar.config. |
rebar3 currently doesn't build with OTP-29.0-rc1 due to new warnings about deprecated language features. This fixes them. Some notes:
rebar_usermodule uses "interesting" control flow that depends on old-stylecatchsemantics 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.rebar_prv_cover:cover_compile_file/1function usescatchto turn anyexitorerrorin the call into acase_clauseerror. The rewrite preserves that.ec_talk:get_integer/1had an error (it spelled'EXIT'wrong) which has been corrected as part of eliminating the old-style catch.