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

Discuss initial details around the action #1

Open
paulo-ferraz-oliveira opened this issue Jun 19, 2024 · 19 comments
Open

Discuss initial details around the action #1

paulo-ferraz-oliveira opened this issue Jun 19, 2024 · 19 comments

Comments

@paulo-ferraz-oliveira
Copy link
Collaborator

Ref.: erlef/setup-beam#283

@robertoaloi, @starbelly, let's continue here. I'll try to keep issues to a minimum to move fast.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Jun 19, 2024

I asked.

"
In the meantime, Roberto, could you tell me:

  • what are the expected inputs? Maybe it's just the versions of the tools? And are they semver or something else?
  • where to obtain the tools from (and what architectures are available)?
  • what outputs would you expect the action to make available?

"

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Jun 19, 2024

Robert replied.

"

What are the expected inputs? Maybe it's just the versions of the tools? And are they semver or something else?

We can probably start with the ELP version only. Eqwalizer is packaged in there. The version has the format YYYY-MM-DD or YYYY-MM-DD_N if there are multiple releases per day. No semantic versioning.

Where to obtain the tools from (and what architectures are available)?

Binaries are published as release assets. Example here.

We currently provide binaries for Linux (x86_64 and aarch64) and Mac x64_64. There's also a Mac aarch64 but I think the eqwalizer artifact is still for x64_64 in there (we should fix that, but I believe there was no runner available for that platform). All artifacts are currently available for OTP 25 and OTP 26.

We probably need to depend on setup-graalvm to be able to run Eqwalizer.

All the magic happens here.
Installation instructions from binary are also available here.

What outputs would you expect the action to make available?

