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

GH-36456: [R] Link to correct version of OpenSSL when using autobrew #36551

Merged
merged 17 commits into from
Jul 16, 2023

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Jul 7, 2023

Rationale for this change

The r-binary-packages job (which uses autobrew) and the autobrew nightly jobs are failing because they are linking to a different version of OpenSSL than the package was built against. I believe this occurred because Arrow and its dependencies are built against the autobrew headers which included openssl. The ssl and crypto libraries weren't explicitly linked, so I think whatever LibreSSL fork MacOS installs by default was getting linked. This was perhaps compatible using the version of autobrew for High Sierra/the version of LibreSSL on High Sierra but was not compatible with the version of autobrew for Big Sur/the version of LibreSSL on Big Sur.

What changes are included in this PR?

This PR explicitly adds OpenSSL 1.1 to the autobrew formulas and explicitly adds -lssl -lcrypto to the PKG_LIBS (1.1 because that's what was in the corresponding homebrew formula).

Are these changes tested?

Existing nightly tests cover these changes.

Are there any user-facing changes?

No.

@github-actions github-actions bot added Component: R awaiting committer review Awaiting committer review labels Jul 7, 2023
@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Revision: b896259

Submitted crossbow builds: ursacomputing/crossbow @ actions-3d21794472

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Revision: 15700d4

Submitted crossbow builds: ursacomputing/crossbow @ actions-007d7f7198

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

Revision: 6a538f4

Submitted crossbow builds: ursacomputing/crossbow @ actions-0bc60af847

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

Revision: 047bc6a

Submitted crossbow builds: ursacomputing/crossbow @ actions-bd672e75e9

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

Revision: 047bc6a

Submitted crossbow builds: ursacomputing/crossbow @ actions-47a81f0980

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot paleolimbot marked this pull request as ready for review July 11, 2023 19:29
@paleolimbot
Copy link
Member Author

@nealrichardson If my reading of all this is correct, I think this will change the OpenSSL that is linked by default in the CRAN package that everybody uses. Is there a reason that this wasn't done before that I'm not aware of?

@nealrichardson
Copy link
Member

nealrichardson commented Jul 11, 2023

No reason I recall that it wasn't done before. How does upstream autobrew handle this?

If we're pinning a version, why not pin 3 instead of 1.1? (Edit: oh I see you mentioned that in the description)

Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I don't think it should be an issue for CRAN as we modify/don't use system libs explicitly in autobrew#L68-L75

@paleolimbot
Copy link
Member Author

@nealrichardson Thanks!

How does upstream autobrew handle this?

I am not sure what this means! I assumed the formula in the autobrew repos is modified to reflect the one I modified here before each release? My understanding of autobrew is admittedly limited.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Great!

(But I don't know why [email protected] is chosen instead of openssl@3 by Apache Arrow C++ when both of them are installed...)

r/tools/autobrew Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Jul 12, 2023
@nealrichardson
Copy link
Member

How does upstream autobrew handle this?

I am not sure what this means! I assumed the formula in the autobrew repos is modified to reflect the one I modified here before each release? My understanding of autobrew is admittedly limited.

We do, but @jeroen maintains the actual autobrew formulae and scripts (here, here, and here, specifically), of which ours are copies that we modify to test on every commit. When changes to Homebrew happen or CRAN mandates new things, he handles it there, and we should watch (at release time, or when things break) for changes we need to pull in accordingly to stay in sync.

I don't see openssl pinned there, so I'm not sure what's different such that we need it--something with the self-hosted runner setup, perhaps? If so, that's probably ok, though might be worth adding comments that that's the case.

Re: openssl version, Homebrew actually has openssl@3: https://github.com/Homebrew/homebrew-core/blob/master/Formula/apache-arrow.rb#L30 If our copy is pinned on 1.1, we should update it, and pull in any other changes from upstream, same as autobrew.

@jeroen
Copy link
Contributor

jeroen commented Jul 12, 2023

You already explicitly depend on openssl via thrift (and aws-sdk maybe)?

## brew deps --tree apache-arrow-static
autobrew/cran/apache-arrow-static
├── aws-sdk-cpp-static
├── brotli
├── lz4
├── snappy
├── thrift
│   └── openssl@3
│       └── ca-certificates
└── zstd
    ├── lz4
    └── xz

Upstream homebrew bumped thrift and aws-sdk to openssl@3 a few weeks ago, so the next release of the apache-arrow-static bundle will automatically include openssl@3.

The current PR will probably create a conflict because you end up depending on both openssl@11 and openssl@3. This may work in a dynamic linked stack, but once you try to statically link the entire stack in the R package this will probably create symbol conflicts.

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

Revision: 018ca98

Submitted crossbow builds: ursacomputing/crossbow @ actions-225ba98cc6

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

Revision: ae451ee

Submitted crossbow builds: ursacomputing/crossbow @ actions-0fd077276c

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot
Copy link
Member Author

@github-actions crossbow submit r-binary-packages homebrew-r-autobrew

@github-actions
Copy link

Revision: 0043b1c

Submitted crossbow builds: ursacomputing/crossbow @ actions-1602f52d96

Task Status
homebrew-r-autobrew Github Actions
r-binary-packages Github Actions

@paleolimbot
Copy link
Member Author

Ok: I opened #36707 for the CI failure and for the r-binary-packages failure; also, I removed any unnecessary changes to the formulae.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

r/configure Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert changes in this file?

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Jul 16, 2023
@paleolimbot paleolimbot merged commit ed87a5b into apache:main Jul 16, 2023
@paleolimbot paleolimbot removed the awaiting merge Awaiting merge label Jul 16, 2023
raulcd pushed a commit that referenced this pull request Jul 17, 2023
…36551)

### Rationale for this change

The r-binary-packages job (which uses autobrew) and the autobrew nightly jobs are failing because they are linking to a different version of OpenSSL than the package was built against. I believe this occurred because Arrow and its dependencies are built against the autobrew headers which included openssl. The `ssl` and `crypto` libraries weren't explicitly linked, so I think whatever LibreSSL fork MacOS installs by default was getting linked. This was perhaps compatible using the version of autobrew for High Sierra/the version of LibreSSL on High Sierra but was not compatible with the version of autobrew for Big Sur/the version of LibreSSL on Big Sur.

### What changes are included in this PR?

This PR explicitly adds OpenSSL 1.1 to the autobrew formulas and explicitly adds `-lssl -lcrypto` to the PKG_LIBS (1.1 because that's what was in the corresponding homebrew formula).

### Are these changes tested?

Existing nightly tests cover these changes.

### Are there any user-facing changes?

No.
* Closes: #36456

Lead-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Dewey Dunnington <[email protected]>
chelseajonesr pushed a commit to chelseajonesr/arrow that referenced this pull request Jul 20, 2023
…obrew (apache#36551)

### Rationale for this change

The r-binary-packages job (which uses autobrew) and the autobrew nightly jobs are failing because they are linking to a different version of OpenSSL than the package was built against. I believe this occurred because Arrow and its dependencies are built against the autobrew headers which included openssl. The `ssl` and `crypto` libraries weren't explicitly linked, so I think whatever LibreSSL fork MacOS installs by default was getting linked. This was perhaps compatible using the version of autobrew for High Sierra/the version of LibreSSL on High Sierra but was not compatible with the version of autobrew for Big Sur/the version of LibreSSL on Big Sur.

### What changes are included in this PR?

This PR explicitly adds OpenSSL 1.1 to the autobrew formulas and explicitly adds `-lssl -lcrypto` to the PKG_LIBS (1.1 because that's what was in the corresponding homebrew formula).

### Are these changes tested?

Existing nightly tests cover these changes.

### Are there any user-facing changes?

No.
* Closes: apache#36456

Lead-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Dewey Dunnington <[email protected]>
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit ed87a5b.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them.

R-JunmingChen pushed a commit to R-JunmingChen/arrow that referenced this pull request Aug 20, 2023
…obrew (apache#36551)

### Rationale for this change

The r-binary-packages job (which uses autobrew) and the autobrew nightly jobs are failing because they are linking to a different version of OpenSSL than the package was built against. I believe this occurred because Arrow and its dependencies are built against the autobrew headers which included openssl. The `ssl` and `crypto` libraries weren't explicitly linked, so I think whatever LibreSSL fork MacOS installs by default was getting linked. This was perhaps compatible using the version of autobrew for High Sierra/the version of LibreSSL on High Sierra but was not compatible with the version of autobrew for Big Sur/the version of LibreSSL on Big Sur.

### What changes are included in this PR?

This PR explicitly adds OpenSSL 1.1 to the autobrew formulas and explicitly adds `-lssl -lcrypto` to the PKG_LIBS (1.1 because that's what was in the corresponding homebrew formula).

### Are these changes tested?

Existing nightly tests cover these changes.

### Are there any user-facing changes?

No.
* Closes: apache#36456

Lead-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Dewey Dunnington <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[R] R package is linking to the wrong OpenSSL on MacOS BigSur?
6 participants