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

feat: add apache/maven-mvnd #20468

Merged
merged 4 commits into from Mar 2, 2024
Merged

feat: add apache/maven-mvnd #20468

merged 4 commits into from Mar 2, 2024

Conversation

tadayosi
Copy link
Contributor

@tadayosi tadayosi commented Mar 1, 2024

apache/maven-mvnd: Apache Maven Daemon

aqua g -i apache/maven-mvnd

To test (requires Java and Maven to be installed):

$ mvnd --version
Apache Maven Daemon (mvnd) 1.0-m8 linux-amd64 native client (0f4bdb6df5e74453d8d558d292789da4e66a7933)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.linux.LinuxNativePty
Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: /home/tasato/.local/share/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/1.0-m8/maven-mvnd-1.0-m8-m39-linux-amd64.tar.gz/maven-mvnd-1.0-m8-m39-linux-amd64/mvn
Java version: 17.0.9, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.7.5-200.fc39.x86_64", arch: "amd64", family: "unix"

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Mar 1, 2024
@suzuki-shunsuke
Copy link
Member

Thank you!

files:
- name: mvnd
src: maven-mvnd-{{.Version}}-m39-{{.OS}}-{{.Arch}}/bin/mvnd
version_constraint: semver(">= 1.0.0-m6")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I tried to follow it but it didn't work for me. Probably it's because I use Fedora and only Podman (not Docker) is available. Here is what I got when running cmdx s <package>:

INFO[0000] create a symbolic link                        aqua_version=2.23.1 command=aqua-proxy env=linux/amd64 package_name=aqua-proxy package_version=v1.2.5 program=aqua registry=
+ opts=
+ '[' -n '' ']'
+ '[' -n '' ']'
+ docker exec -ti -w /aqua-registry aqua-registry aqua-registry scaffold apache/maven-mvnd
Error: crun: executable file `aqua-registry` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
exit status 127

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Thank you for your explanation.
Maybe this issue is related, though I couldn't reproduce the issue.

@tadayosi
Copy link
Contributor Author

tadayosi commented Mar 1, 2024

@suzuki-shunsuke Thanks for fixing my pull req! Now it's failing to install older versions such as 0.8.1, 0.7.1, and 0.0.2. It appears aqua has some issue with unarchiving .zip files? Because all the versions that fail are .zip files. .tar.gz seems to work just fine.

@suzuki-shunsuke
Copy link
Member

Please don't do force pushes after opening pull requests from the next time.

https://github.com/suzuki-shunsuke/oss-contribution-guide?tab=readme-ov-file#dont-do-force-pushes-after-opening-pull-requests

@suzuki-shunsuke
Copy link
Member

Hmm. The local test succeeded but CI failed.
I'll take a look.

@suzuki-shunsuke
Copy link
Member

Hmm. 🤔

I'm not sure why but it seems the zip file is empty.

https://github.com/aquaproj/aqua-registry/actions/runs/8111293383/job/22170919733?pr=20468#step:5:152

ERRO[0001] check file_src is correct                     aqua_version=2.23.1 env=linux/amd64 error="check file_src is correct: exe_path isn't found: stat /home/runner/.local/share/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1/maven-mvnd-0.8.1-linux-amd64.zip/maven-mvnd-0.8.1-linux-amd64/bin/mvnd: permission denied" exe_path=/home/runner/.local/share/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1/maven-mvnd-0.8.1-linux-amd64.zip/maven-mvnd-0.8.1-linux-amd64/bin/mvnd file_name=mvnd package_name=apache/maven-mvnd package_version=0.8.1 program=aqua registry=standard
ERRO[0001] executable files aren't found
Files in the unarchived package:

   aqua_version=2.23.1 env=linux/amd64 package_name=apache/maven-mvnd package_version=0.8.1 program=aqua registry=standard

On my laptop, the zip file is unarchived correctly.

root@91361fb1e506:/workspace# ls /root/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1/maven-mvnd-0.8.1-linux-amd64.zip/maven-mvnd-0.8.1-linux-amd64/bin/mvnd
/root/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1/maven-mvnd-0.8.1-linux-amd64.zip/maven-mvnd-0.8.1-linux-amd64/bin/mvnd

@tadayosi
Copy link
Contributor Author

tadayosi commented Mar 1, 2024

As a workaround I think we can:

version_constraint: semver(">= 0.8.2")

as it doesn't make much sense to keep using older versions for mvnd.

But, as it might also suggest some potential issue with aqua around unarchiving zips, so it's more than happy if you're interested in looking into the issue more :-)

@tadayosi
Copy link
Contributor Author

tadayosi commented Mar 1, 2024

Just FYI, on my local laptop (Fedora 39), 0.8.1 fails in the same way it fails to install on the github action (ubuntu-latest):

$ aqua g -i apache/maven-mvnd@0.8.1
$ aqua i
ERRO[0000] check file_src is correct                     aqua_version=2.23.1 env=linux/amd64 error="check file_src is correct: exe_path isn't found: stat /home/tasato/.local/share/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1/maven-mvnd-0.8.1-linux-amd64.zip/maven-mvnd-0.8.1-linux-amd64/bin/mvnd: permission denied" exe_path=/home/tasato/.local/share/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1/maven-mvnd-0.8.1-linux-amd64.zip/maven-mvnd-0.8.1-linux-amd64/bin/mvnd file_name=mvnd package_name=apache/maven-mvnd package_version=0.8.1 program=aqua registry=standard
ERRO[0000] executable files aren't found
Files in the unarchived package:

   aqua_version=2.23.1 env=linux/amd64 package_name=apache/maven-mvnd package_version=0.8.1 program=aqua registry=standard
ERRO[0000] install the package                           aqua_version=2.23.1 env=linux/amd64 error="check file_src is correct" package_name=apache/maven-mvnd package_version=0.8.1 program=aqua registry=standard
FATA[0000] aqua failed

The zip also fails to expand locally for me:

$ tree $(aqua root-dir)/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1
/home/tasato/.local/share/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1
└── maven-mvnd-0.8.1-linux-amd64.zip
    └── maven-mvnd-0.8.1-linux-amd64

3 directories, 0 files

@suzuki-shunsuke
Copy link
Member

suzuki-shunsuke commented Mar 1, 2024

This log is weird.

https://github.com/aquaproj/aqua-registry/actions/runs/8111293383/job/22171381584?pr=20468#step:5:151

INFO[0001] retry installing the package                  aqua_version=2.23.1 env=linux/amd64 error="reading file in zip archive: file already exists: /home/runner/.local/share/aquaproj-aqua/pkgs/github_release/github.com/apache/maven-mvnd/0.8.1/maven-mvnd-0.8.1-linux-amd64.zip/maven-mvnd-0.8.1-linux-amd64/README.adoc" package_name=apache/maven-mvnd package_version=0.8.1 program=aqua registry=standard retry_count=1

This log shown README.adoc existed in the zip but the following log shown the zip file was empty.

ERRO[0001] executable files aren't found
Files in the unarchived package:

   aqua_version=2.23.1 env=linux/amd64 package_name=apache/maven-mvnd package_version=0.8.1 program=aqua registry=standard

@suzuki-shunsuke
Copy link
Member

As a workaround, we would be able to remove some versions from pkg.yaml.
Now I'm tired, so I'll take a look tomorrow.

@tadayosi
Copy link
Contributor Author

tadayosi commented Mar 1, 2024

@suzuki-shunsuke No worries. Thank you for looking into it, Suzuki-san! Take a good rest!

@suzuki-shunsuke
Copy link
Member

But, as it might also suggest some potential issue with aqua around unarchiving zips, so it's more than happy if you're interested in looking into the issue more :-)

aqua uses mholt/archiver/v3 (v3.5.1).

https://github.com/aquaproj/aqua/blob/65fb59915fced5e16413e59cd17b3f0a1b42b972/go.mod#L18
https://github.com/mholt/archiver

We haven't changed the version of mholt/archiver for over two years.

https://github.com/aquaproj/aqua/blame/v2.23.1/go.mod#L18

https://pkg.go.dev/github.com/mholt/archiver/v3#Zip.Unarchive

@suzuki-shunsuke
Copy link
Member

As a workaround, I commented out some testdata.

ded31e2 95512c9

@suzuki-shunsuke suzuki-shunsuke merged commit f48b6e1 into aquaproj:main Mar 2, 2024
16 checks passed
@suzuki-shunsuke suzuki-shunsuke added this to the v4.147.0 milestone Mar 2, 2024
@suzuki-shunsuke
Copy link
Member

About the above issue, I created an issue.

@suzuki-shunsuke
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants