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

Cannot build release on MacOS #13

Closed
Dekker1 opened this issue Nov 2, 2022 · 13 comments
Closed

Cannot build release on MacOS #13

Dekker1 opened this issue Nov 2, 2022 · 13 comments

Comments

@Dekker1
Copy link

Dekker1 commented Nov 2, 2022

I'm trying to update the Yuck version in my Homebrew tap, but it seems that I cannot actually build on MacOS anymore (the ubuntu build seems to go okay).

On MacOS the mill builder no longer seems to detect the universalBuild preset:

mill yuck.universalPackage Picked up _JAVA_OPTIONS: -Duser.home=/Users/runner/Library/Caches/Homebrew/java_cache Picked up _JAVA_OPTIONS: -Duser.home=/Users/runner/Library/Caches/Homebrew/java_cache Preparing Java 19 runtime; this may take a minute or two ... Downloading https://repo1.maven.org/maven2/com/lihaoyi/mill-contrib-buildinfo_2.13/0.10.8/mill-contrib-buildinfo_2.13-0.10.8.pom Downloaded https://repo1.maven.org/maven2/com/lihaoyi/mill-contrib-buildinfo_2.13/0.10.8/mill-contrib-buildinfo_2.13-0.10.8.pom Downloading https://repo1.maven.org/maven2/com/lihaoyi/mill-contrib-buildinfo_2.13/0.10.8/mill-contrib-buildinfo_2.13-0.10.8.jar Downloading https://repo1.maven.org/maven2/com/lihaoyi/mill-contrib-buildinfo_2.13/0.10.8/mill-contrib-buildinfo_2.13-0.10.8-sources.jar Downloaded https://repo1.maven.org/maven2/com/lihaoyi/mill-contrib-buildinfo_2.13/0.10.8/mill-contrib-buildinfo_2.13-0.10.8.jar Downloaded https://repo1.maven.org/maven2/com/lihaoyi/mill-contrib-buildinfo_2.13/0.10.8/mill-contrib-buildinfo_2.13-0.10.8-sources.jar Compiling /private/tmp/yuck-20221102-18458-1cvaay2/yuck-20221101/build.sc Cannot resolve yuck.universalPackage. Try `mill resolve yuck._` to see what's available.

(Dekker1/homebrew-minizinc#29)

Running the resolve locally gives me:

./mill resolve yuck._
[1/1] resolve 
yuck.dev
yuck.prod

I'm not really familiar with the scala tooling, so maybe I'm just missing a dependency or something like that (currently it is just mill and java). Any pointers would be much appreciated.

@informarte
Copy link
Owner

Try make zip or, equivalently, ./mill yuck.dev.universalPackage.

@Dekker1
Copy link
Author

Dekker1 commented Nov 3, 2022

Thank you, that solves the problem. However, when building from the zipped source, it seems that the build fails because yuck.dev.retrieveGitBranch only works in a git repository. However, when doing git-checkout Homebrew always uses submodules, and the minizinc-benchmarks repository included does not seem to exists (probably a private clone).

Is there an option to build from a static directory instead of git? (preferred)
Or, can you publish the minizinc-benchmarks clone so checkout would succeed?

P.S. why do we use yuck.dev and not yuck.prod? What is the difference?

@informarte
Copy link
Owner

I had forgotten to push the latest changes to my minizinc-benchmarks clone; now cloning the Yuck sources with --recurse-submodules should work.

Currently, building from the zipped sources (provided automatically by Github) is not possible.

Both Scala 2 and Scala 3 feature inlining. In Scala 2 it is an optional (and expensive) optimization, so I introduced dev and prod builds. In Scala 3, inlining works differently and cannot be disabled, so there is no difference between the build types any more.

@Dekker1
Copy link
Author

Dekker1 commented Nov 3, 2022

The build now seems to start. However, it seems that an error in formatting the deprecation warning is stopping the build for succeeding: https://github.com/Dekker1/homebrew-minizinc/actions/runs/3382286052/jobs/5633182090#step:8:521
Have you seen this before?

@informarte
Copy link
Owner

informarte commented Nov 5, 2022

Analysis:

  • You are using Java 19.
  • Java 19 deprecates Thread.getId in favor of Thread.threadId which is only available from Java 19.
  • sbt (used under the hood by mill) throws when trying to report the warning generated by dotty (the Scala 3 compiler).
  • The sbt issue reproduces on Ubuntu 20.04 with Oracle's JDK 19, however it does not break the build.
  • So it seems that something in the Homebrew build scans for error messages and causes the failure.
  • Upgrading to the latest mill 0.10.8 does not help.

The issue can be fixed or worked around in four ways:

  • by fixing the Homebrew build
  • by compiling with an earlier Java version
  • by installing the Yuck ZIP package from GitHub (as part of the Homebrew build) instead of building from sources
  • by changing the Yuck code

If you cannot fix the Homebrew build and really want or need to build yourself and to build with Java 19, then let's discuss the technical details via email.

@informarte
Copy link
Owner

I reported the build issue in com-lihaoyi/mill#2105.

@informarte
Copy link
Owner

It turned out that the mill developers have already worked around the logging issue (by providing their own logger). This fix will be delivered with mill 0.10.9.

@Dekker1
Copy link
Author

Dekker1 commented Nov 8, 2022

That is good news. I hope they come with a release soon :)

@informarte
Copy link
Owner

I just pushed the branch unblock-homebrew-build, so no need to wait for the next official mill release.

@Dekker1
Copy link
Author

Dekker1 commented Nov 9, 2022

I seem to be running into another odd issue again: https://github.com/Dekker1/homebrew-minizinc/actions/runs/3424097391/jobs/5703399310#step:8:598
Do you have any idea what would give such an error?

I might for now just use the released built binaries, but would love to solve these issues and build it in the formula again in the future

@informarte
Copy link
Owner

TypeError: no implicit conversion of nil into String

is not from the Yuck build, it's a Ruby error message.

@Dekker1
Copy link
Author

Dekker1 commented Nov 9, 2022

Ah, I probably should have guessed that. I'll investigate further when I find some time.

Thanks again for the all the help!

@Dekker1
Copy link
Author

Dekker1 commented Nov 17, 2022

All solved. Once more, thank you for the support!

@Dekker1 Dekker1 closed this as completed Nov 17, 2022
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

2 participants