From 83736b6b5996f4a3f6f526ca395b049c766fb82d Mon Sep 17 00:00:00 2001 From: memento Date: Tue, 16 Jul 2024 09:54:24 -0500 Subject: [PATCH 01/22] (wip) aarch64: cross cmake attempt --- .ci_support/linux_aarch64_.yaml | 240 ++++++++++++++++++ recipe/build.sh | 14 +- recipe/build_scripts/_build_qemu_execve.sh | 41 +++ recipe/build_scripts/_functions.sh | 61 +++-- .../cross-cmake-linux-aarch64.sh | 105 ++++++++ .../cross-cmake-linux-ppc64le.sh | 45 ++++ .../build_scripts/cross-zig-linux-aarch64.sh | 2 +- recipe/build_scripts/native-cmake-linux-64.sh | 2 - recipe/build_scripts/native-cmake-osx-64.sh | 31 +++ recipe/meta.yaml | 11 + .../patches/0002-cross-CMakeLists.txt.patch | 150 +++++++++++ recipe/patches/xxxx-qemu-execve.patch | 142 +++++++++++ 12 files changed, 821 insertions(+), 23 deletions(-) create mode 100644 recipe/build_scripts/_build_qemu_execve.sh create mode 100644 recipe/build_scripts/cross-cmake-linux-aarch64.sh create mode 100644 recipe/build_scripts/cross-cmake-linux-ppc64le.sh create mode 100644 recipe/build_scripts/native-cmake-osx-64.sh create mode 100644 recipe/patches/0002-cross-CMakeLists.txt.patch create mode 100644 recipe/patches/xxxx-qemu-execve.patch diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index dc14145d1..e4a161e82 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -33,3 +33,243 @@ zlib: - '1' zstd: - '1.5' +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-aarch64-static diff --git a/recipe/build.sh b/recipe/build.sh index 977266710..e34c3e828 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -2,18 +2,24 @@ set -euxo pipefail +if [[ "${BUILD_WITH_CMAKE:-0}" == "0" ]]; then + builder=zig +else + builder=cmake +fi + case "${target_platform}" in linux-64) - bash "${RECIPE_DIR}"/build_scripts/native-zig-linux-64.sh + bash "${RECIPE_DIR}"/build_scripts/native-"${builder}"-linux-64.sh ;; osx-64) - bash "${RECIPE_DIR}"/build_scripts/native-zig-osx-64.sh + bash "${RECIPE_DIR}"/build_scripts/native-"${builder}"-osx-64.sh ;; linux-aarch64) - bash "${RECIPE_DIR}"/build_scripts/cross-zig-linux-aarch64.sh + bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-linux-aarch64.sh ;; osx-arm64) - bash "${RECIPE_DIR}"/build_scripts/cross-zig-osx-arm64.sh + bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-osx-arm64.sh ;; *) echo "Unsupported target_platform: ${target_platform}" diff --git a/recipe/build_scripts/_build_qemu_execve.sh b/recipe/build_scripts/_build_qemu_execve.sh new file mode 100644 index 000000000..ec4763922 --- /dev/null +++ b/recipe/build_scripts/_build_qemu_execve.sh @@ -0,0 +1,41 @@ +function build_qemu_execve() { + local arch=${1:-"aarch64"} + + mkdir -p "${SRC_DIR}"/_qemu_execve + cd "${SRC_DIR}"/_qemu_execve + # git clone https://github.com/balena-io/qemu.git + git clone https://gitlab.com/qemu-project/qemu.git + patch -p0 < "${RECIPE_DIR}"/patches/xxxx-qemu-execve.patch + + mkdir _conda-build + cd _conda-build + export PKG_CONFIG="${BUILD_PREFIX}/bin/pkg-config" + export PKG_CONFIG_PATH="${BUILD_PREFIX}/lib/pkgconfig" + export PKG_CONFIG_LIBDIR="${BUILD_PREFIX}/lib/pkgconfig" + export CC="${CC_FOR_BUILD}" + export CXX="${CXX_FOR_BUILD}" + export CFLAGS=$(echo "$CFLAGS" | sed 's#\$PREFIX#\$BUILD_PREFIX#g' | sed "s#$PREFIX#$BUILD_PREFIX#g") + export CXXFLAGS=$(echo "$CXXFLAGS" | sed 's#\$PREFIX#\$BUILD_PREFIX#g' | sed "s#$PREFIX#$BUILD_PREFIX#g") + export LDFLAGS=$(echo "$LDFLAGS" | sed 's#\$PREFIX#\$BUILD_PREFIX#g' | sed "s#$PREFIX#$BUILD_PREFIX#g") + + ../qemu/configure --prefix="${BUILD_PREFIX}" \ + --interp-prefix="${BUILD_PREFIX}" \ + --enable-linux-user --target-list="${arch}"-linux-user > _configure_qemu.log 2>&1 + # --disable-bsd-user --disable-guest-agent --disable-strip --disable-werror --disable-gcrypt --disable-pie \ + # --disable-debug-info --disable-debug-tcg --enable-docs --disable-tcg-interpreter --enable-attr \ + # --disable-brlapi --disable-linux-aio --disable-bzip2 --disable-cap-ng --disable-curl --disable-fdt \ + # --disable-glusterfs --disable-gnutls --disable-nettle --disable-gtk --disable-rdma --disable-libiscsi \ + # --disable-vnc-jpeg --disable-kvm --disable-lzo --disable-curses --disable-libnfs --disable-numa \ + # --disable-opengl --disable-vnc-png --disable-rbd --disable-vnc-sasl --disable-sdl --disable-seccomp \ + # --disable-smartcard --disable-snappy --disable-spice --disable-libusb --disable-usb-redir --disable-vde \ + # --disable-vhost-net --disable-virglrenderer --disable-virtfs --disable-vnc --disable-vte --disable-xen \ + # --disable-xen-pci-passthrough --disable-system --disable-blobs --disable-tools \ + make -j"${CPU_COUNT}" > _make_qemu.log 2>&1 + make install > install_qemu.log 2>&1 + + # Patch the interpreter + patchelf --set-interpreter "${BUILD_PREFIX}/x86_64-conda-linux-gnu/sysroot/lib64/ld-linux-x86-64.so.2" "${BUILD_PREFIX}/bin/qemu-${arch}" + patchelf --set-rpath "\$ORIGIN/../x86_64-conda-linux-gnu/sysroot/lib64" "${BUILD_PREFIX}/bin/qemu-${arch}" + patchelf --add-rpath "\$ORIGIN/../lib" "${BUILD_PREFIX}/bin/qemu-${arch}" + cd "${SRC_DIR}" +} diff --git a/recipe/build_scripts/_functions.sh b/recipe/build_scripts/_functions.sh index 48196fd74..0227ed632 100644 --- a/recipe/build_scripts/_functions.sh +++ b/recipe/build_scripts/_functions.sh @@ -5,11 +5,23 @@ function cmake_build_install() { current_dir=$(pwd) cd "${build_dir}" || exit 1 - cmake --build . -- -j"${CPU_COUNT}" + cmake --build . -v -- -j"${CPU_COUNT}" cmake --install . cd "${current_dir}" || exit 1 } +function cmake_build_cmake_target() { + local build_dir=$1 + local target=$2 + + local current_dir + current_dir=$(pwd) + + cd "${build_dir}" || exit 1 + cmake --build . --target "${target}" -v -- -j"${CPU_COUNT}" + cd "${current_dir}" || exit 1 +} + function modify_libc_libm_for_zig() { local prefix=$1 @@ -54,17 +66,17 @@ function configure_cmake_zigcpp() { EXTRA_CMAKE_ARGS+=("-DZIG_AR_WORKAROUND=ON") fi + if [[ ${USE_CMAKE_ARGS:-0} == 1 ]]; then + # Split $CMAKE_ARGS into an array + IFS=' ' read -r -a cmake_args_array <<< "$CMAKE_ARGS" + EXTRA_CMAKE_ARGS+=("${cmake_args_array[@]}") + fi + cmake "${SRC_DIR}"/zig-source \ -D CMAKE_INSTALL_PREFIX="${install_dir}" \ "${EXTRA_CMAKE_ARGS[@]}" \ -G Ninja - if [[ "${target_platform}" == "osx-64" ]]; then - sed -i '' "s@;-lm@;$PREFIX/lib/libc++.dylib;-lm@" config.h - elif [[ "${target_platform}" == "osx-arm64" ]]; then - sed -i '' "s@libLLVMXRay.a@libLLVMXRay.a;$PREFIX/lib/libxml2.dylib;$PREFIX/lib/libzstd.dylib;$PREFIX/lib/libz.dylib@" "${cmake_build_dir}/config.h" - fi - cmake --build . --target zigcpp -- -j"${CPU_COUNT}" cd "${current_dir}" || exit 1 } @@ -99,18 +111,35 @@ function build_zig_with_zig() { fi } -function patchelf_installed_zig() { - local install_dir=$1 +function patchelf_with_2.28() { + local _exec=$1 local _prefix=$2 - patchelf --remove-rpath "${install_dir}/bin/zig" - patchelf --set-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${install_dir}/bin/zig" - patchelf --add-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/lib" "${install_dir}/bin/zig" - patchelf --add-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/usr/lib64" "${install_dir}/bin/zig" - patchelf --add-rpath "${_prefix}/lib" "${install_dir}/bin/zig" - patchelf --add-rpath "${PREFIX}/lib" "${install_dir}/bin/zig" + patchelf --remove-rpath "${_exec}" + patchelf --set-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${_exec}" + patchelf --add-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/lib" "${_exec}" + patchelf --add-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/usr/lib64" "${_exec}" + patchelf --add-rpath "${_prefix}/lib" "${_exec}" + patchelf --add-rpath "${PREFIX}/lib" "${_exec}" + + patchelf --set-interpreter "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-2.28.so" "${_exec}" +} + +function patchelf_replace_2.28() { + local _exec=$1 + local _prefix=$2 + + patchelf --remove-rpath "${_exec}" + patchelf --set-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${_exec}" + patchelf --add-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/lib" "${_exec}" + patchelf --add-rpath "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/usr/lib64" "${_exec}" + patchelf --add-rpath "${_prefix}/lib" "${_exec}" + patchelf --add-rpath "${PREFIX}/lib" "${_exec}" + + # patchelf --replace-needed "libc.so.6" "libc-2.28.so" "${_exec}" + # patchelf --replace-needed "ld-linux-aarch64.so.1" "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1" "${_exec}" - patchelf --set-interpreter "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-2.28.so" "${install_dir}/bin/zig" + # patchelf --set-interpreter "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-2.28.so" "${_exec}" } function remove_failing_langref() { diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh new file mode 100644 index 000000000..46e76e239 --- /dev/null +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# --- Functions --- + +source "${RECIPE_DIR}/build_scripts/_functions.sh" + +# --- Main --- + +export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" +export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" + +cmake_build_dir="${SRC_DIR}/build-release" + +mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" + +mkdir -p "${SRC_DIR}"/build-level-patches +cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/build-level-patches + +# Current conda zig may not be able to build the latest zig +# mamba create -yp "${SRC_DIR}"/conda-zig-bootstrap zig +SYSROOT_ARCH="aarch64" +SYSROOT_PATH="${PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot" + +EXTRA_CMAKE_ARGS+=( \ + "-DCMAKE_PREFIX_PATH=${PREFIX};${SYSROOT_PATH}" \ + "-DCMAKE_C_COMPILER=${CC}" \ + "-DCMAKE_CXX_COMPILER=${CXX}" \ + "-DZIG_SHARED_LLVM=ON" \ + "-DZIG_USE_LLVM_CONFIG=ON" \ + "-DZIG_TARGET_DYNAMIC_LINKER=${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" \ +) +# "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-linux-gnu" \ + +source "${RECIPE_DIR}/build_scripts/_build_qemu_execve.sh" +build_qemu_execve "${SYSROOT_ARCH}" + +# export CROSSCOMPILING_EMULATOR="${BUILD_PREFIX}/bin/qemu-${SYSROOT_ARCH}" +export QEMU_LD_PREFIX="${SYSROOT_PATH}" +export QEMU_LOG_FILENAME="${SRC_DIR}/_qemu_%d.log" +export QEMU_LOG="strace" +export QEMU_SET_ENV="LD_LIBRARY_PATH=${SYSROOT_PATH}/lib64:${LD_LIBRARY_PATH:-}" +export QEMU_SET_ENV="LD_PRELOAD=${SYSROOT_PATH}/lib64/libdl.so.2:${SYSROOT_PATH}/lib64/libc.so.6:${SYSROOT_PATH}/lib64/libm.so.6" +export QEMU_STACK_SIZE="67108864" +export QEMU_EXECVE="${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" + +export CFLAGS="${CFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" +export CXXFLAGS="${CXXFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" + +export CROSSCOMPILING_LIBC="Wl,-dynamic-linker,${SYSROOT_PATH}//lib64/ld-linux-aarch64.so.1;-L${SYSROOT_PATH}/lib64;-lc" + +export ZIG_CROSS_TARGET_TRIPLE="${SYSROOT_ARCH}"-linux-gnu +export ZIG_CROSS_TARGET_MCPU="native" + +# When using installed c++ libs, zig needs libzigcpp.a +USE_CMAKE_ARGS=1 + +# Patch ld.lld to use the correct interpreter +patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${PREFIX}/bin/ld.lld" +patchelf --set-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/ld.lld" +patchelf --add-rpath "\$ORIGIN/../aarch64-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/ld.lld" +patchelf --add-needed "libdl.so.2" "${PREFIX}/bin/ld.lld" +patchelf --add-needed "librt.so.1" "${PREFIX}/bin/ld.lld" +patchelf --add-needed "libm.so.6" "${PREFIX}/bin/ld.lld" + +configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" +cat <> "${cmake_build_dir}/config.zig" +pub const mem_leak_frames = 0; +EOF + +# remove_failing_langref "${cmake_build_dir}" +cmake_build_cmake_target "${cmake_build_dir}" zig-wasm2c +cmake_build_cmake_target "${cmake_build_dir}" zig1 +cmake_build_cmake_target "${cmake_build_dir}" zig2 + +# patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${PREFIX}/bin/ld.lld" +cd "${cmake_build_dir}" || exit 1 + export QEMU_LOG_FILENAME="${SRC_DIR}/_qemu_%d.log" + "${CROSSCOMPILING_EMULATOR}" "${SRC_DIR}"/build-release/zig2 build || true + export QEMU_LOG_FILENAME="${SRC_DIR}/_qemu_execve_%d.log" + + # Patch zig2 to use the correct interpreter + patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${SRC_DIR}"/build-release/zig2 + patchelf --set-rpath "${PREFIX}"/lib "${SRC_DIR}"/build-release/zig2 + patchelf --add-rpath "${SYSROOT_PATH}"/lib64 "${SRC_DIR}"/build-release/zig2 + patchelf --add-needed "libdl.so.2" "${SRC_DIR}"/build-release/zig2 + patchelf --add-needed "librt.so.1" "${SRC_DIR}"/build-release/zig2 + patchelf --add-needed "libm.so.6" "${SRC_DIR}"/build-release/zig2 + + # Patch ld.lld to use the correct interpreter + patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${PREFIX}/bin/ld.lld" + patchelf --set-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/ld.lld" + patchelf --add-rpath "\$ORIGIN/../aarch64-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/ld.lld" + patchelf --add-needed "libdl.so.2" "${PREFIX}/bin/ld.lld" + patchelf --add-needed "librt.so.1" "${PREFIX}/bin/ld.lld" + patchelf --add-needed "libm.so.6" "${PREFIX}/bin/ld.lld" + + export QEMU_SET_ENV="PATH=${PREFIX}/bin:${PATH:-}" + + "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 env + "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 libc + "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 help + "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 build +cd "${SRC_DIR}" || exit 1 +cmake_build_install "${cmake_build_dir}" diff --git a/recipe/build_scripts/cross-cmake-linux-ppc64le.sh b/recipe/build_scripts/cross-cmake-linux-ppc64le.sh new file mode 100644 index 000000000..a7a08c529 --- /dev/null +++ b/recipe/build_scripts/cross-cmake-linux-ppc64le.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# --- Functions --- + +source "${RECIPE_DIR}/build_scripts/_functions.sh" + +# --- Main --- + +export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" +export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" + +cmake_build_dir="${SRC_DIR}/build-release" + +mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" + +mkdir -p "${SRC_DIR}"/build-level-patches +cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/build-level-patches + +# Current conda zig may not be able to build the latest zig +# mamba create -yp "${SRC_DIR}"/conda-zig-bootstrap zig +SYSROOT_ARCH="aarch64" + +EXTRA_CMAKE_ARGS+=( \ + "-DZIG_SHARED_LLVM=ON" \ + "-DZIG_USE_LLVM_CONFIG=ON" \ + "-DZIG_TARGET_TRIPLE=x86_64-linux-gnu" \ + "-DZIG_DYNAMIC_LINKER=${PREFIX}/lib/ld-linux-ppc64le.so.2" \ +) +# Zig searches for libm.so/libc.so in incorrect paths (libm.so with hard-coded /usr/lib64/libmvec_nonshared.a) +modify_libc_libm_for_zig "${BUILD_PREFIX}" + +if [[ "${CROSSCOMPILING_EMULATOR:-0}" == *"qemu"* ]]; then + # This is a hack to make zig use the correct qemu binary + ln -s "${CROSSCOMPILING_EMULATOR}" "${BUILD_PREFIX}/bin/qemu-${SYSROOT_ARCH}" + export CROSSCOMPILING_EMULATOR="${CROSSCOMPILING_EMULATOR}" + export ZIG_CROSS_TARGET_TRIPLE="${SYSROOT_ARCH}"-linux-gnu +fi + +# When using installed c++ libs, zig needs libzigcpp.a +configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" +# remove_failing_langref "${cmake_build_dir}" +cmake_build_zig2 "${cmake_build_dir}" +patchelf_for_2.28 "${cmake_build_dir}/zig2" "${PREFIX}" +cmake_build_install "${cmake_build_dir}" diff --git a/recipe/build_scripts/cross-zig-linux-aarch64.sh b/recipe/build_scripts/cross-zig-linux-aarch64.sh index e039f6393..2ed6caca2 100644 --- a/recipe/build_scripts/cross-zig-linux-aarch64.sh +++ b/recipe/build_scripts/cross-zig-linux-aarch64.sh @@ -49,4 +49,4 @@ EXTRA_ZIG_ARGS+=( \ mkdir -p "${SRC_DIR}/conda-zig-source" && cp -r "${SRC_DIR}"/zig-source/* "${SRC_DIR}/conda-zig-source" remove_failing_langref "${SRC_DIR}/conda-zig-source" build_zig_with_zig "${SRC_DIR}/conda-zig-source" "${zig}" "${PREFIX}" -patchelf_installed_zig "${PREFIX}" "${PREFIX}" +patchelf_with_ld-2.28 "${PREFIX}/bin/zig" "${PREFIX}" diff --git a/recipe/build_scripts/native-cmake-linux-64.sh b/recipe/build_scripts/native-cmake-linux-64.sh index cfbbc8be7..e2ef09c6c 100644 --- a/recipe/build_scripts/native-cmake-linux-64.sh +++ b/recipe/build_scripts/native-cmake-linux-64.sh @@ -13,8 +13,6 @@ export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" cmake_build_dir="${SRC_DIR}/build-release" mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" -# Current conda zig may not be able to build the latest zig - using a bootstrap zig -# mamba create -yp "${SRC_DIR}"/conda-zig-bootstrap zig SYSROOT_ARCH="x86_64" EXTRA_CMAKE_ARGS+=( \ diff --git a/recipe/build_scripts/native-cmake-osx-64.sh b/recipe/build_scripts/native-cmake-osx-64.sh new file mode 100644 index 000000000..108558175 --- /dev/null +++ b/recipe/build_scripts/native-cmake-osx-64.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# --- Functions --- + +source "${RECIPE_DIR}/build_scripts/_functions.sh" + +# --- Main --- + +export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" +export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" + +cmake_build_dir="${SRC_DIR}/build-release" +cmake_install_dir="${SRC_DIR}/cmake-built-install" + +mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" + +# Current conda zig may not be able to build the latest zig +SYSROOT_ARCH="x86_64" + +EXTRA_CMAKE_ARGS+=( \ + "-DZIG_SHARED_LLVM=ON" \ + "-DZIG_USE_LLVM_CONFIG=ON" \ + "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-macos-none" \ +) + +# When using installed c++ libs, zig needs libzigcpp.a +configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" +sed -i '' "s@;-lm@;$PREFIX/lib/libc++.dylib;-lm@" "${cmake_build_dir}"/config.h +cmake_build_install "${cmake_build_dir}" + diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 57234c59a..401338926 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,6 +11,7 @@ source: sha256: d3912858003e340f315224bf177d0f441d86b81f62854f5c141b6d51ab6b5516 patches: - patches/0001-cross-findllvm.patch # [linux and aarch64] + - patches/0002-cross-CMakeLists.txt.patch # [build_platform != target_platform] folder: zig-source # We use the upstrean binary as bootstrap. Installing previous conda version of zig @@ -26,6 +27,8 @@ source: build: number: 1 skip: true # [not linux and not osx] + script_env: + - BUILD_WITH_CMAKE=1 # [linux or (osx and x86_64)] ignore_run_exports: - __glibc @@ -36,6 +39,14 @@ requirements: - {{ stdlib("c") }} - cmake >=3.5 - ninja + # This is needed to build a qemu that intercepts the execve() call that zig2 emits + - glib # [linux and build_platform != target_platform] + - make # [linux and build_platform != target_platform] + - pkg-config # [linux and build_platform != target_platform] + - sphinx # [linux and build_platform != target_platform] + - sphinx-rtd-theme # [linux and build_platform != target_platform] + - sysroot_linux-64 >=2.28 # [linux and build_platform != target_platform] + - zlib # [linux and build_platform != target_platform] host: - clangdev {{ llvm_version }} - llvmdev {{ llvm_version }} diff --git a/recipe/patches/0002-cross-CMakeLists.txt.patch b/recipe/patches/0002-cross-CMakeLists.txt.patch new file mode 100644 index 000000000..03cc0fdc6 --- /dev/null +++ b/recipe/patches/0002-cross-CMakeLists.txt.patch @@ -0,0 +1,150 @@ +--- CMakeLists.txt.old 2024-06-06 14:05:11.000000000 -0500 ++++ CMakeLists.txt 2024-07-05 15:35:21.268292096 -0500 +@@ -91,2 +91,3 @@ + set(ZIG_STATIC_ZSTD ${ZIG_STATIC} CACHE BOOL "Prefer linking against static zstd") ++set(ZIG_STATIC_XML2 ${ZIG_STATIC} CACHE BOOL "Prefer linking against static xml2") + if(APPLE AND ZIG_STATIC) +@@ -152,2 +153,5 @@ + list(APPEND LLVM_LIBRARIES "${ZLIB}") ++else() ++ find_library(ZLIB NAMES z zlib libz libz.a libzlibstatic.a NAMES_PER_DIR) ++ list(APPEND LLVM_LIBRARIES "${ZLIB}") + endif() +@@ -163,2 +167,19 @@ + list(APPEND LLVM_LIBRARIES "${ZSTD}") ++else() ++ find_library(ZSTD NAMES zstd libzstd.a libzstdstatic.a NAMES_PER_DIR) ++ list(APPEND LLVM_LIBRARIES "${ZSTD}") ++endif() ++ ++if(ZIG_STATIC_XML2) ++ if (MSVC) ++ list(REMOVE_ITEM LLVM_LIBRARIES "xml2.lib") ++ else() ++ list(REMOVE_ITEM LLVM_LIBRARIES "-lxml2") ++ endif() ++ ++ find_library(XML2 NAMES libxml2.a xml2 NAMES_PER_DIR) ++ list(APPEND LLVM_LIBRARIES "${XML2}") ++else() ++ find_library(XML2 NAMES xml2 libxml2 libxml2.a NAMES_PER_DIR) ++ list(APPEND LLVM_LIBRARIES "${XML2}") + endif() +@@ -722,3 +743,3 @@ + -fno-rtti +- -fno-stack-protector ++ # -fno-stack-protector + +@@ -729,6 +750,8 @@ + -Wno-comment ++ -Os + ) + else() +-target_compile_options(zigcpp PRIVATE /Zc:preprocessor) +-set_property(TARGET zigcpp PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded") ++ target_compile_options(zigcpp PRIVATE -MD) ++ target_compile_options(zigcpp PRIVATE /Zc:preprocessor) ++ set_property(TARGET zigcpp PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded") + endif() +@@ -808,2 +831,28 @@ + set(ZIG_HOST_TARGET_TRIPLE "${ZIG_HOST_TARGET_ARCH}-${ZIG_HOST_TARGET_OS}${ZIG_HOST_TARGET_ABI}" CACHE STRING "Host zig target triple.") ++if(DEFINED ENV{CROSSCOMPILING_EMULATOR}) ++ set(CROSSCOMPILING_EMULATOR $ENV{CROSSCOMPILING_EMULATOR}) ++ if(NOT DEFINED ENV{CROSSCOMPILING_LIBC}) ++ set(CROSSCOMPILING_LIBC "-lc") ++ else() ++ set(CROSSCOMPILING_LIBC $ENV{CROSSCOMPILING_LIBC}) ++ message(STATUS "Setting CROSSCOMPILING_LIBC ${CROSSCOMPILING_LIBC}") ++ endif() ++ if(DEFINED ENV{ZIG_CROSS_TARGET_TRIPLE}) ++ set(ZIG_CROSS_TARGET_TRIPLE $ENV{ZIG_CROSS_TARGET_TRIPLE} CACHE STRING "Host zig target triple.") ++ message(STATUS "Setting ZIG_CROSS_TARGET_TRIPLE ${ZIG_CROSS_TARGET_TRIPLE}") ++ else() ++ message(SEND_ERROR "ZIG_CROSS_TARGET_TRIPLE is not set while cross-compiling") ++ endif() ++ if(DEFINED ENV{ZIG_CROSS_TARGET_MCPU}) ++ set(ZIG_CROSS_TARGET_MCPU $ENV{ZIG_CROSS_TARGET_MCPU} CACHE STRING "Host zig target cpu.") ++ message(STATUS "Setting ZIG_CROSS_TARGET_MCPU ${ZIG_CROSS_TARGET_MCPU}") ++ else() ++ set(ZIG_CROSS_TARGET_MCPU "baseline" CACHE STRING "Host zig target cpu.") ++ message(STATUS "Setting ZIG_CROSS_TARGET_MCPU ${ZIG_CROSS_TARGET_MCPU}") ++ endif() ++else() ++ set(CROSSCOMPILING_EMULATOR "") ++ set(ZIG_CROSS_TARGET_TRIPLE ${ZIG_TARGET_TRIPLE}) ++ set(ZIG_CROSS_TARGET_MCPU ${ZIG_TARGET_MCPU}) ++endif() + +@@ -815,5 +864,11 @@ + else() +- set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2") +- set(ZIG1_COMPILE_FLAGS "-std=c99 -Os") +- set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-stack-protector") ++ if(ZIG_HOST_TARGET_ARCH MATCHES "powerpc64le") ++ set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2") ++ set(ZIG1_COMPILE_FLAGS "-std=c99 -Os") ++ set(ZIG2_COMPILE_FLAGS "-std=c99 -Os -fno-stack-protector --save-temps") ++ else() ++ set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2") ++ set(ZIG1_COMPILE_FLAGS "-std=c99 -Os") ++ set(ZIG2_COMPILE_FLAGS "-std=c99 -Os") ++ endif() + if(APPLE) +@@ -840,3 +895,3 @@ + OUTPUT "${ZIG1_C_SOURCE}" +- COMMAND zig-wasm2c "${ZIG1_WASM_MODULE}" "${ZIG1_C_SOURCE}" ++ COMMAND ${CROSSCOMPILING_EMULATOR} ${PROJECT_BINARY_DIR}/zig-wasm2c "${ZIG1_WASM_MODULE}" "${ZIG1_C_SOURCE}" + DEPENDS zig-wasm2c "${ZIG1_WASM_MODULE}" +@@ -852,3 +907,9 @@ + else() +- target_link_libraries(zig1 LINK_PUBLIC m) ++ if(WIN32) ++ find_library(M NAMES m libm.lib NAMES_PER_DIR) ++ target_link_libraries(zig1 LINK_PUBLIC $M) ++ # target_link_libraries(zig1 LINK_PUBLIC $ENV{PREFIX}/Library/lib/libm.lib) ++ else() ++ target_link_libraries(zig1 LINK_PUBLIC m) ++ endif() + if(MINGW) +@@ -858,8 +919,11 @@ + ++if(NOT DEFINED ZIG_CROSS_TARGET_TRIPLE) ++ set(ZIG_CROSS_TARGET_TRIPLE ${ZIG_HOST_TARGET_TRIPLE}) ++endif() + set(BUILD_ZIG2_ARGS + "${PROJECT_SOURCE_DIR}/lib" +- build-exe -ofmt=c -lc -OReleaseSmall ++ build-exe -ofmt=c "${CROSSCOMPILING_LIBC}" -OReleaseSmall + --name zig2 + -femit-bin="${ZIG2_C_SOURCE}" +- -target "${ZIG_HOST_TARGET_TRIPLE}" ++ -target "${ZIG_CROSS_TARGET_TRIPLE}" + --dep "build_options" +@@ -873,3 +937,3 @@ + OUTPUT "${ZIG2_C_SOURCE}" +- COMMAND zig1 ${BUILD_ZIG2_ARGS} ++ COMMAND ${CROSSCOMPILING_EMULATOR} ${PROJECT_BINARY_DIR}/zig1 ${BUILD_ZIG2_ARGS} + DEPENDS zig1 "${ZIG_STAGE2_SOURCES}" +@@ -884,3 +948,3 @@ + -femit-bin="${ZIG_COMPILER_RT_C_SOURCE}" +- -target "${ZIG_HOST_TARGET_TRIPLE}" ++ -target "${ZIG_CROSS_TARGET_TRIPLE}" + --dep "build_options" +@@ -892,3 +956,3 @@ + OUTPUT "${ZIG_COMPILER_RT_C_SOURCE}" +- COMMAND zig1 ${BUILD_COMPILER_RT_ARGS} ++ COMMAND ${CROSSCOMPILING_EMULATOR} ${PROJECT_BINARY_DIR}/zig1 ${BUILD_COMPILER_RT_ARGS} + DEPENDS zig1 "${ZIG_STAGE2_SOURCES}" +@@ -931,4 +995,4 @@ + "-Dversion-string=${RESOLVED_ZIG_VERSION}" +- "-Dtarget=${ZIG_TARGET_TRIPLE}" +- "-Dcpu=${ZIG_TARGET_MCPU}" ++ "-Dtarget=${ZIG_CROSS_TARGET_TRIPLE}" ++ "-Dcpu=${ZIG_CROSS_TARGET_MCPU}" + +@@ -978,3 +1042,4 @@ + OUTPUT "${PROJECT_BINARY_DIR}/stage3/bin/zig" +- COMMAND zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} ++ COMMAND ${CROSSCOMPILING_EMULATOR} ${PROJECT_BINARY_DIR}/zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} ++ DEPENDS zig2 + COMMENT STATUS "Building stage3" diff --git a/recipe/patches/xxxx-qemu-execve.patch b/recipe/patches/xxxx-qemu-execve.patch new file mode 100644 index 000000000..e755e1838 --- /dev/null +++ b/recipe/patches/xxxx-qemu-execve.patch @@ -0,0 +1,142 @@ +--- qemu/linux-user/main.c.orig 2024-07-13 15:31:51.826834383 -0500 ++++ qemu/linux-user/main.c 2024-07-13 16:17:44.996484934 -0500 +@@ -128,2 +128,3 @@ + const char *qemu_uname_release; ++const char *qemu_execve_path; + +@@ -378,2 +379,7 @@ + ++static void handle_arg_execve(const char *arg) ++{ ++ qemu_execve_path = strdup(arg); ++} ++ + static void handle_arg_reserved_va(const char *arg) +@@ -494,2 +500,4 @@ + "address", "set guest_base address to 'address'"}, ++ {"execve", "QEMU_EXECVE", true, handle_arg_execve, ++ "path", "use interpreter at 'path' when a process calls execve()"}, + {"R", "QEMU_RESERVED_VA", true, handle_arg_reserved_va, +--- qemu/linux-user/user-internals.h.orig 2024-07-13 15:31:51.834834526 -0500 ++++ qemu/linux-user/user-internals.h 2024-07-13 16:22:08.113225373 -0500 +@@ -30,2 +30,3 @@ + extern const char *qemu_uname_release; ++extern const char *qemu_execve_path; + extern unsigned long mmap_min_addr; +--- qemu/linux-user/syscall.c.orig 2024-07-13 15:31:51.834834526 -0500 ++++ qemu/linux-user/syscall.c 2024-07-13 18:42:00.033718159 -0500 +@@ -8416,2 +8416,105 @@ + } ++ ++#define BINPRM_BUF_SIZE 128 ++ ++/* qemu_execve() Must return target values and target errnos. */ ++static abi_long qemu_execve(const char *filename, char *argv[], ++ char *envp[]) ++{ ++ char *i_arg = NULL, *i_name = NULL; ++ char **new_argp; ++ int argc, fd, ret, i, offset = 3; ++ char *cp; ++ char buf[BINPRM_BUF_SIZE]; ++ ++ for (argc = 0; argv[argc] != NULL; argc++) { ++ /* nothing */ ; ++ } ++ ++ fd = open(filename, O_RDONLY); ++ if (fd == -1) { ++ return -ENOENT; ++ } ++ ++ ret = read(fd, buf, BINPRM_BUF_SIZE); ++ if (ret == -1) { ++ close(fd); ++ return -ENOENT; ++ } ++ ++ close(fd); ++ ++ /* adapted from the kernel ++ * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/fs/binfmt_script.c ++ */ ++ if ((buf[0] == '#') && (buf[1] == '!')) { ++ /* ++ * This section does the #! interpretation. ++ * Sorta complicated, but hopefully it will work. -TYT ++ */ ++ ++ buf[BINPRM_BUF_SIZE - 1] = '\0'; ++ cp = strchr(buf, '\n'); ++ if (cp == NULL) { ++ cp = buf+BINPRM_BUF_SIZE-1; ++ } ++ *cp = '\0'; ++ while (cp > buf) { ++ cp--; ++ if ((*cp == ' ') || (*cp == '\t')) { ++ *cp = '\0'; ++ } else { ++ break; ++ } ++ } ++ for (cp = buf+2; (*cp == ' ') || (*cp == '\t'); cp++) { ++ /* nothing */ ; ++ } ++ if (*cp == '\0') { ++ return -ENOEXEC; /* No interpreter name found */ ++ } ++ i_name = cp; ++ i_arg = NULL; ++ for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++) { ++ /* nothing */ ; ++ } ++ while ((*cp == ' ') || (*cp == '\t')) { ++ *cp++ = '\0'; ++ } ++ if (*cp) { ++ i_arg = cp; ++ } ++ ++ if (i_arg) { ++ offset = 5; ++ } else { ++ offset = 4; ++ } ++ } ++ ++ new_argp = alloca((argc + offset + 1) * sizeof(void *)); ++ ++ /* Copy the original arguments with offset */ ++ for (i = 0; i < argc; i++) { ++ new_argp[i + offset] = argv[i]; ++ } ++ ++ new_argp[0] = strdup(qemu_execve_path); ++ new_argp[1] = strdup("-0"); ++ strcpy(new_argp[offset], filename); ++ new_argp[argc + offset] = NULL; ++ ++ if (i_name) { ++ new_argp[2] = i_name; ++ new_argp[3] = i_name; ++ ++ if (i_arg) { ++ new_argp[4] = i_arg; ++ } ++ } else { ++ new_argp[2] = argv[0]; ++ } ++ qemu_log_mask(LOG_GUEST_ERROR, "execve(\"%s\")\n", qemu_execve_path); ++ return get_errno(execve(qemu_execve_path, new_argp, envp)); ++} + +@@ -8534,3 +8639,6 @@ + ? safe_execveat(dirfd, exe, argp, envp, flags) +- : safe_execve(exe, argp, envp); ++ : ((qemu_execve_path && *qemu_execve_path) ++ ? get_errno(qemu_execve(exe, argp, envp)) ++ : safe_execve(exe, argp, envp)); ++ qemu_log_mask(LOG_GUEST_ERROR, "execve(\"%s\", %p, %p, %d)\n", exe ? (char *)exe : (char *)p, argp, envp, is_execveat); + + ret = get_errno(ret); From 6482e87a99bf6be6c85f5893a08a11ef40e79ec0 Mon Sep 17 00:00:00 2001 From: memento Date: Sun, 21 Jul 2024 21:09:49 -0500 Subject: [PATCH 02/22] (wip) aarch64: cross cmake attempt --- .ci_support/linux_aarch64_.yaml | 240 ------------------ .scripts/build_steps.sh | 1 - recipe/build_scripts/_build_qemu_execve.sh | 7 + recipe/build_scripts/_functions.sh | 25 +- .../cross-cmake-linux-aarch64.sh | 90 +++---- recipe/build_scripts/native-cmake-linux-64.sh | 1 + recipe/build_scripts/native-cmake-osx-64.sh | 3 +- recipe/meta.yaml | 6 +- .../patches/0002-cross-CMakeLists.txt.patch | 6 +- recipe/patches/0003-cross-install.cmake.patch | 15 ++ recipe/patches/xxxx-qemu-execve.patch | 19 +- 11 files changed, 99 insertions(+), 314 deletions(-) create mode 100644 recipe/patches/0003-cross-install.cmake.patch diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index e4a161e82..dc14145d1 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -33,243 +33,3 @@ zlib: - '1' zstd: - '1.5' -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-aarch64-static diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index a5836e8df..ba4b251cf 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -72,7 +72,6 @@ else --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" - ( startgroup "Inspecting artifacts" ) 2> /dev/null # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 diff --git a/recipe/build_scripts/_build_qemu_execve.sh b/recipe/build_scripts/_build_qemu_execve.sh index ec4763922..a9b979967 100644 --- a/recipe/build_scripts/_build_qemu_execve.sh +++ b/recipe/build_scripts/_build_qemu_execve.sh @@ -37,5 +37,12 @@ function build_qemu_execve() { patchelf --set-interpreter "${BUILD_PREFIX}/x86_64-conda-linux-gnu/sysroot/lib64/ld-linux-x86-64.so.2" "${BUILD_PREFIX}/bin/qemu-${arch}" patchelf --set-rpath "\$ORIGIN/../x86_64-conda-linux-gnu/sysroot/lib64" "${BUILD_PREFIX}/bin/qemu-${arch}" patchelf --add-rpath "\$ORIGIN/../lib" "${BUILD_PREFIX}/bin/qemu-${arch}" + + export QEMU_LD_PREFIX="${SYSROOT_PATH}" + export QEMU_SET_ENV="LD_LIBRARY_PATH=${SYSROOT_PATH}/lib64:${LD_LIBRARY_PATH:-}" + export QEMU_EXECVE="${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} + export QEMU_STACK_SIZE=67108864 + export QEMU_LOG_FILENAME="${SRC_DIR}"/_qemu.log + export QEMU_LOG="strace" cd "${SRC_DIR}" } diff --git a/recipe/build_scripts/_functions.sh b/recipe/build_scripts/_functions.sh index 0227ed632..88e6b4921 100644 --- a/recipe/build_scripts/_functions.sh +++ b/recipe/build_scripts/_functions.sh @@ -94,12 +94,8 @@ function build_zig_with_zig() { export http_proxy=http://localhost if [[ -d "${build_dir}" ]]; then - if [[ "${CROSSCOMPILING_EMULATOR:-0}" == *"qemu"* ]]; then - ln -s "${CROSSCOMPILING_EMULATOR}" "${BUILD_PREFIX}/bin/qemu-${SYSROOT_ARCH}" - fi - cd "${build_dir}" || exit 1 - "${zig}" build \ + "${CROSSCOMPILING_EMULATOR:-}" "${zig}" build \ --prefix "${install_dir}" \ --search-prefix "${install_dir}" \ "${EXTRA_ZIG_ARGS[@]}" \ @@ -142,6 +138,25 @@ function patchelf_replace_2.28() { # patchelf --set-interpreter "${_prefix}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-2.28.so" "${_exec}" } +function patchelf_sysroot_interpreter() { + local _sysroot=$1 + local _interpreter=$2 + local _exec=$3 + local _add_lib=${4:-} + + patchelf --set-interpreter "${_interpreter}" "${_exec}" + patchelf --set-rpath "${PREFIX}"/lib "${_exec}" + if [[ -d "${_sysroot}"/lib64 ]]; then + patchelf --add-rpath "${_sysroot}"/lib64 "${_exec}" + fi + patchelf --add-rpath "${_sysroot}"/lib "${_exec}" + if [[ -n "${_add_lib}" ]]; then + patchelf --add-needed "libdl.so.2" "${_exec}" + patchelf --add-needed "librt.so.1" "${_exec}" + patchelf --add-needed "libm.so.6" "${_exec}" + fi +} + function remove_failing_langref() { local build_dir=$1 local testslistfile=${2:-"${SRC_DIR}"/build-level-patches/xxxx-remove-langref-std.txt} diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index 46e76e239..231e51efd 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -10,44 +10,42 @@ source "${RECIPE_DIR}/build_scripts/_functions.sh" export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" -cmake_build_dir="${SRC_DIR}/build-release" +cmake_build_dir="${SRC_DIR}/_conda-cmake-build" +zig_build_dir="${SRC_DIR}/_conda-zig-build" mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" -mkdir -p "${SRC_DIR}"/build-level-patches -cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/build-level-patches +mkdir -p "${SRC_DIR}"/_conda-build-level-patches +cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/_conda-build-level-patches # Current conda zig may not be able to build the latest zig # mamba create -yp "${SRC_DIR}"/conda-zig-bootstrap zig SYSROOT_ARCH="aarch64" -SYSROOT_PATH="${PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot" +SYSROOT_PATH="${PREFIX}"/"${SYSROOT_ARCH}"-conda-linux-gnu/sysroot +TARGET_INTERPRETER="${SYSROOT_PATH}/lib64/ld-linux-${SYSROOT_ARCH}.so.1" EXTRA_CMAKE_ARGS+=( \ + "-DCMAKE_BUILD_TYPE=Release" \ "-DCMAKE_PREFIX_PATH=${PREFIX};${SYSROOT_PATH}" \ "-DCMAKE_C_COMPILER=${CC}" \ "-DCMAKE_CXX_COMPILER=${CXX}" \ "-DZIG_SHARED_LLVM=ON" \ "-DZIG_USE_LLVM_CONFIG=ON" \ - "-DZIG_TARGET_DYNAMIC_LINKER=${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" \ + "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-linux-gnu" \ ) -# "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-linux-gnu" \ +# This path is too oong for Target.zig +# "-DZIG_TARGET_DYNAMIC_LINKER=${TARGET_INTERPRETER}" \ source "${RECIPE_DIR}/build_scripts/_build_qemu_execve.sh" build_qemu_execve "${SYSROOT_ARCH}" # export CROSSCOMPILING_EMULATOR="${BUILD_PREFIX}/bin/qemu-${SYSROOT_ARCH}" -export QEMU_LD_PREFIX="${SYSROOT_PATH}" -export QEMU_LOG_FILENAME="${SRC_DIR}/_qemu_%d.log" -export QEMU_LOG="strace" -export QEMU_SET_ENV="LD_LIBRARY_PATH=${SYSROOT_PATH}/lib64:${LD_LIBRARY_PATH:-}" -export QEMU_SET_ENV="LD_PRELOAD=${SYSROOT_PATH}/lib64/libdl.so.2:${SYSROOT_PATH}/lib64/libc.so.6:${SYSROOT_PATH}/lib64/libm.so.6" -export QEMU_STACK_SIZE="67108864" -export QEMU_EXECVE="${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" -export CFLAGS="${CFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" -export CXXFLAGS="${CXXFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" +export CROSSCOMPILING_EMULATOR="${QEMU_EXECVE}" +export CROSSCOMPILING_LIBC="Wl,-dynamic-linker,${TARGET_INTERPRETER};-L${SYSROOT_PATH}/lib64;-lc" -export CROSSCOMPILING_LIBC="Wl,-dynamic-linker,${SYSROOT_PATH}//lib64/ld-linux-aarch64.so.1;-L${SYSROOT_PATH}/lib64;-lc" +export CFLAGS="${CFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${TARGET_INTERPRETER}" +export CXXFLAGS="${CXXFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${TARGET_INTERPRETER}" export ZIG_CROSS_TARGET_TRIPLE="${SYSROOT_ARCH}"-linux-gnu export ZIG_CROSS_TARGET_MCPU="native" @@ -55,14 +53,6 @@ export ZIG_CROSS_TARGET_MCPU="native" # When using installed c++ libs, zig needs libzigcpp.a USE_CMAKE_ARGS=1 -# Patch ld.lld to use the correct interpreter -patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${PREFIX}/bin/ld.lld" -patchelf --set-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/ld.lld" -patchelf --add-rpath "\$ORIGIN/../aarch64-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/ld.lld" -patchelf --add-needed "libdl.so.2" "${PREFIX}/bin/ld.lld" -patchelf --add-needed "librt.so.1" "${PREFIX}/bin/ld.lld" -patchelf --add-needed "libm.so.6" "${PREFIX}/bin/ld.lld" - configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" cat <> "${cmake_build_dir}/config.zig" pub const mem_leak_frames = 0; @@ -73,33 +63,25 @@ cmake_build_cmake_target "${cmake_build_dir}" zig-wasm2c cmake_build_cmake_target "${cmake_build_dir}" zig1 cmake_build_cmake_target "${cmake_build_dir}" zig2 -# patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${PREFIX}/bin/ld.lld" -cd "${cmake_build_dir}" || exit 1 - export QEMU_LOG_FILENAME="${SRC_DIR}/_qemu_%d.log" - "${CROSSCOMPILING_EMULATOR}" "${SRC_DIR}"/build-release/zig2 build || true - export QEMU_LOG_FILENAME="${SRC_DIR}/_qemu_execve_%d.log" - - # Patch zig2 to use the correct interpreter - patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${SRC_DIR}"/build-release/zig2 - patchelf --set-rpath "${PREFIX}"/lib "${SRC_DIR}"/build-release/zig2 - patchelf --add-rpath "${SYSROOT_PATH}"/lib64 "${SRC_DIR}"/build-release/zig2 - patchelf --add-needed "libdl.so.2" "${SRC_DIR}"/build-release/zig2 - patchelf --add-needed "librt.so.1" "${SRC_DIR}"/build-release/zig2 - patchelf --add-needed "libm.so.6" "${SRC_DIR}"/build-release/zig2 - - # Patch ld.lld to use the correct interpreter - patchelf --set-interpreter "${SYSROOT_PATH}"/lib64/ld-linux-aarch64.so.1 "${PREFIX}/bin/ld.lld" - patchelf --set-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/ld.lld" - patchelf --add-rpath "\$ORIGIN/../aarch64-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/ld.lld" - patchelf --add-needed "libdl.so.2" "${PREFIX}/bin/ld.lld" - patchelf --add-needed "librt.so.1" "${PREFIX}/bin/ld.lld" - patchelf --add-needed "libm.so.6" "${PREFIX}/bin/ld.lld" - - export QEMU_SET_ENV="PATH=${PREFIX}/bin:${PATH:-}" - - "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 env - "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 libc - "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 help - "${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} "$SRC_DIR"/build-release/zig2 build -cd "${SRC_DIR}" || exit 1 -cmake_build_install "${cmake_build_dir}" +patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" "${cmake_build_dir}/zig2" 1 + +sed -i -E "s@#define ZIG_CXX_COMPILER \".*/bin@#define ZIG_CXX_COMPILER \"${PREFIX}/bin@g" "${cmake_build_dir}/config.h" +pushd "${cmake_build_dir}" + cmake --build . -- -j"${CPU_COUNT}" + cmake --install . +popd + +# Use stage3/zig to self-build +# Zig needs the config.h to correctly (?) find the conda installed llvm, etc + +EXTRA_ZIG_ARGS+=( \ + "-Doptimize=ReleaseSafe" \ + "-Denable-llvm" \ + "-Dstrip" \ + "-Duse-zig-libcxx=false" \ +) + +patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" "${cmake_build_dir}/stage3/bin/zig" + +# mkdir -p "${zig_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${zig_build_dir}" +# build_zig_with_zig "${zig_build_dir}" "${cmake_build_dir}/stage3/bin/zig" "${PREFIX}" diff --git a/recipe/build_scripts/native-cmake-linux-64.sh b/recipe/build_scripts/native-cmake-linux-64.sh index e2ef09c6c..7a568d04d 100644 --- a/recipe/build_scripts/native-cmake-linux-64.sh +++ b/recipe/build_scripts/native-cmake-linux-64.sh @@ -16,6 +16,7 @@ mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_ SYSROOT_ARCH="x86_64" EXTRA_CMAKE_ARGS+=( \ + "-DCMAKE_BUILD_TYPE=Release" \ "-DZIG_SHARED_LLVM=ON" \ "-DZIG_USE_LLVM_CONFIG=ON" \ "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-linux-gnu" \ diff --git a/recipe/build_scripts/native-cmake-osx-64.sh b/recipe/build_scripts/native-cmake-osx-64.sh index 108558175..3ef5b00af 100644 --- a/recipe/build_scripts/native-cmake-osx-64.sh +++ b/recipe/build_scripts/native-cmake-osx-64.sh @@ -11,14 +11,13 @@ export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" cmake_build_dir="${SRC_DIR}/build-release" -cmake_install_dir="${SRC_DIR}/cmake-built-install" - mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" # Current conda zig may not be able to build the latest zig SYSROOT_ARCH="x86_64" EXTRA_CMAKE_ARGS+=( \ + "-DCMAKE_BUILD_TYPE=Release" \ "-DZIG_SHARED_LLVM=ON" \ "-DZIG_USE_LLVM_CONFIG=ON" \ "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-macos-none" \ diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 401338926..1dba83795 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -12,6 +12,7 @@ source: patches: - patches/0001-cross-findllvm.patch # [linux and aarch64] - patches/0002-cross-CMakeLists.txt.patch # [build_platform != target_platform] + - patches/0003-cross-install.cmake.patch # [build_platform != target_platform] folder: zig-source # We use the upstrean binary as bootstrap. Installing previous conda version of zig @@ -48,6 +49,7 @@ requirements: - sysroot_linux-64 >=2.28 # [linux and build_platform != target_platform] - zlib # [linux and build_platform != target_platform] host: + - {{ compiler('cxx') }} # [linux and build_platform != target_platform] - clangdev {{ llvm_version }} - llvmdev {{ llvm_version }} - llvm {{ llvm_version }} @@ -63,12 +65,12 @@ requirements: test: commands: - test -f ${PREFIX}/bin/zig # [unix] - - test -f ${PREFIX}/doc/langref.html # [unix] + # - test -f ${PREFIX}/doc/langref.html # [unix] - test -f ${PREFIX}/lib/zig/c.zig # [unix] - test -f ${PREFIX}/lib/zig/compiler_rt.zig # [unix] - test -f ${PREFIX}/lib/zig/zig.h # [unix] - if not exist %PREFIX%\\bin\\zig.exe exit 1 # [win] - - if not exist %PREFIX%\\doc\\langref.html exit 1 # [win] + # - if not exist %PREFIX%\\doc\\langref.html exit 1 # [win] - if not exist %PREFIX%\\lib\\zig\\c.zig exit 1 # [win] - if not exist %PREFIX%\\lib\\zig\\compiler_rt.zig exit 1 # [win] - if not exist %PREFIX%\\lib\\zig\\zig.h exit 1 # [win] diff --git a/recipe/patches/0002-cross-CMakeLists.txt.patch b/recipe/patches/0002-cross-CMakeLists.txt.patch index 03cc0fdc6..9aae35389 100644 --- a/recipe/patches/0002-cross-CMakeLists.txt.patch +++ b/recipe/patches/0002-cross-CMakeLists.txt.patch @@ -141,10 +141,14 @@ - "-Dcpu=${ZIG_TARGET_MCPU}" + "-Dtarget=${ZIG_CROSS_TARGET_TRIPLE}" + "-Dcpu=${ZIG_CROSS_TARGET_MCPU}" - + @@ -978,3 +1042,4 @@ OUTPUT "${PROJECT_BINARY_DIR}/stage3/bin/zig" - COMMAND zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} + COMMAND ${CROSSCOMPILING_EMULATOR} ${PROJECT_BINARY_DIR}/zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} + DEPENDS zig2 COMMENT STATUS "Building stage3" +@@ -989,2 +1055,3 @@ + ++install(CODE "set(CROSSCOMPILING_EMULATOR \"${CROSSCOMPILING_EMULATOR}\")") + install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")") diff --git a/recipe/patches/0003-cross-install.cmake.patch b/recipe/patches/0003-cross-install.cmake.patch new file mode 100644 index 000000000..e211c52e4 --- /dev/null +++ b/recipe/patches/0003-cross-install.cmake.patch @@ -0,0 +1,15 @@ +--- cmake/install.cmake 2024-06-06 14:05:11.000000000 -0500 ++++ cmake/install.cmake 2024-06-19 11:00:55.023460439 -0500 +@@ -2,3 +2,3 @@ + execute_process( +- COMMAND "${ZIG_EXECUTABLE}" ${ZIG_INSTALL_ARGS} ++ COMMAND ${CROSSCOMPILING_EMULATOR} "${ZIG_EXECUTABLE}" ${ZIG_INSTALL_ARGS} + WORKING_DIRECTORY "${ZIG2_WORKING_DIR}" +@@ -13,5 +13,5 @@ + message("::") +- message(":: argv: ${ZIG_EXECUTABLE} ${s_INSTALL_LIBSTAGE2_ARGS}") ++ message(":: argv: ${CROSSCOMPILING_EMULATOR} ${ZIG_EXECUTABLE} ${s_INSTALL_LIBSTAGE2_ARGS}") + +- set(_args ${ZIG_EXECUTABLE} ${ZIG_INSTALL_ARGS}) ++ set(_args ${CROSSCOMPILING_EMULATOR} ${ZIG_EXECUTABLE} ${ZIG_INSTALL_ARGS}) + list(LENGTH _args _len) diff --git a/recipe/patches/xxxx-qemu-execve.patch b/recipe/patches/xxxx-qemu-execve.patch index e755e1838..618bc5ab4 100644 --- a/recipe/patches/xxxx-qemu-execve.patch +++ b/recipe/patches/xxxx-qemu-execve.patch @@ -25,9 +25,8 @@ extern unsigned long mmap_min_addr; --- qemu/linux-user/syscall.c.orig 2024-07-13 15:31:51.834834526 -0500 +++ qemu/linux-user/syscall.c 2024-07-13 18:42:00.033718159 -0500 -@@ -8416,2 +8416,105 @@ - } -+ +@@ -8417,2 +8417,104 @@ + +#define BINPRM_BUF_SIZE 128 + +/* qemu_execve() Must return target values and target errnos. */ @@ -127,16 +126,18 @@ + } else { + new_argp[2] = argv[0]; + } -+ qemu_log_mask(LOG_GUEST_ERROR, "execve(\"%s\")\n", qemu_execve_path); + return get_errno(execve(qemu_execve_path, new_argp, envp)); +} - -@@ -8534,3 +8639,6 @@ - ? safe_execveat(dirfd, exe, argp, envp, flags) ++ + ssize_t do_guest_readlink(const char *pathname, char *buf, size_t bufsiz) +@@ -8533,4 +8635,8 @@ + ret = is_execveat +- ? safe_execveat(dirfd, exe, argp, envp, flags) - : safe_execve(exe, argp, envp); ++ ? ((qemu_execve_path && *qemu_execve_path) ++ ? get_errno(qemu_execve(exe, argp, envp)) ++ : safe_execveat(dirfd, exe, argp, envp, flags)) + : ((qemu_execve_path && *qemu_execve_path) + ? get_errno(qemu_execve(exe, argp, envp)) + : safe_execve(exe, argp, envp)); -+ qemu_log_mask(LOG_GUEST_ERROR, "execve(\"%s\", %p, %p, %d)\n", exe ? (char *)exe : (char *)p, argp, envp, is_execveat); - ret = get_errno(ret); From fd8ae4123d9584af3d4c18496447d46a223faf04 Mon Sep 17 00:00:00 2001 From: memento Date: Mon, 22 Jul 2024 09:24:46 -0500 Subject: [PATCH 03/22] (fix) patchelf zig. fix extra space when no emulator --- recipe/build_scripts/_functions.sh | 9 ++++- .../cross-cmake-linux-aarch64.sh | 33 +++++-------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/recipe/build_scripts/_functions.sh b/recipe/build_scripts/_functions.sh index 88e6b4921..ff87b929e 100644 --- a/recipe/build_scripts/_functions.sh +++ b/recipe/build_scripts/_functions.sh @@ -93,9 +93,15 @@ function build_zig_with_zig() { export HTTPS_PROXY=https://localhost export http_proxy=http://localhost + if [[ ${CROSSCOMPILING_EMULATOR:-} == '' ]]; then + _cmd="${zig}" + else + _cmd="${CROSSCOMPILING_EMULATOR} ${zig}" + fi + if [[ -d "${build_dir}" ]]; then cd "${build_dir}" || exit 1 - "${CROSSCOMPILING_EMULATOR:-}" "${zig}" build \ + "${_cmd}" build \ --prefix "${install_dir}" \ --search-prefix "${install_dir}" \ "${EXTRA_ZIG_ARGS[@]}" \ @@ -150,6 +156,7 @@ function patchelf_sysroot_interpreter() { patchelf --add-rpath "${_sysroot}"/lib64 "${_exec}" fi patchelf --add-rpath "${_sysroot}"/lib "${_exec}" + if [[ -n "${_add_lib}" ]]; then patchelf --add-needed "libdl.so.2" "${_exec}" patchelf --add-needed "librt.so.1" "${_exec}" diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index 231e51efd..ea4868d9e 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -7,11 +7,7 @@ source "${RECIPE_DIR}/build_scripts/_functions.sh" # --- Main --- -export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" -export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" - cmake_build_dir="${SRC_DIR}/_conda-cmake-build" -zig_build_dir="${SRC_DIR}/_conda-zig-build" mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" @@ -19,11 +15,13 @@ mkdir -p "${SRC_DIR}"/_conda-build-level-patches cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/_conda-build-level-patches # Current conda zig may not be able to build the latest zig -# mamba create -yp "${SRC_DIR}"/conda-zig-bootstrap zig SYSROOT_ARCH="aarch64" SYSROOT_PATH="${PREFIX}"/"${SYSROOT_ARCH}"-conda-linux-gnu/sysroot TARGET_INTERPRETER="${SYSROOT_PATH}/lib64/ld-linux-${SYSROOT_ARCH}.so.1" +export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" +export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" + EXTRA_CMAKE_ARGS+=( \ "-DCMAKE_BUILD_TYPE=Release" \ "-DCMAKE_PREFIX_PATH=${PREFIX};${SYSROOT_PATH}" \ @@ -33,7 +31,7 @@ EXTRA_CMAKE_ARGS+=( \ "-DZIG_USE_LLVM_CONFIG=ON" \ "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-linux-gnu" \ ) -# This path is too oong for Target.zig +# This path is too long for Target.zig # "-DZIG_TARGET_DYNAMIC_LINKER=${TARGET_INTERPRETER}" \ source "${RECIPE_DIR}/build_scripts/_build_qemu_execve.sh" @@ -50,7 +48,6 @@ export CXXFLAGS="${CXXFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic- export ZIG_CROSS_TARGET_TRIPLE="${SYSROOT_ARCH}"-linux-gnu export ZIG_CROSS_TARGET_MCPU="native" -# When using installed c++ libs, zig needs libzigcpp.a USE_CMAKE_ARGS=1 configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" @@ -58,12 +55,8 @@ cat <> "${cmake_build_dir}/config.zig" pub const mem_leak_frames = 0; EOF -# remove_failing_langref "${cmake_build_dir}" -cmake_build_cmake_target "${cmake_build_dir}" zig-wasm2c -cmake_build_cmake_target "${cmake_build_dir}" zig1 cmake_build_cmake_target "${cmake_build_dir}" zig2 - -patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" "${cmake_build_dir}/zig2" 1 +patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${TARGET_INTERPRETER}" "${cmake_build_dir}/zig2" 1 sed -i -E "s@#define ZIG_CXX_COMPILER \".*/bin@#define ZIG_CXX_COMPILER \"${PREFIX}/bin@g" "${cmake_build_dir}/config.h" pushd "${cmake_build_dir}" @@ -71,17 +64,7 @@ pushd "${cmake_build_dir}" cmake --install . popd -# Use stage3/zig to self-build -# Zig needs the config.h to correctly (?) find the conda installed llvm, etc - -EXTRA_ZIG_ARGS+=( \ - "-Doptimize=ReleaseSafe" \ - "-Denable-llvm" \ - "-Dstrip" \ - "-Duse-zig-libcxx=false" \ -) - -patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${SYSROOT_PATH}/lib64/ld-linux-aarch64.so.1" "${cmake_build_dir}/stage3/bin/zig" +patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" -# mkdir -p "${zig_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${zig_build_dir}" -# build_zig_with_zig "${zig_build_dir}" "${cmake_build_dir}/stage3/bin/zig" "${PREFIX}" +# Use stage3/zig to self-build: This failed locally with SEGV in qemu +# build_zig_with_zig "${zig_build_dir}" "${PREFIX}/bin/zig" "${PREFIX}" From 57cb2ca462f1d7b1800521f960349ab5e0472281 Mon Sep 17 00:00:00 2001 From: memento Date: Mon, 22 Jul 2024 10:32:55 -0500 Subject: [PATCH 04/22] (fix) lint. remove non-tested ppc64le --- .../cross-cmake-linux-ppc64le.sh | 45 ------------------- recipe/meta.yaml | 2 +- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 recipe/build_scripts/cross-cmake-linux-ppc64le.sh diff --git a/recipe/build_scripts/cross-cmake-linux-ppc64le.sh b/recipe/build_scripts/cross-cmake-linux-ppc64le.sh deleted file mode 100644 index a7a08c529..000000000 --- a/recipe/build_scripts/cross-cmake-linux-ppc64le.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -# --- Functions --- - -source "${RECIPE_DIR}/build_scripts/_functions.sh" - -# --- Main --- - -export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" -export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" - -cmake_build_dir="${SRC_DIR}/build-release" - -mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" - -mkdir -p "${SRC_DIR}"/build-level-patches -cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/build-level-patches - -# Current conda zig may not be able to build the latest zig -# mamba create -yp "${SRC_DIR}"/conda-zig-bootstrap zig -SYSROOT_ARCH="aarch64" - -EXTRA_CMAKE_ARGS+=( \ - "-DZIG_SHARED_LLVM=ON" \ - "-DZIG_USE_LLVM_CONFIG=ON" \ - "-DZIG_TARGET_TRIPLE=x86_64-linux-gnu" \ - "-DZIG_DYNAMIC_LINKER=${PREFIX}/lib/ld-linux-ppc64le.so.2" \ -) -# Zig searches for libm.so/libc.so in incorrect paths (libm.so with hard-coded /usr/lib64/libmvec_nonshared.a) -modify_libc_libm_for_zig "${BUILD_PREFIX}" - -if [[ "${CROSSCOMPILING_EMULATOR:-0}" == *"qemu"* ]]; then - # This is a hack to make zig use the correct qemu binary - ln -s "${CROSSCOMPILING_EMULATOR}" "${BUILD_PREFIX}/bin/qemu-${SYSROOT_ARCH}" - export CROSSCOMPILING_EMULATOR="${CROSSCOMPILING_EMULATOR}" - export ZIG_CROSS_TARGET_TRIPLE="${SYSROOT_ARCH}"-linux-gnu -fi - -# When using installed c++ libs, zig needs libzigcpp.a -configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" -# remove_failing_langref "${cmake_build_dir}" -cmake_build_zig2 "${cmake_build_dir}" -patchelf_for_2.28 "${cmake_build_dir}/zig2" "${PREFIX}" -cmake_build_install "${cmake_build_dir}" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1dba83795..8526e022d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -42,7 +42,7 @@ requirements: - ninja # This is needed to build a qemu that intercepts the execve() call that zig2 emits - glib # [linux and build_platform != target_platform] - - make # [linux and build_platform != target_platform] + - make # [linux and build_platform != target_platform] - pkg-config # [linux and build_platform != target_platform] - sphinx # [linux and build_platform != target_platform] - sphinx-rtd-theme # [linux and build_platform != target_platform] From 61ad25cae5ad6a0caa77cc4a75fad0a2a307f4c6 Mon Sep 17 00:00:00 2001 From: memento Date: Mon, 22 Jul 2024 14:33:12 -0500 Subject: [PATCH 05/22] (fix) patch only rpath --- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index ea4868d9e..db8ff2e3d 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -64,7 +64,12 @@ pushd "${cmake_build_dir}" cmake --install . popd -patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" +patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" +patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" + +# ${QEMU_EXECVE} "${PREFIX}/bin/zig" --version + +# patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" # Use stage3/zig to self-build: This failed locally with SEGV in qemu # build_zig_with_zig "${zig_build_dir}" "${PREFIX}/bin/zig" "${PREFIX}" From 5988c4d123bb7504e0c8c615048a3b8761e4b526 Mon Sep 17 00:00:00 2001 From: memento Date: Mon, 22 Jul 2024 18:07:53 -0500 Subject: [PATCH 06/22] (fix) add interpreter --- recipe/build_scripts/_functions.sh | 2 +- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/build_scripts/_functions.sh b/recipe/build_scripts/_functions.sh index ff87b929e..bb64fa5e5 100644 --- a/recipe/build_scripts/_functions.sh +++ b/recipe/build_scripts/_functions.sh @@ -157,7 +157,7 @@ function patchelf_sysroot_interpreter() { fi patchelf --add-rpath "${_sysroot}"/lib "${_exec}" - if [[ -n "${_add_lib}" ]]; then + if [[ "${_add_lib:-0}" != "0" ]]; then patchelf --add-needed "libdl.so.2" "${_exec}" patchelf --add-needed "librt.so.1" "${_exec}" patchelf --add-needed "libm.so.6" "${_exec}" diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index db8ff2e3d..0e0da335c 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -64,6 +64,7 @@ pushd "${cmake_build_dir}" cmake --install . popd +patchelf --set-interpreter "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" From 8b656b4e56baf61656d2991993a57a751429f698 Mon Sep 17 00:00:00 2001 From: memento Date: Mon, 22 Jul 2024 18:09:23 -0500 Subject: [PATCH 07/22] (fix) try using stdlib fo update build libc 2.28 --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8526e022d..46318a600 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -46,7 +46,7 @@ requirements: - pkg-config # [linux and build_platform != target_platform] - sphinx # [linux and build_platform != target_platform] - sphinx-rtd-theme # [linux and build_platform != target_platform] - - sysroot_linux-64 >=2.28 # [linux and build_platform != target_platform] + - {{ stdlib("c") }} # [linux and build_platform != target_platform] - zlib # [linux and build_platform != target_platform] host: - {{ compiler('cxx') }} # [linux and build_platform != target_platform] From 7bd2e9d88d8c9028d0b46794547b88b37ca66214 Mon Sep 17 00:00:00 2001 From: memento Date: Mon, 22 Jul 2024 18:45:17 -0500 Subject: [PATCH 08/22] (fix) masquerade? --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 46318a600..ddf2a71cf 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -46,7 +46,7 @@ requirements: - pkg-config # [linux and build_platform != target_platform] - sphinx # [linux and build_platform != target_platform] - sphinx-rtd-theme # [linux and build_platform != target_platform] - - {{ stdlib("c") }} # [linux and build_platform != target_platform] + - sysroot_{{ build_platform }} >=2.28 # [linux and build_platform != target_platform] - zlib # [linux and build_platform != target_platform] host: - {{ compiler('cxx') }} # [linux and build_platform != target_platform] From adebce6364e22a2bca1a5c4295da4186628b0885 Mon Sep 17 00:00:00 2001 From: memento Date: Tue, 23 Jul 2024 13:53:02 -0500 Subject: [PATCH 09/22] (fix) masquerade? --- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 2 +- recipe/meta.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index 0e0da335c..e90203264 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -64,7 +64,7 @@ pushd "${cmake_build_dir}" cmake --install . popd -patchelf --set-interpreter "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" +# patchelf --set-interpreter "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index ddf2a71cf..4ef4ce0fb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -84,6 +84,7 @@ test: {% endfor %} # Functionality tests + - patchelf --set-interpreter ${PREFIX}/aarch64-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1 ${PREFIX}/bin/zig # [aarch64] - zig version - zig zen - zig init From efc719e361121f33b8a53075675b0fe17147b43b Mon Sep 17 00:00:00 2001 From: memento Date: Tue, 23 Jul 2024 17:32:58 -0500 Subject: [PATCH 10/22] (fix) require patchelf --- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 2 +- recipe/meta.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index e90203264..b87a3c596 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -68,7 +68,7 @@ popd patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" -# ${QEMU_EXECVE} "${PREFIX}/bin/zig" --version +${QEMU_EXECVE} "${PREFIX}/bin/zig" version # patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4ef4ce0fb..c67f11c61 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -63,6 +63,8 @@ requirements: - sysroot_{{ target_platform }} >=2.28 # [linux and aarch64] test: + requires: + - patchelf # [aarch64] commands: - test -f ${PREFIX}/bin/zig # [unix] # - test -f ${PREFIX}/doc/langref.html # [unix] From 19f4c13d73368153a67a6dc41065cb100c4ed75e Mon Sep 17 00:00:00 2001 From: memento Date: Wed, 24 Jul 2024 13:54:28 -0500 Subject: [PATCH 11/22] (dbg) how to patch the interpreter --- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 6 +----- recipe/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index b87a3c596..0ce8169cc 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -64,13 +64,9 @@ pushd "${cmake_build_dir}" cmake --install . popd -# patchelf --set-interpreter "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" +patchelf --set-interpreter "\$PREFIX/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" -${QEMU_EXECVE} "${PREFIX}/bin/zig" version - -# patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${TARGET_INTERPRETER}" "${PREFIX}/bin/zig" - # Use stage3/zig to self-build: This failed locally with SEGV in qemu # build_zig_with_zig "${zig_build_dir}" "${PREFIX}/bin/zig" "${PREFIX}" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c67f11c61..e8599b0fe 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -86,7 +86,7 @@ test: {% endfor %} # Functionality tests - - patchelf --set-interpreter ${PREFIX}/aarch64-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1 ${PREFIX}/bin/zig # [aarch64] + # - patchelf --set-interpreter ${PREFIX}/aarch64-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1 ${PREFIX}/bin/zig # [aarch64] - zig version - zig zen - zig init From b976a39f6ea8b632484d89e98481dba74aeb5508 Mon Sep 17 00:00:00 2001 From: memento Date: Wed, 24 Jul 2024 17:49:38 -0500 Subject: [PATCH 12/22] (dbg) how to patch the interpreter --- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index 0ce8169cc..4caba2455 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -64,7 +64,7 @@ pushd "${cmake_build_dir}" cmake --install . popd -patchelf --set-interpreter "\$PREFIX/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" +patchelf --set-interpreter "ld-linux-${SYSROOT_ARCH}.so.1" "${PREFIX}/bin/zig" patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" From e69b7a72f7d1283e47412c7e7fc64cfd11c0bbbd Mon Sep 17 00:00:00 2001 From: memento Date: Wed, 24 Jul 2024 21:54:48 -0500 Subject: [PATCH 13/22] (dbg) how to patch the interpreter --- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index 4caba2455..ce831d5c8 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -64,7 +64,7 @@ pushd "${cmake_build_dir}" cmake --install . popd -patchelf --set-interpreter "ld-linux-${SYSROOT_ARCH}.so.1" "${PREFIX}/bin/zig" +patchelf --set-interpreter "${PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-linux-${SYSROOT_ARCH}.so.1" "${PREFIX}/bin/zig" patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" From 21efd18cb218828e59533720e0c54dd85a6a1bc3 Mon Sep 17 00:00:00 2001 From: memento Date: Thu, 25 Jul 2024 10:58:46 -0500 Subject: [PATCH 14/22] (dbg) how to patch the interpreter --- recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e8599b0fe..c85ac6f26 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -60,11 +60,13 @@ requirements: - zlib - zstd run: + - libxml2 # [linux and build_platform != target_platform] - sysroot_{{ target_platform }} >=2.28 # [linux and aarch64] test: requires: - patchelf # [aarch64] + - sysroot_{{ target_platform }} >=2.28 # [linux and aarch64] commands: - test -f ${PREFIX}/bin/zig # [unix] # - test -f ${PREFIX}/doc/langref.html # [unix] From 9d548cdb3ed78bedda0a97c91ff4a01ef475105d Mon Sep 17 00:00:00 2001 From: memento Date: Thu, 25 Jul 2024 15:07:05 -0500 Subject: [PATCH 15/22] (dbg) how to patch the interpreter --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c85ac6f26..aaa1ad1b1 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -88,6 +88,7 @@ test: {% endfor %} # Functionality tests + - readelf -l ${PREFIX}/bin/zig # [aarch64] # - patchelf --set-interpreter ${PREFIX}/aarch64-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1 ${PREFIX}/bin/zig # [aarch64] - zig version - zig zen From 4469fccf71362d8cf268535d846ad8d003c31b7e Mon Sep 17 00:00:00 2001 From: memento Date: Thu, 25 Jul 2024 18:10:40 -0500 Subject: [PATCH 16/22] (dbg) how odd --- recipe/build_scripts/cross-cmake-linux-aarch64.sh | 2 +- recipe/meta.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/recipe/build_scripts/cross-cmake-linux-aarch64.sh b/recipe/build_scripts/cross-cmake-linux-aarch64.sh index ce831d5c8..d235d69b7 100644 --- a/recipe/build_scripts/cross-cmake-linux-aarch64.sh +++ b/recipe/build_scripts/cross-cmake-linux-aarch64.sh @@ -64,7 +64,7 @@ pushd "${cmake_build_dir}" cmake --install . popd -patchelf --set-interpreter "${PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-linux-${SYSROOT_ARCH}.so.1" "${PREFIX}/bin/zig" +# patchelf --set-interpreter "${PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-linux-${SYSROOT_ARCH}.so.1" "${PREFIX}/bin/zig" patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index aaa1ad1b1..c6cf29398 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -89,7 +89,8 @@ test: # Functionality tests - readelf -l ${PREFIX}/bin/zig # [aarch64] - # - patchelf --set-interpreter ${PREFIX}/aarch64-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1 ${PREFIX}/bin/zig # [aarch64] + - patchelf --set-interpreter ${PREFIX}/aarch64-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1 ${PREFIX}/bin/zig # [aarch64] + - readelf -l ${PREFIX}/bin/zig # [aarch64] - zig version - zig zen - zig init From 76c162e98870b260471272f7978aa35ce9bc7a9e Mon Sep 17 00:00:00 2001 From: memento Date: Sat, 2 Nov 2024 21:28:45 -0500 Subject: [PATCH 17/22] (mnt) bump. MCPU --- .azure-pipelines/azure-pipelines-linux.yml | 4 + .azure-pipelines/azure-pipelines-osx.yml | 2 +- .ci_support/linux_64_.yaml | 4 +- .ci_support/linux_aarch64_.yaml | 4 +- .ci_support/linux_ppc64le_.yaml | 607 ++++++++++++++++++ .ci_support/osx_64_.yaml | 4 +- .ci_support/osx_arm64_.yaml | 4 +- .scripts/build_steps.sh | 16 +- .scripts/run_osx_build.sh | 43 +- README.md | 7 + azure-pipelines.yml | 31 +- build-locally.py | 9 +- conda-forge.yml | 1 + recipe/build.sh | 3 + recipe/build_scripts/_build_qemu_execve.sh | 71 +- .../cross-cmake-linux-ppc64le.sh | 95 +++ recipe/meta.yaml | 33 +- .../patches/0004-cross-ppc64le-signal.h.patch | 4 + .../xxxx-zig2.c-asm-clobber-list.patch | 38 ++ 19 files changed, 904 insertions(+), 76 deletions(-) create mode 100644 .ci_support/linux_ppc64le_.yaml create mode 100644 recipe/build_scripts/cross-cmake-linux-ppc64le.sh create mode 100644 recipe/patches/0004-cross-ppc64le-signal.h.patch create mode 100644 recipe/patches/xxxx-zig2.c-asm-clobber-list.patch diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 9514627e7..4ced2e505 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -16,6 +16,10 @@ jobs: CONFIG: linux_aarch64_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + linux_ppc64le_: + CONFIG: linux_ppc64le_ + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 variables: {} diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 7708e23eb..ac0bf384e 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -5,7 +5,7 @@ jobs: - job: osx pool: - vmImage: macOS-12 + vmImage: macOS-13 strategy: matrix: osx_64_: diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 643c3c220..c7f8ba8fa 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '12' +- '13' c_stdlib: - sysroot c_stdlib_version: @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-alma-x86_64:8 target_platform: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index dc14145d1..d45fc59a9 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -3,7 +3,7 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '12' +- '13' c_stdlib: - sysroot c_stdlib_version: @@ -19,7 +19,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 target_platform: diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml new file mode 100644 index 000000000..b408b7ce1 --- /dev/null +++ b/.ci_support/linux_ppc64le_.yaml @@ -0,0 +1,607 @@ +c_compiler: +- gcc +c_compiler_version: +- '13' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.28' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '13' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +target_platform: +- linux-ppc64le +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - c_stdlib_version + - cdt_name +zlib: +- '1' +zstd: +- '1.5' +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index 2f9e1d8a8..4b1cc3d0a 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '16' +- '17' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' macos_machine: - x86_64-apple-darwin13.4.0 target_platform: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index 03f319424..5f91874f5 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '16' +- '17' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' macos_machine: - arm64-apple-darwin20.0.0 target_platform: diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index ba4b251cf..827a29fbc 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -31,18 +31,20 @@ pkgs_dirs: solver: libmamba CONDARC +mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) +echo > /opt/conda/conda-meta/history +micromamba install --root-prefix ~/.conda --prefix /opt/conda \ + --yes --override-channels --channel conda-forge --strict-channel-priority \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" - # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" source run_conda_forge_build_setup + + # make the build number clobber make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -74,8 +76,8 @@ else --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" ( startgroup "Inspecting artifacts" ) 2> /dev/null - # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" ( endgroup "Inspecting artifacts" ) 2> /dev/null ( startgroup "Validating outputs" ) 2> /dev/null diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index ba0c8791c..7f948c41f 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -7,28 +7,39 @@ source .scripts/logging_utils.sh set -xe MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} +MINIFORGE_HOME=${MINIFORGE_HOME%/} # remove trailing slash -( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null - -MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" -MINIFORGE_FILE="Mambaforge-MacOSX-$(uname -m).sh" -curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" -rm -rf ${MINIFORGE_HOME} -bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} - -( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null +( startgroup "Provisioning base env with micromamba" ) 2> /dev/null +MICROMAMBA_VERSION="1.5.10-0" +if [[ "$(uname -m)" == "arm64" ]]; then + osx_arch="osx-arm64" +else + osx_arch="osx-64" +fi +MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${osx_arch}" +MAMBA_ROOT_PREFIX="${MINIFORGE_HOME}-micromamba-$(date +%s)" +echo "Downloading micromamba ${MICROMAMBA_VERSION}" +micromamba_exe="$(mktemp -d)/micromamba" +curl -L -o "${micromamba_exe}" "${MICROMAMBA_URL}" +chmod +x "${micromamba_exe}" +echo "Creating environment" +"${micromamba_exe}" create --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \ + --channel conda-forge \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +echo "Moving pkgs cache from ${MAMBA_ROOT_PREFIX} to ${MINIFORGE_HOME}" +mv "${MAMBA_ROOT_PREFIX}/pkgs" "${MINIFORGE_HOME}" +echo "Cleaning up micromamba" +rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true +( endgroup "Provisioning base env with micromamba" ) 2> /dev/null ( startgroup "Configuring conda" ) 2> /dev/null -source ${MINIFORGE_HOME}/etc/profile.d/conda.sh +source "${MINIFORGE_HOME}/etc/profile.d/conda.sh" conda activate base export CONDA_SOLVER="libmamba" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -mamba install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" + @@ -88,8 +99,8 @@ else ( startgroup "Inspecting artifacts" ) 2> /dev/null - # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir ./recipe -m ./.ci_support/${CONFIG}.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" ( endgroup "Inspecting artifacts" ) 2> /dev/null ( startgroup "Validating outputs" ) 2> /dev/null diff --git a/README.md b/README.md index 5aba58c8a..80450568c 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,13 @@ Current build status variant + + linux_ppc64le + + + variant + + osx_64 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 33a441c1f..67d82fab2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,6 +2,31 @@ # update the conda-forge.yml and/or the recipe/meta.yaml. # -*- mode: yaml -*- -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file +stages: +- stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-22.04' + variables: + DECODE_PERCENTS: 'false' + RET: 'true' + steps: + - checkout: self + fetchDepth: '2' + - bash: | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` + echo "##vso[task.setvariable variable=log]$git_log" + displayName: Obtain commit message + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')) + displayName: Skip build? + - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" + name: result + displayName: Export result +- stage: Build + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: Check + jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml + - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index e0d408d07..6788aea66 100755 --- a/build-locally.py +++ b/build-locally.py @@ -1,13 +1,16 @@ -#!/usr/bin/env python3 +#!/bin/sh +"""exec" "python3" "$0" "$@" #""" # fmt: off # fmt: on # # This file has been generated by conda-smithy in order to build the recipe # locally. # -import os +# The line above this comment is a bash / sh / zsh guard +# to stop people from running it with the wrong interpreter import glob +import os +import platform import subprocess from argparse import ArgumentParser -import platform def setup_environment(ns): diff --git a/conda-forge.yml b/conda-forge.yml index bcfdbb9ea..316d6f265 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -8,5 +8,6 @@ conda_build: pkg_format: '2' build_platform: linux_aarch64: linux_64 + linux_ppc64le: linux_64 osx_arm64: osx_64 test: native_and_emulated diff --git a/recipe/build.sh b/recipe/build.sh index e34c3e828..0aa8c94e1 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -18,6 +18,9 @@ case "${target_platform}" in linux-aarch64) bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-linux-aarch64.sh ;; + linux-ppc64le) + bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-linux-ppc64le.sh + ;; osx-arm64) bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-osx-arm64.sh ;; diff --git a/recipe/build_scripts/_build_qemu_execve.sh b/recipe/build_scripts/_build_qemu_execve.sh index a9b979967..2e4a8881f 100644 --- a/recipe/build_scripts/_build_qemu_execve.sh +++ b/recipe/build_scripts/_build_qemu_execve.sh @@ -1,46 +1,69 @@ function build_qemu_execve() { local arch=${1:-"aarch64"} + mamba create -n qemu-execve -y -c conda-forge \ + gcc_linux-64 \ + glib \ + make \ + meson \ + patchelf \ + pkg-config \ + sphinx \ + sphinx-rtd-theme \ + sysroot_linux-64=2.28 \ + zlib + mkdir -p "${SRC_DIR}"/_qemu_execve cd "${SRC_DIR}"/_qemu_execve - # git clone https://github.com/balena-io/qemu.git git clone https://gitlab.com/qemu-project/qemu.git + cd qemu + git checkout v9.1.0 + cd .. patch -p0 < "${RECIPE_DIR}"/patches/xxxx-qemu-execve.patch mkdir _conda-build cd _conda-build - export PKG_CONFIG="${BUILD_PREFIX}/bin/pkg-config" - export PKG_CONFIG_PATH="${BUILD_PREFIX}/lib/pkgconfig" - export PKG_CONFIG_LIBDIR="${BUILD_PREFIX}/lib/pkgconfig" - export CC="${CC_FOR_BUILD}" - export CXX="${CXX_FOR_BUILD}" - export CFLAGS=$(echo "$CFLAGS" | sed 's#\$PREFIX#\$BUILD_PREFIX#g' | sed "s#$PREFIX#$BUILD_PREFIX#g") - export CXXFLAGS=$(echo "$CXXFLAGS" | sed 's#\$PREFIX#\$BUILD_PREFIX#g' | sed "s#$PREFIX#$BUILD_PREFIX#g") - export LDFLAGS=$(echo "$LDFLAGS" | sed 's#\$PREFIX#\$BUILD_PREFIX#g' | sed "s#$PREFIX#$BUILD_PREFIX#g") + local CC=$(mamba run -n qemu-execve which x86_64-conda-linux-gnu-gcc | grep -Eo '/.*gcc' | tail -n 1) + local PKG_CONFIG=$(mamba run -n qemu-execve which pkg-config | grep -Eo '/.*pkg-config' | tail -n 1) + local PKG_CONFIG_PATH=$(dirname ${PKG_CONFIG})/../lib/pkgconfig + mamba run -n qemu-execve bash -c 'echo "${CFLAGS:-}" > _cflags.txt' >& /dev/null + local CFLAGS=$(< _cflags.txt) + CFLAGS=${CFLAGS//-mcpu=power8 -mtune=power8/} + mamba run -n qemu-execve bash -c 'echo "${LDFLAGS:-}" > _ldflags.txt' >& /dev/null + local LDFLAGS=$(< _ldflags.txt) + mamba run -n qemu-execve bash -c 'echo "${PATH:-}" > _path.txt' >& /dev/null + local PATH=$(< _path.txt) + + # export CC PATH PKG_CONFIG CFLAGS LDFLAGS PKG_CONFIG_PATH ../qemu/configure --prefix="${BUILD_PREFIX}" \ - --interp-prefix="${BUILD_PREFIX}" \ - --enable-linux-user --target-list="${arch}"-linux-user > _configure_qemu.log 2>&1 - # --disable-bsd-user --disable-guest-agent --disable-strip --disable-werror --disable-gcrypt --disable-pie \ - # --disable-debug-info --disable-debug-tcg --enable-docs --disable-tcg-interpreter --enable-attr \ - # --disable-brlapi --disable-linux-aio --disable-bzip2 --disable-cap-ng --disable-curl --disable-fdt \ - # --disable-glusterfs --disable-gnutls --disable-nettle --disable-gtk --disable-rdma --disable-libiscsi \ - # --disable-vnc-jpeg --disable-kvm --disable-lzo --disable-curses --disable-libnfs --disable-numa \ - # --disable-opengl --disable-vnc-png --disable-rbd --disable-vnc-sasl --disable-sdl --disable-seccomp \ - # --disable-smartcard --disable-snappy --disable-spice --disable-libusb --disable-usb-redir --disable-vde \ - # --disable-vhost-net --disable-virglrenderer --disable-virtfs --disable-vnc --disable-vte --disable-xen \ - # --disable-xen-pci-passthrough --disable-system --disable-blobs --disable-tools \ - make -j"${CPU_COUNT}" > _make_qemu.log 2>&1 - make install > install_qemu.log 2>&1 + --interp-prefix="${BUILD_PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot" \ + --enable-linux-user \ + --target-list="${arch}-linux-user" \ + "--cross-cc-${arch}=${SYSROOT_ARCH}-conda-linux-gnu-gcc" \ + "--cross-prefix-${arch}=${SYSROOT_ARCH}-conda-linux-gnu-" \ + --disable-system --disable-fdt --disable-guest-agent --disable-tools --disable-virtfs \ + --disable-docs --disable-hexagon-idef-parser \ + --disable-bsd-user --disable-strip --disable-werror --disable-gcrypt --disable-pie \ + --disable-debug-info --disable-debug-tcg --disable-tcg-interpreter \ + --disable-brlapi --disable-linux-aio --disable-bzip2 --disable-cap-ng --disable-curl \ + --disable-glusterfs --disable-gnutls --disable-nettle --disable-gtk --disable-rdma --disable-libiscsi \ + --disable-vnc-jpeg --disable-kvm --disable-lzo --disable-curses --disable-libnfs --disable-numa \ + --disable-opengl --disable-rbd --disable-vnc-sasl --disable-sdl --disable-seccomp \ + --disable-smartcard --disable-snappy --disable-spice --disable-libusb --disable-usb-redir --disable-vde \ + --disable-vhost-net --disable-virglrenderer --disable-vnc --disable-vte --disable-xen \ + --disable-xen-pci-passthrough > "${SRC_DIR}"/_configure_qemu.log 2>&1 + make -j"${CPU_COUNT}" > "${SRC_DIR}"/_make_qemu.log 2>&1 + make install > "${SRC_DIR}"/_install_qemu.log 2>&1 # Patch the interpreter - patchelf --set-interpreter "${BUILD_PREFIX}/x86_64-conda-linux-gnu/sysroot/lib64/ld-linux-x86-64.so.2" "${BUILD_PREFIX}/bin/qemu-${arch}" + patchelf --set-interpreter "${BUILD_PREFIX}/x86_64-conda-linux-gnu/sysroot/lib64/ld-2.28.so" "${BUILD_PREFIX}/bin/qemu-${arch}" patchelf --set-rpath "\$ORIGIN/../x86_64-conda-linux-gnu/sysroot/lib64" "${BUILD_PREFIX}/bin/qemu-${arch}" patchelf --add-rpath "\$ORIGIN/../lib" "${BUILD_PREFIX}/bin/qemu-${arch}" export QEMU_LD_PREFIX="${SYSROOT_PATH}" export QEMU_SET_ENV="LD_LIBRARY_PATH=${SYSROOT_PATH}/lib64:${LD_LIBRARY_PATH:-}" - export QEMU_EXECVE="${BUILD_PREFIX}"/bin/qemu-${SYSROOT_ARCH} + export QEMU_EXECVE="${BUILD_PREFIX}"/bin/qemu-${arch} export QEMU_STACK_SIZE=67108864 export QEMU_LOG_FILENAME="${SRC_DIR}"/_qemu.log export QEMU_LOG="strace" diff --git a/recipe/build_scripts/cross-cmake-linux-ppc64le.sh b/recipe/build_scripts/cross-cmake-linux-ppc64le.sh new file mode 100644 index 000000000..2e7a4ce1a --- /dev/null +++ b/recipe/build_scripts/cross-cmake-linux-ppc64le.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# --- Functions --- + +source "${RECIPE_DIR}/build_scripts/_functions.sh" + +# --- Main --- + +cmake_build_dir="${SRC_DIR}/_conda-cmake-build" + +mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" + +mkdir -p "${SRC_DIR}"/_conda-build-level-patches +cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/_conda-build-level-patches + +# Current conda zig may not be able to build the latest zig +SYSROOT_ARCH="powerpc64le" +ZIG_ARCH="powerpc64le" +QEMU_ARCH="ppc64le" +SYSROOT_PATH="${BUILD_PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot" +TARGET_INTERPRETER="${SYSROOT_PATH}/lib64/ld-2.28.so" + +export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" +export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" + +EXTRA_CMAKE_ARGS+=( \ + "-DCMAKE_BUILD_TYPE=Release" \ + "-DCMAKE_PREFIX_PATH=${PREFIX};${SYSROOT_PATH}" \ + "-DCMAKE_C_COMPILER=${CC}" \ + "-DCMAKE_CXX_COMPILER=${CXX}" \ + "-DZIG_SHARED_LLVM=ON" \ + "-DZIG_USE_LLVM_CONFIG=ON" \ + "-DZIG_TARGET_TRIPLE=${ZIG_ARCH}-linux-gnu" \ + "-DZIG_TARGET_MCPU=baseline" \ +) +# This path is too long for Target.zig +# "-DZIG_TARGET_DYNAMIC_LINKER=${TARGET_INTERPRETER}" \ + +source "${RECIPE_DIR}/build_scripts/_build_qemu_execve.sh" +build_qemu_execve "${QEMU_ARCH}" + +# export CROSSCOMPILING_EMULATOR="${BUILD_PREFIX}/bin/qemu-${SYSROOT_ARCH}" + +export CROSSCOMPILING_EMULATOR="${QEMU_EXECVE}" +export CROSSCOMPILING_LIBC="Wl,-dynamic-linker,${TARGET_INTERPRETER};-L${SYSROOT_PATH}/lib64;-lc" + +# CFLAGS="${CFLAGS} -mlongcall -mcmodel=large -Os -Wl,--no-relax -fPIE -pie" +# CXXFLAGS="${CXXFLAGS} -mlongcall -mcmodel=large -Os -Wl,--no-relax -fPIE -pie" +# CFLAGS=${CFLAGS//-fno-plt/} +# CXXFLAGS=${CXXFLAGS//-fno-plt/} + +export CFLAGS="${CFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${TARGET_INTERPRETER}" +export CXXFLAGS="${CXXFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic-linker,${TARGET_INTERPRETER}" + +export ZIG_CROSS_TARGET_TRIPLE="${ZIG_ARCH}"-linux-gnu +export ZIG_CROSS_TARGET_MCPU="ppc64le" + +USE_CMAKE_ARGS=1 + +CFLAGS=${CFLAGS//-fPIC/} +CXXFLAGS=${CXXFLAGS//-fPIC/} +CFLAGS=${CFLAGS//-fpie/} +CXXFLAGS=${CXXFLAGS//-fpie/} +CFLAGS=${CFLAGS//-fno-plt/} +CXXFLAGS=${CXXFLAGS//-fno-plt/} +export CFLAGS="${CFLAGS}" +export CXXFLAGS="${CXXFLAGS} -fno-optimize-sibling-calls -fno-threadsafe-statics" +echo "CFLAGS=${CFLAGS}" +echo "CXXFLAGS=${CXXFLAGS}" +configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" +cat <> "${cmake_build_dir}/config.zig" +pub const mem_leak_frames = 0; +EOF + +cmake_build_cmake_target "${cmake_build_dir}" zig2.c +# pushd "${cmake_build_dir}" +# patch -Np0 -i "${SRC_DIR}"/_conda-build-level-patches/xxxx-zig2.c-asm-clobber-list.patch --binary +# popd + +cmake_build_cmake_target "${cmake_build_dir}" zig2 +patchelf_sysroot_interpreter "${SYSROOT_PATH}" "${TARGET_INTERPRETER}" "${cmake_build_dir}/zig2" 1 + +sed -i -E "s@#define ZIG_CXX_COMPILER \".*/bin@#define ZIG_CXX_COMPILER \"${PREFIX}/bin@g" "${cmake_build_dir}/config.h" +pushd "${cmake_build_dir}" + cmake --build . -- -j"${CPU_COUNT}" > "${SRC_DIR}"/_make_post_zig2.log 2>&1 + cmake --install . +popd + +# patchelf --set-interpreter "${PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64/ld-linux-${SYSROOT_ARCH}.so.1" "${PREFIX}/bin/zig" +patchelf --set-rpath "\$ORIGIN/../${SYSROOT_ARCH}-conda-linux-gnu/sysroot/lib64" "${PREFIX}/bin/zig" +patchelf --add-rpath "\$ORIGIN/../lib" "${PREFIX}/bin/zig" + +# Use stage3/zig to self-build: This failed locally with SEGV in qemu +# build_zig_with_zig "${zig_build_dir}" "${PREFIX}/bin/zig" "${PREFIX}" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c6cf29398..501324efa 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,18 +1,21 @@ {% set name = "zig" %} {% set version = "0.13.0" %} -{% set llvm_version = "18" %} +{% set llvm_version = "19" %} package: name: {{ name|lower }} version: {{ version }} source: - - url: https://github.com/ziglang/zig/archive/refs/tags/{{ version }}.tar.gz - sha256: d3912858003e340f315224bf177d0f441d86b81f62854f5c141b6d51ab6b5516 + # - url: https://github.com/ziglang/zig/archive/refs/tags/{{ version }}.tar.gz + # sha256: d3912858003e340f315224bf177d0f441d86b81f62854f5c141b6d51ab6b5516 + - url: https://github.com/ziglang/zig/archive/refs/heads/master.zip + sha256: 535092b882cc5d64a2d07b3fe328cb15276eb2dfd87a5dfee8276c3d11f2f587 patches: - - patches/0001-cross-findllvm.patch # [linux and aarch64] + - patches/0001-cross-findllvm.patch # [linux and (aarch64 or ppc64le)] - patches/0002-cross-CMakeLists.txt.patch # [build_platform != target_platform] - patches/0003-cross-install.cmake.patch # [build_platform != target_platform] + - patches/0004-cross-ppc64le-signal.h.patch # [ppc64le] folder: zig-source # We use the upstrean binary as bootstrap. Installing previous conda version of zig @@ -42,12 +45,15 @@ requirements: - ninja # This is needed to build a qemu that intercepts the execve() call that zig2 emits - glib # [linux and build_platform != target_platform] - - make # [linux and build_platform != target_platform] - - pkg-config # [linux and build_platform != target_platform] - - sphinx # [linux and build_platform != target_platform] - - sphinx-rtd-theme # [linux and build_platform != target_platform] - sysroot_{{ build_platform }} >=2.28 # [linux and build_platform != target_platform] - - zlib # [linux and build_platform != target_platform] + - sysroot_{{ target_platform }} >=2.28 # [linux and build_platform != target_platform] + # - gcc_impl_linux-ppc64le # [linux and ppc64le] + # - make # [linux and build_platform != target_platform] + # - meson # [linux and build_platform != target_platform] + # - pkg-config # [linux and build_platform != target_platform] + # - sphinx # [linux and build_platform != target_platform] + # - sphinx-rtd-theme # [linux and build_platform != target_platform] + # - zlib # [linux and build_platform != target_platform] host: - {{ compiler('cxx') }} # [linux and build_platform != target_platform] - clangdev {{ llvm_version }} @@ -56,17 +62,16 @@ requirements: - lld {{ llvm_version }} - libclang-cpp {{ llvm_version }} - libcxx {{ cxx_compiler_version }} # [osx] - - sysroot_{{ target_platform }} >=2.28 # [linux and aarch64] - zlib - zstd run: - libxml2 # [linux and build_platform != target_platform] - - sysroot_{{ target_platform }} >=2.28 # [linux and aarch64] + - sysroot_{{ target_platform }} >=2.28 # [linux and (aarch64 or ppc64le)] test: requires: - patchelf # [aarch64] - - sysroot_{{ target_platform }} >=2.28 # [linux and aarch64] + - sysroot_{{ target_platform }} >=2.28 # [linux and (aarch64 or ppc64le)] commands: - test -f ${PREFIX}/bin/zig # [unix] # - test -f ${PREFIX}/doc/langref.html # [unix] @@ -88,9 +93,9 @@ test: {% endfor %} # Functionality tests - - readelf -l ${PREFIX}/bin/zig # [aarch64] + - readelf -l ${PREFIX}/bin/zig # [(aarch64 or ppc64le)] - patchelf --set-interpreter ${PREFIX}/aarch64-conda-linux-gnu/sysroot/lib64/ld-linux-aarch64.so.1 ${PREFIX}/bin/zig # [aarch64] - - readelf -l ${PREFIX}/bin/zig # [aarch64] + - readelf -l ${PREFIX}/bin/zig # [(aarch64 or ppc64le)] - zig version - zig zen - zig init diff --git a/recipe/patches/0004-cross-ppc64le-signal.h.patch b/recipe/patches/0004-cross-ppc64le-signal.h.patch new file mode 100644 index 000000000..b1fd5d7f4 --- /dev/null +++ b/recipe/patches/0004-cross-ppc64le-signal.h.patch @@ -0,0 +1,4 @@ +diff --git a/stage1/zig.h b/stage1/zig.h +index 05529feec7..38f01ca020 100644 +--- a/stage1/zig.h ++++ b/stage1/zig.h diff --git a/recipe/patches/xxxx-zig2.c-asm-clobber-list.patch b/recipe/patches/xxxx-zig2.c-asm-clobber-list.patch new file mode 100644 index 000000000..3006a1e8c --- /dev/null +++ b/recipe/patches/xxxx-zig2.c-asm-clobber-list.patch @@ -0,0 +1,38 @@ +--- zig2.c 2024-06-20 11:33:33.032130211 -0500 ++++ zig2.c 2024-06-20 11:46:49.218920956 -0500 +@@ -845078,7 +845078,7 @@ + register uintptr_t const t6 __asm("r5") = a3; + register uintptr_t const t7 __asm("r6") = a4; + register uintptr_t const t8 __asm("r7") = a5; +- __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6), [arg4]"r"(t7), [arg5]"r"(t8): "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); ++ __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6), [arg4]"r"(t7), [arg5]"r"(t8): "memory", "cr0", "r8", "r9", "r10", "r11", "r12"); + t1 = t2; + return t1; + } +@@ -1766263,7 +1766263,7 @@ + register uintptr_t const t7 __asm("r6") = a4; + register uintptr_t const t8 __asm("r7") = a5; + register uintptr_t const t9 __asm("r8") = a6; +- __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6), [arg4]"r"(t7), [arg5]"r"(t8), [arg6]"r"(t9): "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); ++ __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6), [arg4]"r"(t7), [arg5]"r"(t8), [arg6]"r"(t9): "memory", "cr0", "r9", "r10", "r11", "r12"); + t1 = t2; + return t1; + } +@@ -1939383,7 +1939383,7 @@ + register uintptr_t const t4 __asm("r3") = a1; + register uintptr_t const t5 __asm("r4") = a2; + register uintptr_t const t6 __asm("r5") = a3; +- __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6): "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); ++ __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6): "memory", "cr0", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); + t1 = t2; + return t1; + } +@@ -2549503,7 +2549503,7 @@ + register uintptr_t const t5 __asm("r4") = a2; + register uintptr_t const t6 __asm("r5") = a3; + register uintptr_t const t7 __asm("r6") = a4; +- __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6), [arg4]"r"(t7): "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); ++ __asm volatile(" sc\n bns+ 1f\n neg 3, 3\n 1:": [ret]"=r"(t2): [number]"r"(t3), [arg1]"r"(t4), [arg2]"r"(t5), [arg3]"r"(t6), [arg4]"r"(t7): "memory", "cr0", "r7", "r8", "r9", "r10", "r11", "r12"); + t1 = t2; + return t1; + } From 1925e5557c3bcdf09b650df9079495cca5af4a38 Mon Sep 17 00:00:00 2001 From: memento Date: Tue, 19 Nov 2024 15:50:33 -0600 Subject: [PATCH 18/22] (ref) try native cmake build --- .azure-pipelines/azure-pipelines-linux.yml | 4 - .ci_support/linux_64_.yaml | 4 +- .ci_support/linux_aarch64_.yaml | 4 +- .ci_support/linux_ppc64le_.yaml | 607 ------------------ .ci_support/osx_64_.yaml | 4 +- .ci_support/osx_arm64_.yaml | 4 +- .scripts/run_osx_build.sh | 2 +- README.md | 7 - azure-pipelines.yml | 2 +- conda-forge.yml | 2 +- recipe/build.sh | 2 +- .../native-cmake-linux-ppc64le.sh | 30 + recipe/conda_build_config.yaml | 5 + recipe/meta.yaml | 10 +- 14 files changed, 50 insertions(+), 637 deletions(-) delete mode 100644 .ci_support/linux_ppc64le_.yaml create mode 100644 recipe/build_scripts/native-cmake-linux-ppc64le.sh diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 4ced2e505..9514627e7 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -16,10 +16,6 @@ jobs: CONFIG: linux_aarch64_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - linux_ppc64le_: - CONFIG: linux_ppc64le_ - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 variables: {} diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index c7f8ba8fa..a9c90c806 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -7,7 +7,7 @@ c_stdlib: c_stdlib_version: - '2.28' cdt_name: -- cos7 +- conda channel_sources: - conda-forge channel_targets: @@ -23,8 +23,6 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version -- - c_stdlib_version - - cdt_name zlib: - '1' zstd: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index d45fc59a9..c4ad6a721 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -11,7 +11,7 @@ c_stdlib_version: cdt_arch: - aarch64 cdt_name: -- cos7 +- conda channel_sources: - conda-forge channel_targets: @@ -27,8 +27,6 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version -- - c_stdlib_version - - cdt_name zlib: - '1' zstd: diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml deleted file mode 100644 index b408b7ce1..000000000 --- a/.ci_support/linux_ppc64le_.yaml +++ /dev/null @@ -1,607 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '13' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.28' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cxx_compiler: -- gxx -cxx_compiler_version: -- '13' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -target_platform: -- linux-ppc64le -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - c_stdlib_version - - cdt_name -zlib: -- '1' -zstd: -- '1.5' -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -build_platform: -- linux-64 -CMAKE_CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static -CROSSCOMPILING_EMULATOR: -- /usr/bin/qemu-ppc64le-static diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index 4b1cc3d0a..d5ef4ac59 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '17' +- '18' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '17' +- '18' macos_machine: - x86_64-apple-darwin13.4.0 target_platform: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index 5f91874f5..568e5a2f9 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '17' +- '18' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '17' +- '18' macos_machine: - arm64-apple-darwin20.0.0 target_platform: diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 7f948c41f..0b3649846 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -33,7 +33,7 @@ rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true ( endgroup "Provisioning base env with micromamba" ) 2> /dev/null ( startgroup "Configuring conda" ) 2> /dev/null - +echo "Activating environment" source "${MINIFORGE_HOME}/etc/profile.d/conda.sh" conda activate base export CONDA_SOLVER="libmamba" diff --git a/README.md b/README.md index 1f8992dc2..e3acdb76a 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,6 @@ Current build status variant - - linux_ppc64le - - - variant - - osx_64 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a30f040e8..8bdb76f11 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,7 +19,7 @@ stages: echo "##vso[task.setvariable variable=log]$git_log" displayName: Obtain commit message - bash: echo "##vso[task.setvariable variable=RET]false" - condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')) + condition: and(eq(variables['Build.Reason'], 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))) displayName: Skip build? - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" name: result diff --git a/conda-forge.yml b/conda-forge.yml index 316d6f265..a1c836a88 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -8,6 +8,6 @@ conda_build: pkg_format: '2' build_platform: linux_aarch64: linux_64 - linux_ppc64le: linux_64 + # linux_ppc64le: linux_64 osx_arm64: osx_64 test: native_and_emulated diff --git a/recipe/build.sh b/recipe/build.sh index cb91a6f64..528e145ca 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -21,7 +21,7 @@ case "${target_platform}" in bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-linux-aarch64.sh ;; linux-ppc64le) - bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-linux-ppc64le.sh + bash "${RECIPE_DIR}"/build_scripts/native-"${builder}"-linux-ppc64le.sh ;; osx-arm64) bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-osx-arm64.sh diff --git a/recipe/build_scripts/native-cmake-linux-ppc64le.sh b/recipe/build_scripts/native-cmake-linux-ppc64le.sh new file mode 100644 index 000000000..a4c1b04e5 --- /dev/null +++ b/recipe/build_scripts/native-cmake-linux-ppc64le.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# --- Functions --- + +source "${RECIPE_DIR}/build_scripts/_functions.sh" + +# --- Main --- + +export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" +export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" + +cmake_build_dir="${SRC_DIR}/build-release" +mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" + +SYSROOT_ARCH="powerpc64le" + +EXTRA_CMAKE_ARGS+=( \ + "-DCMAKE_BUILD_TYPE=Release" \ + "-DZIG_SHARED_LLVM=ON" \ + "-DZIG_USE_LLVM_CONFIG=ON" \ + "-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-linux-gnu" \ +) + +# Zig searches for libm.so/libc.so in incorrect paths (libm.so with hard-coded /usr/lib64/libmvec_nonshared.a) +modify_libc_libm_for_zig "${BUILD_PREFIX}" + +# When using installed c++ libs, zig needs libzigcpp.a +configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" +cmake_build_install "${cmake_build_dir}" diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 68d99ad7b..9f167e65d 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -5,3 +5,8 @@ build_c_stdlib: - sysroot # [linux] docker_image: - quay.io/condaforge/linux-anvil-alma-x86_64:8 # [linux and x86_64] + +c_compiler: + - clang # [linux and ppc64le] +cxx_compiler: + - clangxx # [linux and ppc64le] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 205ebe6fc..d8079ea6c 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,16 +1,16 @@ {% set name = "zig" %} {% set version = "0.13.0" %} -{% set llvm_version = "19" %} +{% set llvm_version = "18" %} package: name: {{ name|lower }} version: {{ version }} source: - # - url: https://github.com/ziglang/zig/archive/refs/tags/{{ version }}.tar.gz - # sha256: d3912858003e340f315224bf177d0f441d86b81f62854f5c141b6d51ab6b5516 - - url: https://github.com/ziglang/zig/archive/refs/heads/master.zip - sha256: 535092b882cc5d64a2d07b3fe328cb15276eb2dfd87a5dfee8276c3d11f2f587 + - url: https://github.com/ziglang/zig/archive/refs/tags/{{ version }}.tar.gz + sha256: d3912858003e340f315224bf177d0f441d86b81f62854f5c141b6d51ab6b5516 + # - url: https://github.com/ziglang/zig/archive/refs/heads/master.zip + # sha256: 535092b882cc5d64a2d07b3fe328cb15276eb2dfd87a5dfee8276c3d11f2f587 patches: - patches/0001-cross-findllvm.patch # [linux and (aarch64 or ppc64le)] - patches/0002-cross-CMakeLists.txt.patch # [build_platform != target_platform] From 22a11c3b0e3a20ab89b5e12cffa482c6c267a57f Mon Sep 17 00:00:00 2001 From: memento Date: Tue, 19 Nov 2024 15:53:55 -0600 Subject: [PATCH 19/22] (ref) try native cmake build --- .azure-pipelines/azure-pipelines-osx.yml | 40 ----- .azure-pipelines/azure-pipelines-win.yml | 37 ----- .../{osx_64_.yaml => linux_ppc64le_.yaml} | 20 ++- .ci_support/osx_arm64_.yaml | 31 ---- .ci_support/win_64_.yaml | 18 --- .scripts/run_osx_build.sh | 119 -------------- .scripts/run_win_build.bat | 152 ------------------ .travis.yml | 25 +++ README.md | 27 ++-- azure-pipelines.yml | 4 +- conda-forge.yml | 2 + recipe/meta.yaml | 2 +- 12 files changed, 48 insertions(+), 429 deletions(-) delete mode 100755 .azure-pipelines/azure-pipelines-osx.yml delete mode 100755 .azure-pipelines/azure-pipelines-win.yml rename .ci_support/{osx_64_.yaml => linux_ppc64le_.yaml} (62%) delete mode 100644 .ci_support/osx_arm64_.yaml delete mode 100644 .ci_support/win_64_.yaml delete mode 100755 .scripts/run_osx_build.sh delete mode 100755 .scripts/run_win_build.bat create mode 100644 .travis.yml diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml deleted file mode 100755 index ac0bf384e..000000000 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: osx - pool: - vmImage: macOS-13 - strategy: - matrix: - osx_64_: - CONFIG: osx_64_ - UPLOAD_PACKAGES: 'True' - osx_arm64_: - CONFIG: osx_arm64_ - UPLOAD_PACKAGES: 'True' - timeoutInMinutes: 360 - variables: {} - - steps: - # TODO: Fast finish on azure pipelines? - - script: | - export CI=azure - export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) - export remote_url=$(Build.Repository.Uri) - export sha=$(Build.SourceVersion) - export OSX_FORCE_SDK_DOWNLOAD="1" - export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - ./.scripts/run_osx_build.sh - displayName: Run OSX build - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml deleted file mode 100755 index 990191763..000000000 --- a/.azure-pipelines/azure-pipelines-win.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: win - pool: - vmImage: windows-2022 - strategy: - matrix: - win_64_: - CONFIG: win_64_ - UPLOAD_PACKAGES: 'True' - timeoutInMinutes: 360 - variables: - CONDA_BLD_PATH: D:\\bld\\ - MINIFORGE_HOME: D:\Miniforge - UPLOAD_TEMP: D:\\tmp - - steps: - - - script: | - call ".scripts\run_win_build.bat" - displayName: Run Windows build - env: - MINIFORGE_HOME: $(MINIFORGE_HOME) - PYTHONUNBUFFERED: 1 - CONFIG: $(CONFIG) - CI: azure - flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) - remote_url: $(Build.Repository.Uri) - sha: $(Build.SourceVersion) - UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) - UPLOAD_TEMP: $(UPLOAD_TEMP) - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/osx_64_.yaml b/.ci_support/linux_ppc64le_.yaml similarity index 62% rename from .ci_support/osx_64_.yaml rename to .ci_support/linux_ppc64le_.yaml index d5ef4ac59..fbfc1d0f4 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -1,15 +1,13 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.3' -MACOSX_SDK_VERSION: -- '11.3' c_compiler: - clang c_compiler_version: -- '18' +- '13' c_stdlib: -- macosx_deployment_target +- sysroot c_stdlib_version: -- '11.3' +- '2.28' +cdt_name: +- conda channel_sources: - conda-forge channel_targets: @@ -17,11 +15,11 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '18' -macos_machine: -- x86_64-apple-darwin13.4.0 +- '13' +docker_image: +- quay.io/condaforge/linux-anvil-ppc64le target_platform: -- osx-64 +- linux-ppc64le zip_keys: - - c_compiler_version - cxx_compiler_version diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml deleted file mode 100644 index 568e5a2f9..000000000 --- a/.ci_support/osx_arm64_.yaml +++ /dev/null @@ -1,31 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '11.0' -c_compiler: -- clang -c_compiler_version: -- '18' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cxx_compiler: -- clangxx -cxx_compiler_version: -- '18' -macos_machine: -- arm64-apple-darwin20.0.0 -target_platform: -- osx-arm64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -zlib: -- '1' -zstd: -- '1.5' diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml deleted file mode 100644 index 6b2002f20..000000000 --- a/.ci_support/win_64_.yaml +++ /dev/null @@ -1,18 +0,0 @@ -c_compiler: -- vs2019 -c_stdlib: -- vs -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cxx_compiler: -- vs2019 -libxml2: -- '2' -target_platform: -- win-64 -zlib: -- '1' -zstd: -- '1.5' diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh deleted file mode 100755 index 0b3649846..000000000 --- a/.scripts/run_osx_build.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env bash - -# -*- mode: jinja-shell -*- - -source .scripts/logging_utils.sh - -set -xe - -MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} -MINIFORGE_HOME=${MINIFORGE_HOME%/} # remove trailing slash - -( startgroup "Provisioning base env with micromamba" ) 2> /dev/null -MICROMAMBA_VERSION="1.5.10-0" -if [[ "$(uname -m)" == "arm64" ]]; then - osx_arch="osx-arm64" -else - osx_arch="osx-64" -fi -MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${osx_arch}" -MAMBA_ROOT_PREFIX="${MINIFORGE_HOME}-micromamba-$(date +%s)" -echo "Downloading micromamba ${MICROMAMBA_VERSION}" -micromamba_exe="$(mktemp -d)/micromamba" -curl -L -o "${micromamba_exe}" "${MICROMAMBA_URL}" -chmod +x "${micromamba_exe}" -echo "Creating environment" -"${micromamba_exe}" create --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \ - --channel conda-forge \ - pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -echo "Moving pkgs cache from ${MAMBA_ROOT_PREFIX} to ${MINIFORGE_HOME}" -mv "${MAMBA_ROOT_PREFIX}/pkgs" "${MINIFORGE_HOME}" -echo "Cleaning up micromamba" -rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true -( endgroup "Provisioning base env with micromamba" ) 2> /dev/null - -( startgroup "Configuring conda" ) 2> /dev/null -echo "Activating environment" -source "${MINIFORGE_HOME}/etc/profile.d/conda.sh" -conda activate base -export CONDA_SOLVER="libmamba" -export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 - - - - - -echo -e "\n\nSetting up the condarc and mangling the compiler." -setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml - -if [[ "${CI:-}" != "" ]]; then - mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml -fi - -if [[ "${CI:-}" != "" ]]; then - echo -e "\n\nMangling homebrew in the CI to avoid conflicts." - /usr/bin/sudo mangle_homebrew - /usr/bin/sudo -k -else - echo -e "\n\nNot mangling homebrew as we are not running in CI" -fi - -if [[ "${sha:-}" == "" ]]; then - sha=$(git rev-parse HEAD) -fi - -echo -e "\n\nRunning the build setup script." -source run_conda_forge_build_setup - - - -( endgroup "Configuring conda" ) 2> /dev/null - -echo -e "\n\nMaking the build clobber file" -make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml - -if [[ -f LICENSE.txt ]]; then - cp LICENSE.txt "recipe/recipe-scripts-license.txt" -fi - -if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then - if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" - fi - conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ - ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml - - # Drop into an interactive shell - /bin/bash -else - - if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" - fi - - conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \ - --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \ - --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha" - - ( startgroup "Inspecting artifacts" ) 2> /dev/null - - # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir ./recipe -m ./.ci_support/${CONFIG}.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" - - ( endgroup "Inspecting artifacts" ) 2> /dev/null - ( startgroup "Validating outputs" ) 2> /dev/null - - validate_recipe_outputs "${FEEDSTOCK_NAME}" - - ( endgroup "Validating outputs" ) 2> /dev/null - - ( startgroup "Uploading packages" ) 2> /dev/null - - if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then - upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml - fi - - ( endgroup "Uploading packages" ) 2> /dev/null -fi \ No newline at end of file diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat deleted file mode 100755 index d3c0345e5..000000000 --- a/.scripts/run_win_build.bat +++ /dev/null @@ -1,152 +0,0 @@ -:: PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here -:: will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent -:: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also -:: benefit from the improvement. - -:: INPUTS (required environment variables) -:: CONFIG: name of the .ci_support/*.yaml file for this job -:: CI: azure, github_actions, or unset -:: MINIFORGE_HOME: where to install the base conda environment -:: UPLOAD_PACKAGES: true or false -:: UPLOAD_ON_BRANCH: true or false - -setlocal enableextensions enabledelayedexpansion - -if "%MINIFORGE_HOME%"=="" set "MINIFORGE_HOME=%USERPROFILE%\Miniforge3" -:: Remove trailing backslash, if present -if "%MINIFORGE_HOME:~-1%"=="\" set "MINIFORGE_HOME=%MINIFORGE_HOME:~0,-1%" -call :start_group "Provisioning base env with micromamba" -set "MAMBA_ROOT_PREFIX=%MINIFORGE_HOME%-micromamba-%RANDOM%" -set "MICROMAMBA_VERSION=1.5.10-0" -set "MICROMAMBA_URL=https://github.com/mamba-org/micromamba-releases/releases/download/%MICROMAMBA_VERSION%/micromamba-win-64" -set "MICROMAMBA_TMPDIR=%TMP%\micromamba-%RANDOM%" -set "MICROMAMBA_EXE=%MICROMAMBA_TMPDIR%\micromamba.exe" - -echo Downloading micromamba %MICROMAMBA_VERSION% -if not exist "%MICROMAMBA_TMPDIR%" mkdir "%MICROMAMBA_TMPDIR%" -certutil -urlcache -split -f "%MICROMAMBA_URL%" "%MICROMAMBA_EXE%" -if !errorlevel! neq 0 exit /b !errorlevel! - -echo Creating environment -call "%MICROMAMBA_EXE%" create --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%MINIFORGE_HOME%" ^ - --channel conda-forge ^ - pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -if !errorlevel! neq 0 exit /b !errorlevel! -echo Moving pkgs cache from %MAMBA_ROOT_PREFIX% to %MINIFORGE_HOME% -move /Y "%MAMBA_ROOT_PREFIX%\pkgs" "%MINIFORGE_HOME%" -if !errorlevel! neq 0 exit /b !errorlevel! -echo Removing %MAMBA_ROOT_PREFIX% -del /S /Q "%MAMBA_ROOT_PREFIX%" -del /S /Q "%MICROMAMBA_TMPDIR%" -call :end_group - -call :start_group "Configuring conda" - -:: Activate the base conda environment -call "%MINIFORGE_HOME%\Scripts\activate.bat" -:: Configure the solver -set "CONDA_SOLVER=libmamba" -if !errorlevel! neq 0 exit /b !errorlevel! -set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" - -:: Set basic configuration -echo Setting up configuration -setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml -if !errorlevel! neq 0 exit /b !errorlevel! -echo Running build setup -CALL run_conda_forge_build_setup - - -if !errorlevel! neq 0 exit /b !errorlevel! - -if EXIST LICENSE.txt ( - echo Copying feedstock license - copy LICENSE.txt "recipe\\recipe-scripts-license.txt" -) -if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( - if [%CROSSCOMPILING_EMULATOR%] == [] ( - set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" - ) -) - -if NOT [%flow_run_id%] == [] ( - set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" -) - -call :end_group - -:: Build the recipe -echo Building recipe -conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% -if !errorlevel! neq 0 exit /b !errorlevel! - -call :start_group "Inspecting artifacts" -:: inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 -WHERE inspect_artifacts >nul 2>nul && inspect_artifacts --recipe-dir ".\recipe" -m .ci_support\%CONFIG%.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" -call :end_group - -:: Prepare some environment variables for the upload step -if /i "%CI%" == "github_actions" ( - set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" - set "GIT_BRANCH=%GITHUB_REF:refs/heads/=%" - if /i "%GITHUB_EVENT_NAME%" == "pull_request" ( - set "IS_PR_BUILD=True" - ) else ( - set "IS_PR_BUILD=False" - ) - set "TEMP=%RUNNER_TEMP%" -) -if /i "%CI%" == "azure" ( - set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" - set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" - if /i "%BUILD_REASON%" == "PullRequest" ( - set "IS_PR_BUILD=True" - ) else ( - set "IS_PR_BUILD=False" - ) - set "TEMP=%UPLOAD_TEMP%" -) - -:: Validate -call :start_group "Validating outputs" -validate_recipe_outputs "%FEEDSTOCK_NAME%" -if !errorlevel! neq 0 exit /b !errorlevel! -call :end_group - -if /i "%UPLOAD_PACKAGES%" == "true" ( - if /i "%IS_PR_BUILD%" == "false" ( - call :start_group "Uploading packages" - if not exist "%TEMP%\" md "%TEMP%" - set "TMP=%TEMP%" - upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml - if !errorlevel! neq 0 exit /b !errorlevel! - call :end_group - ) -) - -exit - -:: Logging subroutines - -:start_group -if /i "%CI%" == "github_actions" ( - echo ::group::%~1 - exit /b -) -if /i "%CI%" == "azure" ( - echo ##[group]%~1 - exit /b -) -echo %~1 -exit /b - -:end_group -if /i "%CI%" == "github_actions" ( - echo ::endgroup:: - exit /b -) -if /i "%CI%" == "azure" ( - echo ##[endgroup] - exit /b -) -exit /b \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..7f6b675e1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. + +language: shell + + + +jobs: + include: + - env: CONFIG=linux_ppc64le_ UPLOAD_PACKAGES=True PLATFORM=linux-ppc64le DOCKER_IMAGE=quay.io/condaforge/linux-anvil-ppc64le + os: linux + arch: ppc64le + dist: focal + +script: + - export CI=travis + - export GIT_BRANCH="$TRAVIS_BRANCH" + - export flow_run_id="travis_$TRAVIS_JOB_ID" + - export sha="$TRAVIS_COMMIT" + - export remote_url="https://github.com/$TRAVIS_REPO_SLUG" + - export FEEDSTOCK_NAME=$(basename ${TRAVIS_REPO_SLUG}) + - if [[ "${TRAVIS_PULL_REQUEST:-}" == "false" ]]; then export IS_PR_BUILD="False"; else export IS_PR_BUILD="True"; fi + + + - if [[ ${PLATFORM} =~ .*linux.* ]]; then CONDA_FORGE_DOCKER_RUN_ARGS="--network=host --security-opt=seccomp=unconfined" ./.scripts/run_docker_build.sh; fi \ No newline at end of file diff --git a/README.md b/README.md index e3acdb76a..ec2bd6e9d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,14 @@ Current build status ==================== - +
+ + + @@ -53,24 +60,10 @@ Current build status - - - - - - - + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8bdb76f11..d309e84b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,6 +28,4 @@ stages: condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) dependsOn: Check jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml - - template: ./.azure-pipelines/azure-pipelines-win.yml + - template: ./.azure-pipelines/azure-pipelines-linux.yml \ No newline at end of file diff --git a/conda-forge.yml b/conda-forge.yml index a1c836a88..9adf6acbb 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -6,6 +6,8 @@ github: tooling_branch_name: main conda_build: pkg_format: '2' +provider: + linux_ppc64le: default build_platform: linux_aarch64: linux_64 # linux_ppc64le: linux_64 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d8079ea6c..5db782907 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -38,7 +38,7 @@ source: build: number: 5 - skip: true # [not linux and not osx] + skip: true # [not linux and not ppc64le] script_env: - BUILD_WITH_CMAKE=1 # [(linux or osx or win) and x86_64] ignore_run_exports: From 0b4e9edd9e49111a2c9eabce9a8c3905cc6e7988 Mon Sep 17 00:00:00 2001 From: memento Date: Wed, 20 Nov 2024 09:40:02 -0600 Subject: [PATCH 20/22] (ref) try native cmake build --- .azure-pipelines/azure-pipelines-linux.yml | 48 ---------------------- .ci_support/linux_64_.yaml | 29 ------------- .ci_support/linux_aarch64_.yaml | 33 --------------- README.md | 39 ------------------ azure-pipelines.yml | 31 -------------- recipe/build.sh | 1 + recipe/meta.yaml | 2 +- 7 files changed, 2 insertions(+), 181 deletions(-) delete mode 100755 .azure-pipelines/azure-pipelines-linux.yml delete mode 100644 .ci_support/linux_64_.yaml delete mode 100644 .ci_support/linux_aarch64_.yaml delete mode 100644 azure-pipelines.yml diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml deleted file mode 100755 index 9514627e7..000000000 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: linux - pool: - vmImage: ubuntu-latest - strategy: - matrix: - linux_64_: - CONFIG: linux_64_ - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-alma-x86_64:8 - linux_aarch64_: - CONFIG: linux_aarch64_ - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - timeoutInMinutes: 360 - variables: {} - - steps: - # configure qemu binfmt-misc running. This allows us to run docker containers - # embedded qemu-static - - script: | - docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes - ls /proc/sys/fs/binfmt_misc/ - condition: not(startsWith(variables['CONFIG'], 'linux_64')) - displayName: Configure binfmt_misc - - - script: | - export CI=azure - export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) - export remote_url=$(Build.Repository.Uri) - export sha=$(Build.SourceVersion) - export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - .scripts/run_docker_build.sh - displayName: Run docker build - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml deleted file mode 100644 index a9c90c806..000000000 --- a/.ci_support/linux_64_.yaml +++ /dev/null @@ -1,29 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '13' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.28' -cdt_name: -- conda -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cxx_compiler: -- gxx -cxx_compiler_version: -- '13' -docker_image: -- quay.io/condaforge/linux-anvil-alma-x86_64:8 -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -zlib: -- '1' -zstd: -- '1.5' diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml deleted file mode 100644 index c4ad6a721..000000000 --- a/.ci_support/linux_aarch64_.yaml +++ /dev/null @@ -1,33 +0,0 @@ -BUILD: -- aarch64-conda_cos7-linux-gnu -c_compiler: -- gcc -c_compiler_version: -- '13' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.28' -cdt_arch: -- aarch64 -cdt_name: -- conda -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cxx_compiler: -- gxx -cxx_compiler_version: -- '13' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -target_platform: -- linux-aarch64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -zlib: -- '1' -zstd: -- '1.5' diff --git a/README.md b/README.md index ec2bd6e9d..2bbe216e7 100644 --- a/README.md +++ b/README.md @@ -33,45 +33,6 @@ Current build status - - - - -
Travis + + linux + +
Azure
osx_64 - - variant - -
osx_arm64 - - variant - -
win_64linux_ppc64le - variant + variant
Azure -
- - - - - - - - - - - - - - - - - - -
VariantStatus
linux_64 - - variant - -
linux_aarch64 - - variant - -
linux_ppc64le - - variant - -
-
-
Current release info diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index d309e84b2..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -stages: -- stage: Check - jobs: - - job: Skip - pool: - vmImage: 'ubuntu-22.04' - variables: - DECODE_PERCENTS: 'false' - RET: 'true' - steps: - - checkout: self - fetchDepth: '2' - - bash: | - git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` - echo "##vso[task.setvariable variable=log]$git_log" - displayName: Obtain commit message - - bash: echo "##vso[task.setvariable variable=RET]false" - condition: and(eq(variables['Build.Reason'], 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))) - displayName: Skip build? - - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" - name: result - displayName: Export result -- stage: Build - condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) - dependsOn: Check - jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml \ No newline at end of file diff --git a/recipe/build.sh b/recipe/build.sh index 528e145ca..14d90c1a6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -14,6 +14,7 @@ case "${target_platform}" in ;; osx-64) bash "${RECIPE_DIR}"/build_scripts/native-"${builder}"-osx-64.sh + ;; win-64) bash "${RECIPE_DIR}"/build_scripts/native-"${builder}"-win-64.sh ;; diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5db782907..9a08a4f4f 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -38,7 +38,7 @@ source: build: number: 5 - skip: true # [not linux and not ppc64le] + skip: true # [not linux or not ppc64le] script_env: - BUILD_WITH_CMAKE=1 # [(linux or osx or win) and x86_64] ignore_run_exports: From d99bf27f8f3b703c60b3ae4b520210edebca326e Mon Sep 17 00:00:00 2001 From: memento Date: Wed, 20 Nov 2024 11:47:40 -0600 Subject: [PATCH 21/22] (ref) try native cmake build --- recipe/meta.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 9a08a4f4f..32460ead4 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -40,7 +40,7 @@ build: number: 5 skip: true # [not linux or not ppc64le] script_env: - - BUILD_WITH_CMAKE=1 # [(linux or osx or win) and x86_64] + - BUILD_WITH_CMAKE=1 # [(linux or osx or win) and (x86_64 or ppc64le)] ignore_run_exports: - __glibc # [linux and aarch64] - ucrt # [win] @@ -50,8 +50,8 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - {{ c_stdlib }}_{{ build_platform }} >={{ c_stdlib_version }} # [linux and aarch64] - - {{ stdlib("c") }} + - {{ stdlib('c') }} + # - {{ c_stdlib }}_{{ build_platform }} >={{ c_stdlib_version }} # [linux and aarch64] - cmake >=3.5 - ninja # This is needed to build a qemu that intercepts the execve() call that zig2 emits From 9be787ff9c9268cb372f02039876970229d20faa Mon Sep 17 00:00:00 2001 From: memento Date: Fri, 22 Nov 2024 16:49:59 -0600 Subject: [PATCH 22/22] (ref) cross cmake build with stub libc --- .azure-pipelines/azure-pipelines-linux.yml | 44 +++++++++++++++++++ .ci_support/linux_ppc64le_.yaml | 29 ++++++++---- .travis.yml | 25 ----------- README.md | 28 +++++++++--- azure-pipelines.yml | 31 +++++++++++++ build-locally.py | 7 +++ conda-forge.yml | 4 +- recipe/build.sh | 2 +- recipe/build_scripts/_build_qemu_execve.sh | 2 +- .../cross-cmake-linux-ppc64le.sh | 39 +++++++++------- recipe/conda_build_config.yaml | 9 +--- recipe/meta.yaml | 6 ++- 12 files changed, 156 insertions(+), 70 deletions(-) create mode 100755 .azure-pipelines/azure-pipelines-linux.yml delete mode 100644 .travis.yml create mode 100644 azure-pipelines.yml diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml new file mode 100755 index 000000000..f3792dd3f --- /dev/null +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -0,0 +1,44 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: linux + pool: + vmImage: ubuntu-latest + strategy: + matrix: + linux_ppc64le_: + CONFIG: linux_ppc64le_ + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + timeoutInMinutes: 360 + variables: {} + + steps: + # configure qemu binfmt-misc running. This allows us to run docker containers + # embedded qemu-static + - script: | + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + ls /proc/sys/fs/binfmt_misc/ + condition: not(startsWith(variables['CONFIG'], 'linux_64')) + displayName: Configure binfmt_misc + + - script: | + export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + .scripts/run_docker_build.sh + displayName: Run docker build + env: + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index fbfc1d0f4..3e92dbcf1 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -1,5 +1,5 @@ c_compiler: -- clang +- gcc c_compiler_version: - '13' c_stdlib: @@ -12,18 +12,29 @@ channel_sources: - conda-forge channel_targets: - conda-forge main -cxx_compiler: -- clangxx -cxx_compiler_version: -- '13' docker_image: -- quay.io/condaforge/linux-anvil-ppc64le +- quay.io/condaforge/linux-anvil-cos7-x86_64 target_platform: - linux-ppc64le -zip_keys: -- - c_compiler_version - - cxx_compiler_version zlib: - '1' zstd: - '1.5' +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +build_platform: +- linux-64 +CMAKE_CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static +CROSSCOMPILING_EMULATOR: +- /usr/bin/qemu-ppc64le-static diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7f6b675e1..000000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. - -language: shell - - - -jobs: - include: - - env: CONFIG=linux_ppc64le_ UPLOAD_PACKAGES=True PLATFORM=linux-ppc64le DOCKER_IMAGE=quay.io/condaforge/linux-anvil-ppc64le - os: linux - arch: ppc64le - dist: focal - -script: - - export CI=travis - - export GIT_BRANCH="$TRAVIS_BRANCH" - - export flow_run_id="travis_$TRAVIS_JOB_ID" - - export sha="$TRAVIS_COMMIT" - - export remote_url="https://github.com/$TRAVIS_REPO_SLUG" - - export FEEDSTOCK_NAME=$(basename ${TRAVIS_REPO_SLUG}) - - if [[ "${TRAVIS_PULL_REQUEST:-}" == "false" ]]; then export IS_PR_BUILD="False"; else export IS_PR_BUILD="True"; fi - - - - if [[ ${PLATFORM} =~ .*linux.* ]]; then CONDA_FORGE_DOCKER_RUN_ARGS="--network=host --security-opt=seccomp=unconfined" ./.scripts/run_docker_build.sh; fi \ No newline at end of file diff --git a/README.md b/README.md index 2bbe216e7..941515c4a 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,30 @@ Current build status ==================== - - +
Travis
+ + +
Azure - - linux - +
+ + + + + + + + + + + + +
VariantStatus
linux_ppc64le + + variant + +
+
diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..d309e84b2 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,31 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +stages: +- stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-22.04' + variables: + DECODE_PERCENTS: 'false' + RET: 'true' + steps: + - checkout: self + fetchDepth: '2' + - bash: | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` + echo "##vso[task.setvariable variable=log]$git_log" + displayName: Obtain commit message + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: and(eq(variables['Build.Reason'], 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))) + displayName: Skip build? + - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" + name: result + displayName: Export result +- stage: Build + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: Check + jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index 6788aea66..c4a56c667 100755 --- a/build-locally.py +++ b/build-locally.py @@ -26,6 +26,13 @@ def setup_environment(ns): os.path.dirname(__file__), "miniforge3" ) + # The default cache location might not be writable using docker on macOS. + if ns.config.startswith("linux") and platform.system() == "Darwin": + os.environ["CONDA_FORGE_DOCKER_RUN_ARGS"] = ( + os.environ.get("CONDA_FORGE_DOCKER_RUN_ARGS", "") + + " -e RATTLER_CACHE_DIR=/tmp/rattler_cache" + ) + def run_docker_build(ns): script = ".scripts/run_docker_build.sh" diff --git a/conda-forge.yml b/conda-forge.yml index 9adf6acbb..316d6f265 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -6,10 +6,8 @@ github: tooling_branch_name: main conda_build: pkg_format: '2' -provider: - linux_ppc64le: default build_platform: linux_aarch64: linux_64 - # linux_ppc64le: linux_64 + linux_ppc64le: linux_64 osx_arm64: osx_64 test: native_and_emulated diff --git a/recipe/build.sh b/recipe/build.sh index 14d90c1a6..ddaaefcc6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -22,7 +22,7 @@ case "${target_platform}" in bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-linux-aarch64.sh ;; linux-ppc64le) - bash "${RECIPE_DIR}"/build_scripts/native-"${builder}"-linux-ppc64le.sh + bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-linux-ppc64le.sh ;; osx-arm64) bash "${RECIPE_DIR}"/build_scripts/cross-"${builder}"-osx-arm64.sh diff --git a/recipe/build_scripts/_build_qemu_execve.sh b/recipe/build_scripts/_build_qemu_execve.sh index 2e4a8881f..50f0dee56 100644 --- a/recipe/build_scripts/_build_qemu_execve.sh +++ b/recipe/build_scripts/_build_qemu_execve.sh @@ -36,7 +36,7 @@ function build_qemu_execve() { # export CC PATH PKG_CONFIG CFLAGS LDFLAGS PKG_CONFIG_PATH - ../qemu/configure --prefix="${BUILD_PREFIX}" \ + "${SRC_DIR}"/_qemu_execve/qemu/configure --prefix="${BUILD_PREFIX}" \ --interp-prefix="${BUILD_PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot" \ --enable-linux-user \ --target-list="${arch}-linux-user" \ diff --git a/recipe/build_scripts/cross-cmake-linux-ppc64le.sh b/recipe/build_scripts/cross-cmake-linux-ppc64le.sh index 2e7a4ce1a..9ad0544ef 100644 --- a/recipe/build_scripts/cross-cmake-linux-ppc64le.sh +++ b/recipe/build_scripts/cross-cmake-linux-ppc64le.sh @@ -16,7 +16,7 @@ cp -r "${RECIPE_DIR}"/patches/xxxx* "${SRC_DIR}"/_conda-build-level-patches # Current conda zig may not be able to build the latest zig SYSROOT_ARCH="powerpc64le" -ZIG_ARCH="powerpc64le" +ZIG_ARCH="powerpc64" QEMU_ARCH="ppc64le" SYSROOT_PATH="${BUILD_PREFIX}/${SYSROOT_ARCH}-conda-linux-gnu/sysroot" TARGET_INTERPRETER="${SYSROOT_PATH}/lib64/ld-2.28.so" @@ -24,6 +24,15 @@ TARGET_INTERPRETER="${SYSROOT_PATH}/lib64/ld-2.28.so" export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" +source "${RECIPE_DIR}/build_scripts/_build_qemu_execve.sh" +build_qemu_execve "${QEMU_ARCH}" + +export CC=$(which clang) +export CXX=$(which clang++) + +export CFLAGS="-target ${SYSROOT_ARCH}-linux-gnu -fno-plt" +export CXXFLAGS="-target ${SYSROOT_ARCH}-linux-gnu -fno-plt --stdlib=libstdc++" + EXTRA_CMAKE_ARGS+=( \ "-DCMAKE_BUILD_TYPE=Release" \ "-DCMAKE_PREFIX_PATH=${PREFIX};${SYSROOT_PATH}" \ @@ -33,13 +42,11 @@ EXTRA_CMAKE_ARGS+=( \ "-DZIG_USE_LLVM_CONFIG=ON" \ "-DZIG_TARGET_TRIPLE=${ZIG_ARCH}-linux-gnu" \ "-DZIG_TARGET_MCPU=baseline" \ + "-DZIG_SYSTEM_LIBCXX=stdc++" \ ) # This path is too long for Target.zig # "-DZIG_TARGET_DYNAMIC_LINKER=${TARGET_INTERPRETER}" \ -source "${RECIPE_DIR}/build_scripts/_build_qemu_execve.sh" -build_qemu_execve "${QEMU_ARCH}" - # export CROSSCOMPILING_EMULATOR="${BUILD_PREFIX}/bin/qemu-${SYSROOT_ARCH}" export CROSSCOMPILING_EMULATOR="${QEMU_EXECVE}" @@ -56,18 +63,18 @@ export CXXFLAGS="${CXXFLAGS} -Wl,-rpath-link,${SYSROOT_PATH}/lib64 -Wl,-dynamic- export ZIG_CROSS_TARGET_TRIPLE="${ZIG_ARCH}"-linux-gnu export ZIG_CROSS_TARGET_MCPU="ppc64le" -USE_CMAKE_ARGS=1 - -CFLAGS=${CFLAGS//-fPIC/} -CXXFLAGS=${CXXFLAGS//-fPIC/} -CFLAGS=${CFLAGS//-fpie/} -CXXFLAGS=${CXXFLAGS//-fpie/} -CFLAGS=${CFLAGS//-fno-plt/} -CXXFLAGS=${CXXFLAGS//-fno-plt/} -export CFLAGS="${CFLAGS}" -export CXXFLAGS="${CXXFLAGS} -fno-optimize-sibling-calls -fno-threadsafe-statics" -echo "CFLAGS=${CFLAGS}" -echo "CXXFLAGS=${CXXFLAGS}" +USE_CMAKE_ARGS=0 + +# CFLAGS=${CFLAGS//-fPIC/} +# CXXFLAGS=${CXXFLAGS//-fPIC/} +# CFLAGS=${CFLAGS//-fpie/} +# CXXFLAGS=${CXXFLAGS//-fpie/} +# CFLAGS=${CFLAGS//-fno-plt/} +# CXXFLAGS=${CXXFLAGS//-fno-plt/} +# export CFLAGS="${CFLAGS}" +# export CXXFLAGS="${CXXFLAGS} -fno-optimize-sibling-calls -fno-threadsafe-statics" +# echo "CFLAGS=${CFLAGS}" +# echo "CXXFLAGS=${CXXFLAGS}" configure_cmake_zigcpp "${cmake_build_dir}" "${PREFIX}" cat <> "${cmake_build_dir}/config.zig" pub const mem_leak_frames = 0; diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 9f167e65d..bf0ee671b 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,12 +1,5 @@ c_stdlib_version: # [unix] - 2.28 # [linux] - 11.3 # [osx and x86_64] -build_c_stdlib: - - sysroot # [linux] docker_image: - - quay.io/condaforge/linux-anvil-alma-x86_64:8 # [linux and x86_64] - -c_compiler: - - clang # [linux and ppc64le] -cxx_compiler: - - clangxx # [linux and ppc64le] + - quay.io/condaforge/linux-anvil-alma-x86_64:8 # [linux and (x86_64 or ppc64le)] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 32460ead4..b43720252 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -51,6 +51,9 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ stdlib('c') }} + - clang # [linux and ppc64le] + - clangxx # [linux and ppc64le] + - llvm-tools # [linux and ppc64le] # - {{ c_stdlib }}_{{ build_platform }} >={{ c_stdlib_version }} # [linux and aarch64] - cmake >=3.5 - ninja @@ -67,10 +70,9 @@ requirements: # - zlib # [linux and build_platform != target_platform] - zig # [build_platform != target_platform] host: - - {{ compiler('cxx') }} # [linux and build_platform != target_platform] - clangdev {{ llvm_version }} - libclang-cpp {{ llvm_version }} - - libcxx {{ cxx_compiler_version }} # [osx] + - libcxx # [osx] - llvmdev {{ llvm_version }} - llvm {{ llvm_version }} - lld {{ llvm_version }}