informarte / yuck

Yuck is a local-search constraint solver with FlatZinc interface
Other
56 stars 11 forks source link

Cannot build release on MacOS #13

Closed Dekker1 closed 1 year ago

Dekker1 commented 2 years ago

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.

(https://github.com/Dekker1/homebrew-minizinc/pull/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 commented 2 years ago

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

Dekker1 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Analysis:

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

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 commented 2 years ago

I reported the build issue in https://github.com/com-lihaoyi/mill/issues/2105.

informarte commented 2 years ago

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 commented 2 years ago

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

informarte commented 2 years ago

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

Dekker1 commented 2 years ago

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 commented 2 years ago
TypeError: no implicit conversion of nil into String

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

Dekker1 commented 1 year ago

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

Thanks again for the all the help!

Dekker1 commented 1 year ago

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