homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

pkl 0.25.2 (new formula)

Open bioball opened this issue 1 year ago • 12 comments

This is a re-submission; was originally #161655

  • [x] Have you followed the guidelines for contributing?
  • [x] Have you ensured that your commits follow the commit style guide?
  • [x] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [x] Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [x] Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • [ ] Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

bioball avatar Feb 15 '24 19:02 bioball

Thanks for contributing to Homebrew! :tada: It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

github-actions[bot] avatar Feb 15 '24 19:02 github-actions[bot]

@bioball thanks for resubmitting! Small question, does pkl have any command line autocompletion for fish, zsh, and/or bash?

onedr0p avatar Feb 15 '24 19:02 onedr0p

@bioball thanks for resubmitting! Small question, does pkl have any command line autocompletion for fish, zsh, and/or bash?

@onedr0p not currently.

bioball avatar Feb 15 '24 21:02 bioball

This is mostly working now, but I'm not really sure how to fix the test failures.

On Linux, this is failing because:

Full linkage --test pkl output
  Unwanted system libraries:
    /lib/x86_64-linux-gnu/libz.so.1

How do you work around this? I don't see libz available as a formula.

On macOS, this is failing because:

==> FAILED
Full audit pkl --online --new output
  pkl
    * line 8, col 3: `env :std` in homebrew/core formulae is deprecated
    * GitHub repository too new (<30 days old)

Without env :std, we get these errors:

[1/8] Initializing...                                                                                    (0.0s @ 0.15GB)
Error: Unable to detect supported DARWIN native software development toolchain.
Querying with command '/opt/homebrew/Library/Homebrew/shims/mac/super/cc -v' prints:
  cc: The build tool has reset ENV; --env=std required.
Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
com.oracle.svm.core.util.UserError$UserException: Unable to detect supported DARWIN native software development toolchain.
Querying with command '/opt/homebrew/Library/Homebrew/shims/mac/super/cc -v' prints:
  cc: The build tool has reset ENV; --env=std required.
To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:126)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c.codegen.CCompilerInvoker.addSkipCheckingInfo(CCompilerInvoker.java:106)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c.codegen.CCompilerInvoker.<init>(CCompilerInvoker.java:74)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c.codegen.CCompilerInvoker$DarwinCCompilerInvoker.<init>(CCompilerInvoker.java:279)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c.codegen.CCompilerInvoker.create(CCompilerInvoker.java:84)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:929)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:579)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:539)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:408)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:612)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:134)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)

What is the correct way to write this formula so that cc -v doesn't fail?

bioball avatar Feb 16 '24 17:02 bioball

On Linux, this is failing because:

Full linkage --test pkl output
  Unwanted system libraries:
    /lib/x86_64-linux-gnu/libz.so.1

uses_from_macos "zlib" would be the fix.

chenrui333 avatar Feb 17 '24 09:02 chenrui333

What is the correct way to write this formula so that cc -v doesn't fail?

This means something in the build script is deleting/filtering environment variables. Can you check whether environment variables are being kept intact by the point you are invoking native-image?

Bo98 avatar Feb 19 '24 18:02 Bo98

How do you work around this? I don't see libz available as a formula.

Worth checking this again after dealing with env :std as it could be the cause, as env :std disables all build isolation etc.

Otherwise if it still happens then either something is picking up system zlib or it's a prebuilt somewhere.

Bo98 avatar Feb 19 '24 18:02 Bo98

Okay, I think I have this pretty much ready.

One CI error here:

Full audit pkl --online --new output
  pkl
    * Formulae should not require patches to build. Patches should be submitted and accepted upstream first.

This patch file is part of the repo, and there's nothing to upstream. How can I suppress this error?

Also; side-note: what's the expected flow for working on a PR? I keep force-pushing because otherwise this doesn't pass the commit message CI check, but that seems like the wrong thing to do.

bioball avatar Feb 21 '24 06:02 bioball

This patch file is part of the repo, and there's nothing to upstream. How can I suppress this error?

Why does upstream not apply the patch?

Also; side-note: what's the expected flow for working on a PR? I keep force-pushing because otherwise this doesn't pass the commit message CI check, but that seems like the wrong thing to do.

That is the expected flow

SMillerDev avatar Feb 21 '24 08:02 SMillerDev

This patch is a remnant of late JDK11 support. GraalVM23 dropped support for JDK11, but has the plumbing necessary to produce an Apple Silicon native build. We're looking to drop JDK11 support in 0.26, so we should be able to consolidate this soon. For 0.25.x, though, we would still like to have a formula out.

holzensp avatar Feb 21 '24 12:02 holzensp

For why that patch exists: it applies changes that are only desired for building macOS on Apple Silicon, and those changes are not desired in our other builds (because Pkl still supports Java 11 like Phil mentioned). Those changes aren't things that are easily configurable through our build system, Gradle. Specifically, it replaces the version of GraalVM that we're giving to Gradle as a project dependency.

Using a patch file to track is a simple way for us to manage this diff without having to really rewire our build logic in Gradle.

bioball avatar Feb 21 '24 15:02 bioball

@SMillerDev: let me know if you need anything else here. Asides from the one CI complaint about our patch block, this should be all set.

bioball avatar Feb 22 '24 01:02 bioball

@SMillerDev: pinging again here for whenever you get the chance to take a look.

bioball avatar Feb 28 '24 01:02 bioball

we can definitely followup, but we probably dont need info and stacktrace flags for the release builds

- system "./gradlew", "--info", "--stacktrace", "-DreleaseBuild=true", job_name
+ system "./gradlew", "-DreleaseBuild=true", job_name

chenrui333 avatar Feb 28 '24 21:02 chenrui333

:shipit: @chenrui333 has requested bottles to be published to this PR.

github-actions[bot] avatar Feb 29 '24 15:02 github-actions[bot]

:warning: @chenrui333 bottle publish failed.

github-actions[bot] avatar Feb 29 '24 15:02 github-actions[bot]

homebrew/core
  * The following should either be an alias or a rename, not both: bigdata, boot2docker, camlistore, crystal-lang, findbugs, gitlab-ci-multi-runner, gnome-icon-theme, gnupg2, gtef, gtk+4, htop-osx, latexila, letsencrypt, libmongoclient, linux-headers, mat, mobile-shell, mongo-c, newsbeuter, osh, pyqt5, qt5, recipes, speedtest_cli, ssreflect, tachyon, tensorflow and transfig
Error: 1 problem in 1 tap detected.

need a rebase for the merge.

chenrui333 avatar Feb 29 '24 15:02 chenrui333

Thanks @bioball and everyone for this journey!

$ brew install pkl
==> Downloading https://ghcr.io/v2/homebrew/core/pkl/manifests/0.25.2
################################################################################################# 100.0%
==> Fetching pkl
==> Downloading https://ghcr.io/v2/homebrew/core/pkl/blobs/sha256:258e24047f0819094d0675c13264590c943fa5
################################################################################################# 100.0%
==> Pouring pkl--0.25.2.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/pkl/0.25.2: 6 files, 105.8MB

chenrui333 avatar Feb 29 '24 17:02 chenrui333