-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MacOS: Add a Homebrew OpenSSL directory configuration option.
This commit is to enable users to set a custom Homebrew openssl directory configuration option to set the openssl library path on MacOS. Previously we got the openssl library path by `brew --prefix openssl` on MacOS. However, there is a case where the directory actually doesn't exist. And this option enables users to build mysql2 in the case. ``` + brew --prefix openssl /usr/local/opt/openssl@3 + ls -ld /usr/local/opt/openssl* lrwxr-xr-x 1 runner admin 36 Dec 16 01:28 /usr/local/opt/openssl -> /usr/local/Cellar/[email protected]/1.1.1s lrwxr-xr-x 1 runner admin 28 Dec 16 01:19 /usr/local/opt/[email protected] -> ../Cellar/[email protected]/1.1.1s /usr/local/opt/[email protected] ``` == How to use == In the development, you can run like this. ``` $ RUBY_MYSQL2_BREW_SSL_DIR=/usr/local/opt/[email protected] rake ``` In the installation, you can run like this. ``` $ gem install mysql2 -- --with-brew-ssl-dir=/usr/local/opt/[email protected] ``` == Note == In this commit, the directory existing check is added in the `extconf.rb`. If the openssl directory doesn't exist, the build fails with the error message below. ``` Cannot find library dir(s) /usr/local/opt/openssl@3/lib ```
- Loading branch information
Showing
3 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
name: Build | ||
on: [push, pull_request] | ||
env: | ||
BUNDLE_WITHOUT: development | ||
# Reduce MacOS CI time, don't need to clean a runtime that isn't saved | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | ||
jobs: | ||
build: | ||
name: >- | ||
|
@@ -27,30 +32,37 @@ jobs: | |
- '2.2' | ||
- '2.1' | ||
db: [''] | ||
env: [{}] | ||
include: | ||
# Comment out due to ci/setup.sh stucking. | ||
# - {os: ubuntu-18.04, ruby: 2.4, db: mariadb10.1} | ||
- {os: ubuntu-20.04, ruby: '2.4', db: mariadb10.3} | ||
- {os: ubuntu-18.04, ruby: '2.4', db: mysql57} | ||
- {os: ubuntu-20.04, ruby: '2.4', db: mysql80} | ||
- {os: ubuntu-18.04, ruby: 'head', db: ''} | ||
- {os: ubuntu-20.04, ruby: '2.4', db: mariadb10.3, env: {}} | ||
- {os: ubuntu-18.04, ruby: '2.4', db: mysql57, env: {}} | ||
- {os: ubuntu-20.04, ruby: '2.4', db: mysql80, env: {}} | ||
- {os: ubuntu-18.04, ruby: 'head', db: '', env: {}} | ||
# db: A DB's brew package name in macOS case. | ||
# Set a name "db: '[email protected]'" when using an old version. | ||
# MariaDB lastet version | ||
# Allow failure due to the following test failures that rarely happens. | ||
# https://github.com/brianmario/mysql2/issues/1194 | ||
- {os: macos-latest, ruby: '2.6', db: mariadb, allow-failure: true} | ||
- os: macos-latest | ||
ruby: '2.6' | ||
db: mariadb | ||
allow-failure: true | ||
env: | ||
RUBY_MYSQL2_HOMEBREW_SSL_DIR: '/usr/local/opt/[email protected]' | ||
# MySQL latest version | ||
# Allow failure due to the issue #1194. | ||
- {os: macos-latest, ruby: '2.6', db: mysql, allow-failure: true} | ||
- os: macos-latest | ||
ruby: '2.6' | ||
db: mysql | ||
allow-failure: true | ||
env: | ||
RUBY_MYSQL2_HOMEBREW_SSL_DIR: '/usr/local/opt/[email protected]' | ||
# On the fail-fast: true, it cancels all in-progress jobs | ||
# if any matrix job fails unlike Travis fast_finish. | ||
fail-fast: false | ||
env: | ||
BUNDLE_WITHOUT: development | ||
# reduce MacOS CI time, don't need to clean a runtime that isn't saved | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | ||
env: ${{ matrix.env }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# https://github.com/ruby/setup-ruby | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters