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

Adoption of AUR package but ran into issues #3490

Open
PolarianDev opened this issue Mar 5, 2023 · 15 comments
Open

Adoption of AUR package but ran into issues #3490

PolarianDev opened this issue Mar 5, 2023 · 15 comments

Comments

@PolarianDev
Copy link

Hello, I hope you don't mind completely ignoring the template you want to use.

This issue is for a discussion and is not to report an issue. So lets get started.

Today I received an email about scalafmt-native, the graalvm build of the scalafmt command line tool was being deleted due to lack of maintainer and misnaming of the package. I decided to adopt it and save the package from the trash, you can see the aur package here.

The issue was brought up is that this package is meant to be a source install, this is where the source code of the package is pulled and built no binary is pulled, however you do not seem to have a build from source guide (if you want this added through contributions, help me through this and I will write up a PR).

The previous maintainer did not write a compliant PKGBUILD, but when attempting to build in a clean chroot, I keep getting an error which I do not know what is going wrong (a clean chroot has almost every single dependency stripped from it, its a good way to find dependencies which have not been specified).

The package invokes the native image script which you distribute, but the following error occurs:

java.lang.RuntimeException: Nonzero exit value: 128
        at scala.sys.package$.error(package.scala:30)
        at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:138)
        at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:108)
        at $8e33e3a4aebfe860965c$.parseTagVersion(build.sbt:7)
        at $8e33e3a4aebfe860965c$.localSnapshotVersion(build.sbt:9)
        at $eae7269133670df054d5$.$anonfun$$sbtdef$1(/home/build/scalafmt-native/src/scalafmt-3.7.2/build.sbt:19)
        at scala.Function1.$anonfun$compose$1(Function1.scala:49)
        at scala.Function1.$anonfun$compose$1(Function1.scala:49)
        at sbt.internal.util.EvaluateSettings$MixedNode.evaluate0(INode.scala:228)
        at sbt.internal.util.EvaluateSettings$INode.evaluate(INode.scala:170)
        at sbt.internal.util.EvaluateSettings.$anonfun$submitEvaluate$1(INode.scala:87)
        at sbt.internal.util.EvaluateSettings.sbt$internal$util$EvaluateSettings$$run0(INode.scala:99)
        at sbt.internal.util.EvaluateSettings$$anon$3.run(INode.scala:94)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
[error] Nonzero exit value: 128
[error] Use 'last' for the full log.

Please could you explain why this happens, I assume it is a missing dependency which the scalafmt team has not specified as it builds fine on my laptop, which has all the libraries you would expect on a linux system installed, but clean chroots DO NOT.

You can track the progress of the update to the PKGBUILD, including the corrections to become compliant to the AUR packaging guidelines, and also updating this 3-4 year outdated package right up the latest version below:

https://onedev.polarian.dev/polarrepo/scalafmt-native/~pulls/1

I like to contact the developer anyways saying heads up I am the maintainer of the AUR package anyways, you are free to contact me by email [email protected]

The current dependencies I have deduced through trail and error:

  • GraalVM (JDK11)
  • Native image (JDK11) (obviously)
  • git (I do not know why git is needed to build but an error which has been pasted into the pull request I have linked above was looking for git so I added it as a dependency)

If there are any more dependencies I am missing, please let me know!

Have a good night!

@kitbellew
Copy link
Collaborator

kitbellew commented Mar 5, 2023

possibly connected to #2846. cc @tgodzik @jchyb

@PolarianDev
Copy link
Author

@kitbellew I am a little confused about what this issue has to do with it.

Are you trying to highlight that 3.7.2 does not build with native image due to an underlying bug?

@PolarianDev
Copy link
Author

Ok yes it is an issue with the release, are you happy with me patching 3.7.2 with the PR which has been merged, so that the package is functional before the next release.

If not when is the next release scheduled?

@PolarianDev
Copy link
Author

I see that the latest release also have builds available, this means that someone managed to build it, however the PR which references this issue has not yet been merged into upstream, and thus, I do not see how it was built :/

@kitbellew
Copy link
Collaborator

i don't fully understand the problem, so i deferred to the others.

which pr has been merged?

@PolarianDev
Copy link
Author

i don't fully understand the problem, so i deferred to the others.

which pr has been merged?

Nevermind I ended up conflicting myself, the PR you have sent above is still awaiting merging. Guess I will have to wait for the others to have time to respond :)

@PolarianDev
Copy link
Author

@tgodzik @jupblb Sorry for double ping, but its been a few days and I fear that if I do not fix this package it WILL be removed from the AUR, I have to fix it to save it so help is needed asap :)

@PolarianDev
Copy link
Author

Sorry for some reason I cant ping @jchyb properly, sorry jupblb for notifying you!

@dos65
Copy link
Member

dos65 commented Mar 8, 2023

As I got the actual issue is in build.sbt and it's not related to #2846

@PolarianDev current scalafmt build relies on that it used from git repo (version inference using git) while you are trying to build it from source.tar.gz from github. To workaround that issue you need to run bin/build-native-image.sh with CI=true env variable or build it from git repo.

@PolarianDev
Copy link
Author

@dos65 I just attempted to do what you suggested but I just get an error, see PR comment:

https://onedev.polarian.dev/polarrepo/scalafmt-native/~pulls/1#PullRequestComment-95

@PolarianDev
Copy link
Author

I am going to attempt to build this outside the chroot on my laptop and see if it works first :)

@PolarianDev
Copy link
Author

@PolarianDev
Copy link
Author

I think I might adjust the package to use git and to clone the latest tag, as building from a source archive obviously seems to be problematic :)

@PolarianDev
Copy link
Author

I rewrote the pkgbuild to use git, however then I still find this issue:

https://onedev.polarian.dev/polarrepo/scalafmt-native/~pulls/1#PullRequestComment-98

I assume I am missing dependencies, so I will list what I have so far:

  • sbt
  • git

I might have overlooked the need for scala, but it built on my laptop without having scala installed.

As this is a clean chroot its missing a lot of linux commands you would assume to be there, please could you link every external dependency you rely on, and I will see if one of them is the issue.

Until then I am postponing the update of scalafmt-native AUR package due to broken build.

@PolarianDev
Copy link
Author

As a note, the AUR package has now been deleted as it was disfunctional, and this issue stagnated. I will most likely let this package go as it has been 2 months without any response from upstream.

I will keep this issue open if upstream want to provide me any solutions to the issue, but until then I will give up trying to fix this package.

Thank you for the help I got so far, I am sorry that the package was not fixed.

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

3 participants