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

Fix static build on macOS #8

Merged

Conversation

oleg-jukovec
Copy link
Collaborator

@oleg-jukovec oleg-jukovec commented Mar 3, 2023

The build tag openssl_static does not produce a binary with static linked libcrypto and libssl. The patch fixes it.

Related to tarantool/tt#308

The patch also fix build on macOS with Apple M1

Related to tarantool/go-tarantool#260

How-to test the static build:

$ go test . -c
$ otool -L go-openssl.test 
go-openssl.test:
	/usr/local/opt/openssl@3/lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/usr/local/opt/openssl@3/lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1953.255.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60420.60.24)
$ go test . -c -tags openssl_static
$ otool -L go-openssl.test         
go-openssl.test:
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1953.255.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60420.60.24)

The build tag `openssl_static` does not produce a binary with
static linked libcrypto and libssl. The patch fixes it.

Related to tarantool/tt#308
@oleg-jukovec
Copy link
Collaborator Author

oleg-jukovec commented Mar 3, 2023

According to https://docs.brew.sh/Installation, /usr/local is for Intel binaries/libraries, /opt/homebrew for ARM.

/usr/local is for Intel binaries/libraries, /opt/homebrew for ARM [1].

1. https://docs.brew.sh/Installation

Related to tarantool/go-tarantool#260
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/darwin-build-fix branch from d50a446 to 58cfcbf Compare March 3, 2023 13:42
@oleg-jukovec oleg-jukovec merged commit 720eeb3 into v0.0.7-24-g0fadeb4-tarantool Mar 7, 2023
oleg-jukovec added a commit that referenced this pull request Feb 8, 2024
Overview

    The first release with a number of fixes. Since `libp2p/openssl`
    is not supported any more we need to support our version for usage
    in the Golang connector `tarantool/go-tarantool`.

New features

    DialContext function (#10).

Bugfixes

     Build by Golang 1.13 (#6).

     Build with OpenSSL < 1.1.1 (#7).

     Build on macOS as a static library (#8).

     Build on macOS with Apple M1 (#8).

     Random errors in the code caused by an invalid OpenSSL error
     handling in LoadPrivateKeyFromPEM,
     LoadPrivateKeyFromPEMWithPassword,
     LoadPrivateKeyFromDER and LoadPublicKeyFromPEM (#9).
@oleg-jukovec oleg-jukovec mentioned this pull request Feb 8, 2024
@oleg-jukovec oleg-jukovec deleted the oleg-jukovec/darwin-build-fix branch February 8, 2024 05:42
oleg-jukovec added a commit that referenced this pull request Feb 8, 2024
Overview

    The first release with a number of fixes. Since `libp2p/openssl`
    is not supported any more we need to support our version for usage
    in the Golang connector `tarantool/go-tarantool`.

    See releases of `libp2p/openssl`[1] for previous changes history.

New features

    DialContext function (#10).

Bugfixes

     Build by Golang 1.13 (#6).

     Build with OpenSSL < 1.1.1 (#7).

     Build on macOS as a static library (#8).

     Build on macOS with Apple M1 (#8).

     Random errors in the code caused by an invalid OpenSSL error
     handling in LoadPrivateKeyFromPEM,
     LoadPrivateKeyFromPEMWithPassword,
     LoadPrivateKeyFromDER and LoadPublicKeyFromPEM (#9).

1. https://github.com/libp2p/go-openssl/releases
oleg-jukovec added a commit that referenced this pull request Feb 8, 2024
Overview

    The first release with a number of fixes. Since `libp2p/openssl`
    is not supported any more we need to support our version for usage
    in the Golang connector `tarantool/go-tarantool`.

    See releases of `libp2p/openssl`[1] for previous changes history.

New features

    DialContext function (#10).

Bugfixes

     Build by Golang 1.13 (#6).

     Build with OpenSSL < 1.1.1 (#7).

     Build on macOS as a static library (#8).

     Build on macOS with Apple M1 (#8).

     Random errors in the code caused by an invalid OpenSSL error
     handling in LoadPrivateKeyFromPEM,
     LoadPrivateKeyFromPEMWithPassword,
     LoadPrivateKeyFromDER and LoadPublicKeyFromPEM (#9).

1. https://github.com/libp2p/go-openssl/releases
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.

None yet

3 participants