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

Erlang/OTP windows builds #26

Closed
2 tasks
starbelly opened this issue Apr 1, 2021 · 13 comments
Closed
2 tasks

Erlang/OTP windows builds #26

starbelly opened this issue Apr 1, 2021 · 13 comments
Assignees
Labels
Agenda Item Item to be discussed at WG meeting

Comments

@starbelly
Copy link
Member

Background

We're wanting to get in support for windows in erlef/setup-beam. There's a few existing examples go by for that work, but it seems optimal to get the builds from the OTP team itself. This also requires a builds list ala https://repo.hex.pm/builds/otp/ubuntu-18.04/builds.txt. This may already exist, but if so it's not clear where it is.

If I recall correctly we had dialog before around the OTP team providing more builds on github for a wider array of operating systems and architectures, but I don't believe we executed on that per looking at what's available on github right now.

As far as I'm aware the only place to find a windows build from OTP team is in http://erlang.org/download/ (or via the download page on erlang.org), however there is no textual list (either plain text ala hex build list or in json format). It may be required to build a matrix of windows / otp versions, but that is not clear to me per having little experience with windows and Erlang/OTP.

While, getting packages on github may be an objective here, it's not clear whether that is really needed to for our goals. However, we need to the windows builds to be highly available which erlang.org may not be able to provide.

Finally, per my limited experience with installing Erlang/OTP on windows it's not clear to me whether the existing builds can be installed unassisted (i.e., via the CLI).

Objective(s)

  • Get a standardized windows build list either on erlang.org or on github
  • Discuss the pros and cons (if any) of making windows builds available on github
@starbelly starbelly added the Agenda Item Item to be discussed at WG meeting label Apr 1, 2021
@starbelly starbelly self-assigned this Apr 1, 2021
@ferd
Copy link
Member

ferd commented Apr 1, 2021

You can now find auto-uploaded and pre-built executables on each releases on their github pages as well: https://github.com/erlang/otp/releases/tag/OTP-23.3.1

@ferd
Copy link
Member

ferd commented Apr 1, 2021

Eh nevermind I might be wrong on the automated nature, the smaller point releases don't have them https://github.com/erlang/otp/releases/tag/OTP-21.3.8.22 -- though that could be because they're older than the commits containing the hooks to build.

@starbelly
Copy link
Member Author

I see. All we need is a list then, basically. I mean, we could just talk to github's api, but optimally we have one general way of getting a list, parsing it, etc. Maybe some other things I'm not thinking about at the moment.

@paulo-ferraz-oliveira
Copy link

For rebar3, for example, and as per @ferd's suggestion, we are indeed getting the version list from the GitHub API (at https://api.github.com/repos/erlang/rebar3/releases), but I guess versioning is easier there because there's only one "binary", whereas for Erlang/OTP pre-built Windows versions (.exe) are different from Linux ones.

@josevalim
Copy link
Contributor

Eh nevermind I might be wrong on the automated nature, the smaller point releases don't have them https://github.com/erlang/otp/releases/tag/OTP-21.3.8.22 -- though that could be because they're older than the commits containing the hooks to build.

@jhogberg confirmed that it is automated and it happens for all releases since OTP 23.0. So we should be able to rely on precompiled releases from that version onwards (which in my opinion is a fine requirement to make).

@paulo-ferraz-oliveira
Copy link

https://api.github.com/repos/erlang/otp/releases 😄 and if they had a label "otp_win32" it'd be sweet 😄 At the same time, I guess I can parse those results and use the versions that are left over from e.g. otp_win32_23.3.1.exe by removal of prefix otp_win2_ and suffix .exe (though it's kinda fragile, this way).

@jhogberg
Copy link

jhogberg commented Apr 7, 2021

You should be able to use git for that, any tag that can reach OTP-23.0 has Windows builds.

$ export RELEASE_TAG='tag goes here'
$ [[ -n $(git tag -l --merged $RELEASE_TAG 'OTP-23.0') ]] && \
        echo "$RELEASE_TAG has Windows builds" || \
        echo "$RELEASE_TAG does not have Windows builds"

@paulo-ferraz-oliveira
Copy link

@jhogberg, I need the information before I download the package, since (at least in the setup-beam GitHub action) we provide for a semver-like version choice mechanism. It goes like this:

  1. you choose your version (as an input parameter)
  2. we verify that your version (e.g. 23.0) is known < this is where we need the list
  3. we try to make a choice
    3.1. if impossible (version not listed), we error out
    3.2. if possible (version listed), we use semver-like version choice to choose a version (in the case of 23.0 this would be >=23.0.0 <23.1.0-0, then download the package

@wojtekmach
Copy link
Collaborator

wojtekmach commented Apr 7, 2021

I might be missing something but I believe instead of your condition being "has label otp_win32" it is "version is >= 23"? You can still grab the list of releases from https://api.github.com/repos/erlang/otp/releases.

@paulo-ferraz-oliveira
Copy link

paulo-ferraz-oliveira commented Apr 7, 2021

@wojtekmach, I can use that condition, no prob. I was just stating that a label would help us not need to do an extra check. In any case, I can filter by name, hoping it'll always be consistent 😄

Edit: I was trying to be strict over "all releases", but I can assume it might fail and output a message accordingly 👍

Edit: more importantly, what I need to do is install Erlang Win32 on my desktop and make the Powershell script work.

@wojtekmach
Copy link
Collaborator

wojtekmach commented May 4, 2021

I was able to create a sample project that uses official OTP windows builds on GitHub Actions:

We still need to make it so that erlef/setup-beam on Windows downloads and executes the installer but at least we know it's possible!

Thanks @jhogberg for mentioning that NSIS installers have an unattended flag (/S) which was the missing piece.

@wojtekmach
Copy link
Collaborator

@starbelly
Copy link
Member Author

Closing this as resolved. setup-beam is now making use of windows builds from erlang/otp (via github).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agenda Item Item to be discussed at WG meeting
Projects
None yet
Development

No branches or pull requests

6 participants