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
duck: fix build for Linux #83110
duck: fix build for Linux #83110
Conversation
This formula had I will open an issue on the upstream Trac for Cyberduck (https://trac.cyberduck.io/query) once the CI passes here asking for guidance on how to make a PR to properly add app-image support to the |
17cebf9
to
3591b0f
Compare
Ironically this now builds fine on Linux but fails on macOS because of universal/non-native binaries. It seems this does not actually support native ARM yet: https://trac.cyberduck.io/ticket/11101, which is blocked by iterate-ch/rococoa#20. So I think this needs As for the universal binaries, I think I have seen elsewhere that these are actually from macOS itself? I'm not sure how we've handled this before. |
Agreed that this needs |
There is a new bump PR for this formula #83146 which will probably fail for same reason on macOS. Can either combine into single PR, or will need to fix to one PR and then rebase the other. |
I can confirm that the
I think I've figured how to build |
81a80b9
to
4cf768e
Compare
I've now pushed some major changes that should build
Initially I just extracted the zip archive after it was made and then ran the build script inside of the folder. However, I realized that the naming of the zip file is rather inconvient to work with programmatically - it changes based on platform, and based on the JNI version, which cannot easily be extracted from anywhere. I also found it cumbersome to have to unzip a file like this. My workaround for this was to just delete the line that packages the header files into the zip file. Along with a small change in the @carlocab I'm pretty sure after checking the logs that
We happened to catch There is a Github repo for JavaNativeFoundation from none other than Apple themselves: https://github.com/apple/openjdk/tree/xcodejdk14-release/apple/JavaNativeFoundation. That is probably what is being used to build the universal For now I think we should focus on getting the universal native binaries built from source so that this passes our audit. However, it would be great for formulae like this to make sure we are building all the native binaries from source. |
I did it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a huge change and I hope those two resources will become formula, but for now this should be enough.
resource "jna" do | ||
url "https://github.com/java-native-access/jna/archive/refs/tags/5.8.0.tar.gz" | ||
sha256 "97680b8ddb5c0f01e50f63d04680d0823a5cb2d9b585287094de38278d2e6625" | ||
end | ||
|
||
resource "JavaNativeFoundation" do | ||
url "https://github.com/apple/openjdk/archive/refs/tags/iTunesOpenJDK-1014.0.2.12.1.tar.gz" | ||
sha256 "e8556a73ea36c75953078dfc1bafc9960e64593bc01e733bc772d2e6b519fd4a" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment explaining how to update these resources? This can be in a follow-up syntax-only PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am actually thinking we should make these resources into formulae. I am going to update this to the newest version and then I'd like to make formulae out of the resources and remove those parts of this formulae. All we'd have to do if the resources are formulae is link the necessary files into libexec
after deleting the pre-packaged ones. The resources themselves both use GitHub so we can use livecheck
to keep them up to date if they are formulae.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. Thanks for working on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you approve again? I had to dismiss the previous approval from @SMillerDev when I updated the version.
For |
I'm fine with an exception if other tools need it. |
ignore_missing_libraries "libjvm.so" | ||
end | ||
|
||
resource "jna" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break when we update the JNA dependency upstream and this formulae will take the older version instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following up on this. I have 2 thoughts about this:
- These resources will be made into formulae soon, which will be updated automatically with
livecheck
andbrew bump
. - The only thing we're actually taking from JNA is the
dylib/so
, which is built with-compatibility_version 5
such that it should maintain ABI compatibility as long as the major version remains at 5. If and when a version 6 is released which breaks ABI compatibility, we'd either rebuildduck
against version 6 (if it has been updated), or if it takes a while for upstream to update, create ajna@5
formula to use in the interim.
I'm not intimately familiar with the details of how JNA is implemented, but it's generally rare for native dynamic libraries to break ABI compatibility between minor versions, let alone point releases. I'm certainly open to being proven wrong on this but we'll have to see how the next update goes.
I should also add here that we are pushing harder to try to avoid downloading pre-built native binaries because doing so has both security and compatibility implications. However we're hoping to do so without huge inconvenience to upstream projects. In this particular case, no changes are needed in how the package is built upstream - we simply delete the binaries downloaded by Maven and replace them with ones that will eventually come from formulae.
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?