summaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
authorYDBot <[email protected]>2026-06-10 01:29:49 +0000
committerYDBot <[email protected]>2026-06-10 01:29:49 +0000
commit72cfbf8958fa6fa5227e9ad6466abfc635fdeb15 (patch)
treef405a8aeb10d66ea0e808100fe3e9c2c39fb4642 /contrib/python
parent11bc58b659090b2b3818871e180d55c64d92ae3f (diff)
parent18a6ad22dc11bda0d327d20a57de330605bf11c4 (diff)
Sync branches 260610-0127
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/cryptography/next/rust/.yandex_meta/build.ym35
-rw-r--r--contrib/python/cryptography/next/rust/ya.make2
2 files changed, 37 insertions, 0 deletions
diff --git a/contrib/python/cryptography/next/rust/.yandex_meta/build.ym b/contrib/python/cryptography/next/rust/.yandex_meta/build.ym
index 2ac90cbee85..f0f24087b30 100644
--- a/contrib/python/cryptography/next/rust/.yandex_meta/build.ym
+++ b/contrib/python/cryptography/next/rust/.yandex_meta/build.ym
@@ -12,6 +12,7 @@ devtools/yamaker/libym2/scripts/python3
{% block platforms %}
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
+x86_64-apple-darwin
{% endblock %}
{% block msan_platforms %}
@@ -36,6 +37,7 @@ sed -e 's|cdylib|staticlib|' -i Cargo.toml
export CC_{{p.replace('-', '_')}}=target-cc
{% endfor %}
export CC_x86_64_unknown_linux_musl=musl-gcc
+export CC_x86_64_apple_darwin=mac-target-cc
export DEP_OPENSSL_INCLUDE={{arcadia_root}}/contrib/libs/openssl/include
export PYO3_CROSS_PYTHON_VERSION=3.12
@@ -98,6 +100,7 @@ cp ${SRC}/autogen_cffi/_openssl.c ${OUTPUT}/
cp ${OUTPUT}/patches/msan.cpp ${OUTPUT}/
cat {{arcadia_root}}/contrib/libs/openssl/redef.h | awk '/#define/{print $2" "$3}' > ${OUTPUT}/openssl_redefines.txt
+cat {{arcadia_root}}/contrib/libs/openssl/redef.h | awk '/#define/{print "_"$2" _"$3}' >> ${OUTPUT}/openssl_redefines.txt
find ${OUTPUT} -name '*.a' | xargs -L1 llvm-objcopy --redefine-syms=${OUTPUT}/openssl_redefines.txt
rm ${OUTPUT}/openssl_redefines.txt
@@ -141,6 +144,11 @@ rm -rf ${OUTPUT}/a/{{p}}-msan/release/build
{{super()}}
export CLANG=$(ya tool c++ --print-path)
+MACOS_SDK="${TMPDIR}/macos_sdk"
+ya download --untar sbr:8156037824 "${MACOS_SDK}"
+
+# linux
+
cat << EOF > ${BIN}/musl-gcc
#!/usr/bin/env sh
exec ${CLANG} -DUSE_PYTHON3 -I{{arcadia_root}} -I{{arcadia_root}}/contrib/libs/python/Include -I{{arcadia_root}}/contrib/libs/openssl/include -x c "\${@}"
@@ -157,4 +165,31 @@ exec ${CLANG} -DUSE_PYTHON3 -fsanitize=memory -I{{arcadia_root}} -I{{arcadia_roo
EOF
chmod +x ${BIN}/musl-gcc ${BIN}/target-cc ${BIN}/target-cc-msan
+
+# macOS
+
+cat << EOF > ${BIN}/mac-target-cc
+#!/bin/bash
+FILTERED_ARGS=()
+SKIP_NEXT=0
+for arg in "\$@"; do
+ if [ \$SKIP_NEXT -eq 1 ]; then
+ SKIP_NEXT=0
+ continue
+ fi
+ case "\$arg" in
+ -arch)
+ SKIP_NEXT=1
+ ;;
+ -m64|-m32)
+ ;;
+ *)
+ FILTERED_ARGS+=("\$arg")
+ ;;
+ esac
+done
+exec ${CLANG} -target x86_64-apple-darwin -isysroot ${MACOS_SDK} -DUSE_PYTHON3 -I{{arcadia_root}} -I{{arcadia_root}}/contrib/libs/python/Include -I{{arcadia_root}}/contrib/libs/openssl/include -x c "\${FILTERED_ARGS[@]}"
+EOF
+chmod +x ${BIN}/mac-target-cc
+
{% endblock %}
diff --git a/contrib/python/cryptography/next/rust/ya.make b/contrib/python/cryptography/next/rust/ya.make
index aaa6d83ede2..2f33da3692a 100644
--- a/contrib/python/cryptography/next/rust/ya.make
+++ b/contrib/python/cryptography/next/rust/ya.make
@@ -26,6 +26,8 @@ ELSEIF (OS_LINUX AND ARCH_X86_64 AND NOT MUSL)
COPY_FILE(a/x86_64-unknown-linux-gnu/release/libcryptography_rust.a libcryptography_rust.a)
ELSEIF (OS_LINUX AND ARCH_X86_64 AND MUSL)
COPY_FILE(a/x86_64-unknown-linux-musl/release/libcryptography_rust.a libcryptography_rust.a)
+ELSEIF (OS_DARWIN AND ARCH_X86_64)
+ COPY_FILE(a/x86_64-apple-darwin/release/libcryptography_rust.a libcryptography_rust.a)
ELSE()
MESSAGE(FATAL_ERROR "We don't have cryptography_rust for this platform")
ENDIF()