-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add MacOS dependency build #16615
Merged
Merged
Add MacOS dependency build #16615
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a1008dc
Implement MacOS build for wheels
alopezz 5a4f013
Add repair step for MacOS
alopezz a54c1ac
Standardize environment variable prefixes
alopezz c0ce12a
Move common helper script to share among linux and macos
alopezz 714e5c0
Fix wheel repair exclusion
alopezz 1d85f7c
Copy wheels to output directory
alopezz 03b1197
Build confluent-kafka with kerberos support
alopezz 735a7d6
Add deployment target
alopezz 4dd95ef
Drop postgresql since we no longer need to build psycopg
alopezz 934f0a7
Rely less on system-provided libraries (i.e. make whitelist stricter)
alopezz b651312
Remove unnecessary library
alopezz 61b4ec2
Add workflow to test build on CI
alopezz 89ba0af
Add python2 to CI job
alopezz f959345
Split builder setup and actual build and make the former optional
alopezz 233b268
Output information about libraries copied during repair
alopezz 3c9de44
Don't set rpath as it's not needed
alopezz f6c9eaa
Move job to common workflow
alopezz ebd3909
Adjustments to environment variables and paths
alopezz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
"${DD_PYTHON3}" -m pip install --no-warn-script-location --upgrade pip | ||
"${DD_PYTHON3}" -m pip install --no-warn-script-location virtualenv | ||
"${DD_PYTHON3}" -m virtualenv py3 | ||
|
||
"${DD_PYTHON2}" -m pip install --no-warn-script-location --upgrade pip | ||
"${DD_PYTHON2}" -m pip install --no-warn-script-location virtualenv | ||
"${DD_PYTHON2}" -m virtualenv py2 | ||
|
||
"${DD_PYTHON3}" -m pip install --no-warn-script-location -r "${DD_MOUNT_DIR}/build_context/runner_dependencies.txt" | ||
|
||
# Install always with our own prefix path | ||
cp "${DD_MOUNT_DIR}/build_context/install-from-source.sh" . | ||
install-from-source() { | ||
bash "install-from-source.sh" --prefix="${DD_PREFIX_PATH}" "$@" | ||
} | ||
|
||
# mqi | ||
IBM_MQ_VERSION=9.2.4.0-IBM-MQ-DevToolkit | ||
curl --retry 5 --fail "https://s3.amazonaws.com/dd-agent-omnibus/ibm-mq-backup/${IBM_MQ_VERSION}-MacX64.pkg" -o /tmp/mq_client.pkg | ||
sudo installer -pkg /tmp/mq_client.pkg -target / | ||
rm -rf /tmp/mq_client.pkg | ||
|
||
# openssl | ||
DOWNLOAD_URL="https://www.openssl.org/source/openssl-{{version}}.tar.gz" \ | ||
VERSION="3.0.12" \ | ||
SHA256="f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61" \ | ||
RELATIVE_PATH="openssl-{{version}}" \ | ||
CONFIGURE_SCRIPT="./config" \ | ||
install-from-source \ | ||
-fPIC shared \ | ||
no-module \ | ||
no-comp no-idea no-mdc2 no-rc5 no-ssl3 no-gost | ||
|
||
# libxml & libxslt for lxml | ||
DOWNLOAD_URL="https://download.gnome.org/sources/libxml2/2.10/libxml2-{{version}}.tar.xz" \ | ||
VERSION="2.10.3" \ | ||
SHA256="5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c" \ | ||
RELATIVE_PATH="libxml2-{{version}}" \ | ||
install-from-source \ | ||
--without-iconv \ | ||
--without-python \ | ||
--without-icu \ | ||
--without-debug \ | ||
--without-mem-debug \ | ||
--without-run-debug \ | ||
--without-legacy \ | ||
--without-catalog \ | ||
--without-docbook \ | ||
--disable-static | ||
|
||
DOWNLOAD_URL="https://download.gnome.org/sources/libxslt/1.1/libxslt-{{version}}.tar.xz" \ | ||
VERSION="1.1.37" \ | ||
SHA256="3a4b27dc8027ccd6146725950336f1ec520928f320f144eb5fa7990ae6123ab4" \ | ||
RELATIVE_PATH="libxslt-{{version}}" \ | ||
install-from-source \ | ||
--with-libxml-prefix="${DD_PREFIX_PATH}" \ | ||
--without-python \ | ||
--without-crypto \ | ||
--without-profiler \ | ||
--without-debugger \ | ||
--disable-static | ||
|
||
# curl | ||
DOWNLOAD_URL="https://curl.haxx.se/download/curl-{{version}}.tar.gz" \ | ||
VERSION="8.4.0" \ | ||
SHA256="816e41809c043ff285e8c0f06a75a1fa250211bbfb2dc0a037eeef39f1a9e427" \ | ||
RELATIVE_PATH="curl-{{version}}" \ | ||
install-from-source \ | ||
--disable-manual \ | ||
--disable-debug \ | ||
--enable-optimize \ | ||
--disable-static \ | ||
--disable-ldap \ | ||
--disable-ldaps \ | ||
--disable-rtsp \ | ||
--enable-proxy \ | ||
--disable-dependency-tracking \ | ||
--enable-ipv6 \ | ||
--without-libidn \ | ||
--without-gnutls \ | ||
--without-librtmp \ | ||
--without-libssh2 \ | ||
--with-ssl="${DD_PREFIX_PATH}" | ||
# Remove the binary installed so that we consistenly use the same original `curl` binary | ||
rm "${DD_PREFIX_PATH}/bin/curl" | ||
|
||
# Dependencies needed to build librdkafka (and thus, confluent-kafka) with kerberos support | ||
# Note that we don't ship these but rely on the Agent providing a working cyrus-sasl installation | ||
# with kerberos support, therefore we only need to watch out for the version of cyrus-sasl being | ||
# compatible with that in the Agent, the rest shouldn't matter much | ||
DOWNLOAD_URL="https://github.com/LMDB/lmdb/archive/LMDB_{{version}}.tar.gz" \ | ||
VERSION="0.9.29" \ | ||
SHA256="22054926b426c66d8f2bc22071365df6e35f3aacf19ad943bc6167d4cae3bebb" \ | ||
RELATIVE_PATH="lmdb-LMDB_{{version}}/libraries/liblmdb" \ | ||
CONFIGURE_SCRIPT="true" \ | ||
install-from-source | ||
DOWNLOAD_URL="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-{{version}}/cyrus-sasl-{{version}}.tar.gz" \ | ||
VERSION="2.1.28" \ | ||
SHA256="7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c" \ | ||
RELATIVE_PATH="cyrus-sasl-{{version}}" \ | ||
install-from-source --with-dblib=lmdb --enable-gssapi="${DD_PREFIX_PATH}" --disable-macos-framework |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exu | ||
|
||
# Packages which must be built from source | ||
always_build=() | ||
|
||
if [[ "${DD_BUILD_PYTHON_VERSION}" == "3" ]]; then | ||
# confluent-kafka and librdkafka need to be compiled from source to get kerberos support | ||
# The librdkafka version needs to stay in sync with the confluent-kafka version, | ||
# thus we extract the version from the requirements file. | ||
kafka_version=$(grep 'confluent-kafka==' "${DD_MOUNT_DIR}/requirements.in" | sed -E 's/^.*([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+).*$/\1/') | ||
DOWNLOAD_URL="https://github.com/confluentinc/librdkafka/archive/refs/tags/v{{version}}.tar.gz" \ | ||
VERSION="${kafka_version}" \ | ||
SHA256="2d49c35c77eeb3d42fa61c43757fcbb6a206daa560247154e60642bcdcc14d12" \ | ||
RELATIVE_PATH="librdkafka-{{version}}" \ | ||
bash install-from-source.sh --prefix="${DD_PREFIX_PATH}" --enable-sasl --enable-curl | ||
|
||
always_build+=("confluent-kafka") | ||
fi | ||
|
||
# Empty arrays are flagged as unset when using the `-u` flag. This is the safest way to work around that | ||
# (see https://stackoverflow.com/a/61551944) | ||
pip_no_binary=${always_build[@]+"${always_build[@]}"} | ||
if [[ "$pip_no_binary" ]]; then | ||
# If there are any packages that must always be built, inform pip | ||
echo "PIP_NO_BINARY=\"${pip_no_binary}\"" >> $DD_ENV_FILE | ||
fi |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How is this running?
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 don't understand the question.
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.
As in how is the binary running successfully if it was built for a different architecture?
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.
Universal2 binaries are compatible with both Intel and arm64 (https://en.wikipedia.org/wiki/Universal_binary), the comment means to explain that the 11 in the package name refers to the SDK version used for the arm64 variant, whereas for intel (which is the one we're actually using in the build) it is built with 10.9, meaning we should be able to build wheels with support for MacOS versions 10.9+.