diff --git a/.gitignore b/.gitignore index d41df8a68..18b2a3d83 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ docs/source/_build/ tests/unit/queries tests/unit/data target/* +packages/* # Ignore development specific local testing files dev_tests diff --git a/continuous_integration/recipe/build.sh b/continuous_integration/recipe/build.sh new file mode 100644 index 000000000..3750311d7 --- /dev/null +++ b/continuous_integration/recipe/build.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +set -ex + +# See https://github.com/conda-forge/rust-feedstock/blob/master/recipe/build.sh for cc env explanation +if [ "$c_compiler" = gcc ] ; then + case "$target_platform" in + linux-64) rust_env_arch=X86_64_UNKNOWN_LINUX_GNU ;; + linux-aarch64) rust_env_arch=AARCH64_UNKNOWN_LINUX_GNU ;; + linux-ppc64le) rust_env_arch=POWERPC64LE_UNKNOWN_LINUX_GNU ;; + *) echo "unknown target_platform $target_platform" ; exit 1 ;; + esac + + export CARGO_TARGET_${rust_env_arch}_LINKER=$CC +fi + +declare -a _xtra_maturin_args + +mkdir -p $SRC_DIR/.cargo + +if [ "$target_platform" = "osx-64" ] ; then + cat <> $SRC_DIR/.cargo/config +[target.x86_64-apple-darwin] +linker = "$CC" +rustflags = [ + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", +] + +EOF + + _xtra_maturin_args+=(--target=x86_64-apple-darwin) + +elif [ "$target_platform" = "osx-arm64" ] ; then + cat <> $SRC_DIR/.cargo/config +# Required for intermediate codegen stuff +[target.x86_64-apple-darwin] +linker = "$CC_FOR_BUILD" + +# Required for final binary artifacts for target +[target.aarch64-apple-darwin] +linker = "$CC" +rustflags = [ + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", +] + +EOF + _xtra_maturin_args+=(--target=aarch64-apple-darwin) + + # This variable must be set to the directory containing the target's libpython DSO + export PYO3_CROSS_LIB_DIR=$PREFIX/lib + + # xref: https://github.com/PyO3/pyo3/commit/7beb2720 + export PYO3_PYTHON_VERSION=${PY_VER} + + # xref: https://github.com/conda-forge/python-feedstock/issues/621 + sed -i.bak 's,aarch64,arm64,g' $BUILD_PREFIX/venv/lib/os-patch.py + sed -i.bak 's,aarch64,arm64,g' $BUILD_PREFIX/venv/lib/platform-patch.py +fi + +maturin build -vv -j "${CPU_COUNT}" --release --strip --manylinux off --interpreter="${PYTHON}" "${_xtra_maturin_args[@]}" + +"${PYTHON}" -m pip install $SRC_DIR/target/wheels/dask_sql*.whl --no-deps -vv diff --git a/continuous_integration/recipe/conda_build_config.yaml b/continuous_integration/recipe/conda_build_config.yaml index df3cde4e1..a0f615358 100644 --- a/continuous_integration/recipe/conda_build_config.yaml +++ b/continuous_integration/recipe/conda_build_config.yaml @@ -1,8 +1,4 @@ -c_compiler_version: - - 11 rust_compiler_version: - 1.69 -libprotobuf: - - 3 maturin: - - 1.1 + - 1.1 \ No newline at end of file diff --git a/continuous_integration/recipe/meta.yaml b/continuous_integration/recipe/meta.yaml index 48cc8b748..fbe498eda 100644 --- a/continuous_integration/recipe/meta.yaml +++ b/continuous_integration/recipe/meta.yaml @@ -13,19 +13,17 @@ source: build: number: {{ GIT_DESCRIBE_NUMBER }} - skip: true # [py2k] entry_points: - dask-sql-server = dask_sql.server.app:main - dask-sql = dask_sql.cmd:main string: py{{ python | replace(".", "") }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - script: RUST_BACKTRACE=full {{ PYTHON }} -m pip install . --no-deps -vv requirements: build: - python # [build_platform != target_platform] - cross-python_{{ target_platform }} # [build_platform != target_platform] - maturin # [build_platform != target_platform] - - libprotobuf # [build_platform != target_platform] + - libprotobuf - zlib # [build_platform != target_platform] - {{ compiler('c') }} - {{ compiler('rust') }} @@ -33,7 +31,6 @@ requirements: - pip - python - maturin - - libprotobuf - zlib - xz # [linux64] run: