erlef / setup-elp

A GitHub action to run ELP eqWAlizer in your CI pipelines
MIT License
3 stars 0 forks source link

Discuss initial details around the action #1

Open paulo-ferraz-oliveira opened 4 months ago

paulo-ferraz-oliveira commented 4 months ago

Ref.: https://github.com/erlef/setup-beam/issues/283

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

paulo-ferraz-oliveira commented 4 months ago

I asked.

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

"

paulo-ferraz-oliveira commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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

starbelly commented 4 months ago

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

paulo-ferraz-oliveira commented 4 months ago

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 commented 4 months ago

@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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

@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:

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 commented 4 months ago

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: https://github.com/WhatsApp/erlang-language-platform/pull/34

robertoaloi commented 4 months ago

@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 commented 4 months ago

@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 commented 4 months ago

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 commented 4 months ago

@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 commented 4 months ago

@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 commented 4 months ago

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.