I would expect the elp CLI to be available in the pipeline so that commands such as elp eqwalize and elp parse-elp can be used to perform, respectively, type checking and linting (similar to rebar3 dialyzer and rebar3 elvis.
"

@paulo-ferraz-oliveira
Copy link
Collaborator Author

I've moved, to this repo, what I'd done in https://github.com/paulo-ferraz-oliveira/gha-example. Next I'll adapt the content to not mention "gha-example", and "Paulo", and then I'll try a simple Linux-working version of the installer with options.

As I understand it now there's no option to guess the version (so we need it to be complete), but I can think of something later - mind you that most consumers don't care to update versions constantly which is why setup-beam guesses the latest from stuff like 25.3 (would be 25.3.2.12), 27 (would be 27.0) or 25.1.2 (would be 25.1.2.1).

Also, for the macOS do you mean the other way around (ARM not AMD?). Just checking since most recent versions of macOS only run on ARM (right?).

@paulo-ferraz-oliveira
Copy link
Collaborator Author

I've send you both invitations to collaborate, but don't know if I'll have to change them to "write" later.

@starbelly
Copy link
Member

@paulo-ferraz-oliveira Giving you access to the private repo I created...

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Jun 19, 2024

I'll move it later, if that's Ok, since I wanna try out stuff with some Settings, too, and I might not be able to do so so easily next to erlef 😄 Edit: oh, it seems I'm an admin. there. I'll try to move this. @starbelly, can you move this yourself (once you accept my invitation and become and admin. here)?

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Jun 19, 2024

@robertoaloi, is the name for the assets fixed?

Example:

elp-linux-aarch64-unknown-linux-gnu-otp-25.3.tar.gz
                  ^ will this always be unknown?
                                        ^ what would happen for 25.1, for example?

The version compatibility matrices can also be discussed later (#4), but I'm mostly interested in the unknown bit. Note: I'm also testing this process manually with as little obstacles as possible to get a feel of how the action would look like.

Also, does it make a difference if it's Ubuntu 20, 22 or 24, as per GitHub's current runners?

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Jun 19, 2024

Note: elp lint outputs "build-info plugin was not installed. Please follow the instructions on https://github.com/WhatsApp/eqwalizer". I can't find instructions searching for build-info.

Edit: also searched https://github.com/WhatsApp/eqwalizer/blob/main/FAQ.md, and https://github.com/WhatsApp/eqwalizer/tree/main/docs.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

I found a potential improvement on the CI file you linked (https://github.com/WhatsApp/erlang-language-platform/blob/main/.github/workflows/ci.yml#L87). setup-beam allows choosing a rebar3 version to install alongside Erlang; not sure if you have a specific use case to use the one from AWS, though.

@starbelly
Copy link
Member

I'll move it later, if that's Ok, since I wanna try out stuff with some Settings, too, and I might not be able to do so so easily next to erlef 😄 Edit: oh, it seems I'm an admin. there. I'll try to move this. @starbelly, can you move this yourself (once you accept my invitation and become and admin. here)?

You could also just set the remote for origin and do a git push -f 😄

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Jun 19, 2024

Nah, because I have issues now, and I don't wanna deal with moving that too. 😄 Right now lemme focus on getting a first draft out and then we'll see. I just merged to the main branch. I'd be Ok for you to move the project now (or lemme know how/if I can do it). I don't wanna loose the issues (or have to copy them by hand) or the pull requests and the associated history.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

@robertoaloi, regarding moving forward: the action has elp available. What is required to have eqWAlizer linked to it, easily. Is there an installer that doesn't force me to do all sorts of things?

I see:

  • use setup-graalv (never tried to use an action for Javascript, but probably there's something out there that allows it)
  • use setup-scala
  • use dtolnay/rust-toolchain@stable
  • sudo apt-get update
  • sudo apt-get install -y crossbuild-essential-arm64
  • sbt assembly
  • uraimo/run-on-arch-action
  • ...

I'm not sure how easy it'd be to pack all of this in a container (it'd also make consuming in non-GHA easier (?)).

@robertoaloi
Copy link
Member

Also, for the macOS do you mean the other way around (ARM not AMD?). Just checking since most recent versions of macOS only run on ARM (right?).

Yes. I was referring to this issue which is being fixed as we speak: WhatsApp/erlang-language-platform#34

@robertoaloi
Copy link
Member

@robertoaloi, is the name for the assets fixed?

elp-linux-aarch64-unknown-linux-gnu-otp-25.3.tar.gz
                  ^ will this always be unknown?
                                        ^ what would happen for 25.1, for example?

The target names comes from the parameter passed to the cargo build command. You can run:

rustc --print target-list

To get the list of possible targets.

Also, does it make a difference if it's Ubuntu 20, 22 or 24, as per GitHub's current runners?
No, it should not matter.

@robertoaloi
Copy link
Member

@robertoaloi, regarding moving forward: the action has elp available. What is required to have eqWAlizer linked to it, easily. Is there an installer that doesn't force me to do all sorts of things?

@VLanvin is the eqWAlizer expert. I think most of eqwalizer is already pre-packaged in ELP so maybe installing the GraalVM is enough? Not sure which other installation steps would be required. Did you try to run elp eqwalize on a project?

@robertoaloi
Copy link
Member

Note: elp lint outputs "build-info plugin was not installed. Please follow the instructions on https://github.com/WhatsApp/eqwalizer". I can't find instructions searching for build-info.

That means you are running it on a project without a .elp.toml file but a rebar.config file. In that case elp tries to use the build_info plugin to load the project definition. As a first step, you can try is to add a simple .elp.toml file to the repo that looks like this one for RabbitMQ.

Documentation here.

Note that I already pushed the build_info plugin to rebar3 itself, but we still need to modify ELP to use the native version.

@asabil
Copy link

asabil commented Jun 22, 2024

@robertoaloi, is the name for the assets fixed?

Example:


elp-linux-aarch64-unknown-linux-gnu-otp-25.3.tar.gz

                  ^ will this always be unknown?

                                        ^ what would happen for 25.1, for example?

The version compatibility matrices can also be discussed later (#4), but I'm mostly interested in the unknown bit.

The unknown bit is the vendor token in the compiler target, on Linux systems it is typically unknown whereas on apple/mac that token would say apple instead.

@asabil
Copy link

asabil commented Jun 22, 2024

@robertoaloi, regarding moving forward: the action has elp available. What is required to have eqWAlizer linked to it, easily. Is there an installer that doesn't force me to do all sorts of things?

You can just download the eqWAlizer binary the same way that elp is downloaded. It's a native binary that only depends on glibc iirc.

You however need to make elp know about its location, which I think is done through the ELP_EQWALIZER_PATH environment variable. Not sure whether elp searches the PATH if that environment variable is not defined?

@paulo-ferraz-oliveira
Copy link
Collaborator Author

Did you try to run elp eqwalize on a project?

Yeah, but it failed with some reason I can't remember. It's possible to create a pull request in this repo, change elp version to elp eqwalize and check what the request would be.


I'll also try to look at the TOML file you mention. Good stuff on pushing to rebar3 (I didn't know it was an "internal" plugin, but the error message mentions looking at a site where the information is then not available, as stated above).

The unknown bit is the vendor token in the compiler target, on Linux systems it is typically unknown whereas on apple/mac that token would say apple instead.

I'm Ok keeping it, if it's a rule, but I don't think it adds much in terms of semantics.

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

No branches or pull requests

4 participants