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

Cleanup in OpenSSL compilation step #2270

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Cleanup in OpenSSL compilation step #2270

merged 1 commit into from
Oct 16, 2023

Conversation

mislav
Copy link
Member

@mislav mislav commented Oct 13, 2023

  • The make -j 1 workaround seems neither in effect nor necessary anymore
  • Assume that KERNEL_BITS workaround isn't necessary anymore
  • Declare more variables as local

Ref. 959e5cb

- The `make -j 1` workaround seems neither in effect nor necessary anymore
- Assume that KERNEL_BITS workaround isn't necessary anymore
- Declare more variables as local
Comment on lines -1115 to +1111
# Default MAKE_OPTS are -j 2 which can confuse the build. Thankfully, make
# gives precedence to the last -j option, so we can override that.
package_option openssl make -j 1
# Skip building OpenSSL docs, which is slow.
Copy link
Member

@eregon eregon Oct 14, 2023

Choose a reason for hiding this comment

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

-j 1 is still needed, except for openssl 3+.
For example I found #1791 where it's needed for 1.1

Copy link
Member Author

Choose a reason for hiding this comment

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

@eregon During my work on #2230 I've found that our default MAKE_OPTS take precedence over the -j 1 setting, resulting in this invocation:

make -j 1 -j 8

Since make most likely only respects the last -j option, it seems that some time in the last decade, our -j 1 workaround stopped having effect, but our users largely haven't noticed.

Furthermore, I have just built openssl-1.1.1w successfully using make -j 8 on macOS.

Copy link
Member

Choose a reason for hiding this comment

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

Mmh, so the comment above was wrong then?

{ "$MAKE" "${!PACKAGE_MAKE_OPTS_ARRAY}" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS}
So it depends on whether package_option openssl make -j 1 adds it to PACKAGE_MAKE_OPTS_ARRAY or PACKAGE_MAKE_OPTS. If PACKAGE_MAKE_OPTS it should be fine.
Seems it's to PACKAGE_MAKE_OPTS_ARRAY hence what you saw:

variable="$(capitalize "${package_name}_${command_name}")_OPTS_ARRAY"

IIRC some older versions of openssl don't always work with parallel make. And it's transient, sometimes it just works and sometimes not, e.g. due to missing dependencies between make targets.
I have found openssl/openssl#298 and openssl/openssl#5762 (comment), so it seems a problem for OpenSSL < 1.1.0.

Copy link
Member

Choose a reason for hiding this comment

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

Also conan-io/conan-center-index#3001 (comment) so maybe some older versions happen to work with parallel builds but in general it seems not guaranteed at all for OpenSSL < 1.1.0.
So I think we should still -j1 on OpenSSL < 1.1.0.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for looking that up. No build definition has been using openssl-1.0 since Ruby 2.3.8. So I'd be fine with ruby-build not attempting the -j 1 workaround at all and instead offloading that to the user (by expecting them to set OPENSSL_MAKE_OPTS) if they really need to build an ancient Ruby version for some reason.

Copy link
Member

Choose a reason for hiding this comment

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

Could we either handle it here and update these definitions < 2.4 to automatically set it?
I don't think it's any good if we keep definitions which are broken and need a manual workaround like this when we know the issue and it's somewhat-indirectly caused by ruby-build (which builds openssl).
For instance it would break https://github.com/ruby/ruby-builder for Ruby < 2.4 so I'm not keen on breaking this.

@mislav mislav merged commit 7a741cf into master Oct 16, 2023
6 checks passed
@mislav mislav deleted the openssl-clean branch October 16, 2023 12:38
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

Successfully merging this pull request may close these issues.

2 participants