Skip to content

Fix issue on windows with OTP 28 which causes rebar to get stuck at fetching dependencies. #2954

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

i-am-orestis
Copy link

@i-am-orestis i-am-orestis commented May 25, 2025

After upgrading to Erlang/OTP 28 on windows, rebar gets stuck at fetching dependencies and does not progress.

After doing a bit of investigation, it seems that ec_file:tmp() of erlware_commons library uses erlang:system_info(system_architecture) instead of the commonly used os:type() in order to detect the current OS. On my system, the former resolves to "x86_64-pc-windows" instead of the expected "win32". This causes rebar to resolve the wrong path when creating temporary directories in code which uses ec_file:tmp().

Changing the logic inside ec_file:tmp() to use os:type() fixes this issue and rebar works as expected.

This behavior does not occur with Erlang/OTP 27.3.4

@paulo-ferraz-oliveira
Copy link
Contributor

Oh, nice. It seems erlef/setup-beam got bit by this today (while developing some new stuff), too.

@i-am-orestis
Copy link
Author

It might also be beneficial to do the same for system_tmpdir/1 inside apps/rebar/src/rebar_file_utils.erl

@ferd
Copy link
Collaborator

ferd commented Jun 2, 2025

This change should actually be done in https://github.com/erlware/erlware_commons/ which we can then update here. We don't want to be accumulating changes in vendored deps that are not pushed back upstream. Good fix though.

@i-am-orestis
Copy link
Author

Thanks @ferd. I created a new pull request in erlware_commons for ec_file.erl.

@ferd
Copy link
Collaborator

ferd commented Jun 4, 2025

Merged in the other repo, syncing up with @tsloughter to have a published hex version we can import here.

@dumbbell
Copy link

Hi! I see the fix was merged into erlware_commons. Do you plan to release a patch release of Rebar with this fix? Or will it be part of a future minor release? I’m interested in this fix to test several projects with Erlang/OTP 28 and Windows in GitHub Actions.

@ferd
Copy link
Collaborator

ferd commented Jun 13, 2025

Applying it in this PR: #2957

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.

4 participants