diff --git a/science/py-tensorflow/Makefile b/science/py-tensorflow/Makefile index d465c21b1967..28fbe0623d0b 100644 --- a/science/py-tensorflow/Makefile +++ b/science/py-tensorflow/Makefile @@ -1,276 +1,306 @@ PORTNAME= tensorflow DISTVERSIONPREFIX= v DISTVERSION= 2.21.0 PORTREVISION= 2 CATEGORIES= science python # machine-learning PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DIST_SUBDIR= ${PORTNAME} EXTRACT_ONLY= ${DISTNAME}.tar.gz MAINTAINER= yuri@FreeBSD.org COMMENT= Computation using data flow graphs for scalable machine learning WWW= https://www.tensorflow.org LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= amd64 BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}grpcio-tools>=1.22.0:devel/py-grpcio-tools@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}numpy1>=1.22.0:math/py-numpy1@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \ bash:shells/bash \ bazel:devel/bazel7 \ cython:lang/cython \ git:devel/git \ patchelf:sysutils/patchelf \ pybind11>=2.6.2:devel/pybind11 \ swig:devel/swig \ xxd:sysutils/xxd -LIB_DEPENDS= libgpr.so:devel/grpc \ - libpng.so:graphics/png \ +LIB_DEPENDS= libpng.so:graphics/png \ libsnappy.so:archivers/snappy \ libabsl_base.so:devel/abseil \ libsqlite3.so:databases/sqlite3 \ libicuio.so:devel/icu \ libjsoncpp.so:devel/jsoncpp \ libprotobuf.so:devel/protobuf \ libgif.so:graphics/giflib \ libcurl.so:ftp/curl \ libre2.so:devel/re2 \ libhwloc.so:devel/hwloc2 RUN_DEPENDS= pybind11>=2.6.2:devel/pybind11 \ ${PYTHON_PKGNAMEPREFIX}absl-py>=2.0.0:devel/py-absl-py@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}astunparse>=1.6.0:devel/py-astunparse@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}flatbuffers>=25.9.23:devel/py-flatbuffers@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}gast>=0.2.1:devel/py-gast@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}google-pasta>=0.1.1:devel/py-google-pasta@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}h5py>=2.9.0:science/py-h5py@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}numpy1>=1.22.0:math/py-numpy1@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}packaging>=21.3:devel/py-packaging@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}requests>=2.21.0:www/py-requests@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}protobuf>=3.20.3:devel/py-protobuf@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>=1.12.0:devel/py-six@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}termcolor>=1.1.0:devel/py-termcolor@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}typing-extensions>=3.6.6:devel/py-typing-extensions@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}wrapt>=1.11.0:devel/py-wrapt@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}grpcio>=1.24.3:devel/py-grpcio@${PY_FLAVOR} + ${PYTHON_PKGNAMEPREFIX}grpcio>=1.24.3:devel/py-grpcio@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}ml-dtypes>=0.3.1:math/py-ml-dtypes@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}opt-einsum>=3.3.0:math/py-opt-einsum@${PY_FLAVOR} USES= java jpeg perl5 python shebangfix ssl JAVA_VERSION= 21 JAVA_VENDOR= openjdk USE_CXXSTD= c++17 USE_GITHUB= yes USE_PERL5= build USE_PYTHON= distutils SHEBANG_GLOB= *.py BINARY_ALIAS= python3=${PYTHON_CMD} OPTIONS_DEFINE= CPU_OPTS XLA OPTIONS_RADIO= PARALLEL_JOBS OPTIONS_RADIO_PARALLEL_JOBS= JOBS_1 JOBS_HALF JOBS_ALL PARALLEL_JOBS_DESC= How many jobs to run during build? -OPTIONS_DEFAULT= JOBS_HALF +OPTIONS_DEFAULT= JOBS_ALL JOBS_1_DESC= Run one job JOBS_1_VARS= TF_JOBS_NUMBER=1 JOBS_HALF_DESC= Run half jobs JOBS_HALF_VARS= TF_JOBS_NUMBER="`expr \( ${MAKE_JOBS_NUMBER} + 1 \) / 2`" JOBS_ALL_DESC= Run all jobs JOBS_ALL_VARS= TF_JOBS_NUMBER=${MAKE_JOBS_NUMBER} CPU_OPTS_DESC= Enable optimisations using features available on your CPU CPU_OPTS_VARS= CPU_TARGET=native BAZEL_COPT="-c opt --copt=-march=native --copt=-mfpmath=sse" CPU_OPTS_VARS_OFF= CPU_TARGET=x86-64 XLA_DESC= Accelerated Linear Algebra XLA_VARS= XLA_OPT="1" XLA_VARS_OFF= XLA_OPT="0" .include "Makefile.MASTER_SITES" BAZEL_BOOT= --output_user_root=${WRKDIR}/bazel_out .if !defined(WITH_DEBUG) # For the reason why the linker is used for the strip, see PR 280234. BAZEL_LINKOPT= --linkopt=-Wl,--strip-all .endif post-patch: # Set up a local repository with our pre-downloaded packages # This prevents bazel downloading the files without modifying # the bzl files. @${MKDIR} ${WRKDIR}/bazel-dist .for file in ${DISTFILES:C/\:(.*)//} @${ECHO} "Moving ${file} to ${WRKDIR}/bazel-dist" @${CP} ${DISTDIR}/${DIST_SUBDIR}/${file} ${WRKDIR}/bazel-dist .endfor # Pre-populate repository cache for files fetched via ctx.download() # (these are not served by --distdir; must be in --repository_cache) @${MKDIR} ${WRKDIR}/bazel-cache/content_addressable/sha256/12cffc7274190ca1693a52ccd8303e719407e707c8557ddfb7eef81f208efaab @${CP} ${DISTDIR}/${DIST_SUBDIR}/libtinfo.so.5 \ ${WRKDIR}/bazel-cache/content_addressable/sha256/12cffc7274190ca1693a52ccd8303e719407e707c8557ddfb7eef81f208efaab/file @${MKDIR} ${WRKDIR}/bazel-cache/content_addressable/sha256/5e8ee902c8906ddb7779fd36dc9979cb08b51fbebf7c0b1a9aeb78af382af590 @${CP} ${DISTDIR}/${DIST_SUBDIR}/copyright.txt \ ${WRKDIR}/bazel-cache/content_addressable/sha256/5e8ee902c8906ddb7779fd36dc9979cb08b51fbebf7c0b1a9aeb78af382af590/file @${CP} ${PATCHDIR}/bazelrc ${WRKDIR}/bazelrc @${CP} -R ${PATCHDIR}/bazel/* \ ${WRKSRC}/third_party/ @${CP} ${PATCHDIR}/bazel/rules_python_freebsd.patch \ ${WRKSRC}/third_party/xla/third_party/py/ @${CP} ${PATCHDIR}/bazel/fix-environ.patch \ ${WRKSRC}/third_party/xla/third_party/ @${CP} ${PATCHDIR}/llvm_freebsd.patch \ ${WRKSRC}/third_party/xla/third_party/llvm/freebsd.patch @${CP} ${PATCHDIR}/grpc.bazel.BUILD \ ${WRKSRC}/third_party/systemlibs/grpc.bazel.BUILD @${CP} ${PATCHDIR}/grpc.bazel.python_rules.bzl \ ${WRKSRC}/third_party/systemlibs/grpc.bazel.python_rules.bzl @${CP} ${PATCHDIR}/grpc.bazel.cc_grpc_library.bzl \ ${WRKSRC}/third_party/systemlibs/grpc.bazel.cc_grpc_library.bzl @${REINPLACE_CMD} "s#%%BAZEL_DIR%%#${WRKDIR}#" ${WRKDIR}/bazelrc @${REINPLACE_CMD} "s#%%BAZEL_DIST%%#${WRKDIR}#" ${WRKDIR}/bazelrc + @${REINPLACE_CMD} "s#%%WRKSRC%%#${WRKSRC}#" ${WRKDIR}/bazelrc @${REINPLACE_CMD} "s#%%JAVA_HOME%%#${JAVA_HOME}#" ${WRKDIR}/bazelrc # copy the toolchain over @${CP} -R ${PATCHDIR}/freebsd \ ${WRKSRC}/ @${REINPLACE_CMD} "s#%%PATH%%#${PATH}#" ${WRKDIR}/bazelrc @${REINPLACE_CMD} -e "s#%%LOCALBASE%%#${LOCALBASE}#" \ ${WRKDIR}/bazelrc \ ${WRKSRC}/freebsd/cc_toolchain_config.bzl \ ${WRKSRC}/.bazelrc \ ${WRKSRC}/WORKSPACE @${REINPLACE_CMD} -e "s#%%NUMPY_INCLUDEDIR%%#${PYTHON_SITELIBDIR}/numpy/core/include#g" \ ${WRKDIR}/bazelrc \ ${WRKSRC}/freebsd/cc_toolchain_config.bzl @${REINPLACE_CMD} -e "s#%%PYTHON_VER%%#${PYTHON_VER}#g" \ ${WRKSRC}/WORKSPACE # Fix Python runtime headers: replace rules_python CC toolchain alias with - # a direct cc_library pointing to the system Python headers. + # a direct cc_library using a symlink to the system Python headers. @${REINPLACE_CMD} \ "s|%%PYTHON_INCLUDEDIR%%|${PYTHON_INCLUDEDIR}|g" \ - ${WRKDIR}/bazelrc \ - ${WRKSRC}/third_party/xla/third_party/python_runtime/BUILD.bazel + ${WRKDIR}/bazelrc + @${CP} ${PATCHDIR}/pthreadpool-freebsd-alloca.patch \ + ${WRKSRC}/third_party/xla/third_party/pthreadpool/freebsd_alloca.patch + @${CP} ${PATCHDIR}/xnnpack-freebsd-mmap.patch \ + ${WRKSRC}/third_party/xla/third_party/xnnpack/freebsd_mmap.patch + @${CP} ${PATCHDIR}/protobuf-freebsd-upb.patch \ + ${WRKSRC}/third_party/xla/third_party/protobuf/freebsd_upb.patch + @${CP} ${PATCHDIR}/cpuinfo-freebsd-alwayslink.patch \ + ${WRKSRC}/third_party/cpuinfo/cpuinfo_freebsd_alwayslink.patch + @${CP} ${PATCHDIR}/grpc-no-go-sdk.patch \ + ${WRKSRC}/third_party/xla/third_party/grpc/grpc_no_go.patch + + @${LN} -sf ${PYTHON_INCLUDEDIR} \ + ${WRKSRC}/third_party/xla/third_party/python_runtime/python_include # Create pypi hub stub (FreeBSD has no platform wheels in requirements_lock) @${MKDIR} ${WRKSRC}/bazel_pypi_hub @${PRINTF} 'package(default_visibility = ["//visibility:public"])\nexports_files(["requirements.bzl"])\n' \ > ${WRKSRC}/bazel_pypi_hub/BUILD.bazel @${PRINTF} 'def install_deps(**kwargs):\n pass\n' \ > ${WRKSRC}/bazel_pypi_hub/requirements.bzl @${TOUCH} ${WRKSRC}/bazel_pypi_hub/WORKSPACE -.for _pypi_pkg in absl_py astor astunparse dill flatbuffers gast h5py jax \ +.for _pypi_pkg in absl_py astor astunparse auditwheel dill flatbuffers gast h5py jax \ keras lit ml_dtypes opt_einsum packaging portpicker protobuf requests \ scipy setuptools tblib termcolor typing_extensions wheel wrapt zstandard @${MKDIR} ${WRKSRC}/bazel_pypi_hub/${_pypi_pkg} @${PRINTF} 'package(default_visibility = ["//visibility:public"])\npy_library(name = "pkg", srcs = [])\npy_library(name = "lib", srcs = [])\npy_library(name = "whl", srcs = [])\nalias(name = "${_pypi_pkg}", actual = ":pkg")\n' \ > ${WRKSRC}/bazel_pypi_hub/${_pypi_pkg}/BUILD.bazel + @${TOUCH} ${WRKSRC}/bazel_pypi_hub/${_pypi_pkg}/WORKSPACE .endfor # numpy needs extra cc_library for numpy_headers used by C++ deps @${MKDIR} ${WRKSRC}/bazel_pypi_hub/numpy @${MKDIR} ${WRKSRC}/bazel_pypi_hub/numpy/include @${LN} -sf ${PYTHON_SITELIBDIR}/numpy/core/include/numpy \ ${WRKSRC}/bazel_pypi_hub/numpy/include/numpy # build_pip_package.py expects site-packages/numpy/{_core,core}/include @${MKDIR} ${WRKSRC}/bazel_pypi_hub/numpy/site-packages/numpy/core @${LN} -sf ${PYTHON_SITELIBDIR}/numpy/core/include \ ${WRKSRC}/bazel_pypi_hub/numpy/site-packages/numpy/core/include @${PRINTF} 'package(default_visibility = ["//visibility:public"])\npy_library(name = "pkg", srcs = [])\npy_library(name = "lib", srcs = [])\nalias(name = "numpy", actual = ":pkg")\ncc_library(\n name = "numpy_headers",\n hdrs = glob(["include/**/*.h"]),\n includes = ["include"],\n)\n' \ > ${WRKSRC}/bazel_pypi_hub/numpy/BUILD.bazel + @${TOUCH} ${WRKSRC}/bazel_pypi_hub/numpy/WORKSPACE do-configure: @cd ${WRKSRC} && ${SETENV} \ PYTHON_BIN_PATH=${PYTHON_CMD} \ PYTHON_LIB_PATH="${PYTHON_SITELIBDIR}" \ KERAS_HOME="${WRKDIR}/.keras" \ TF_NEED_OPENCL_SYCL=0 \ TF_ENABLE_XLA=${XLA_OPT} \ TF_NEED_OPENCL=0 \ TF_NEED_MPI=0 \ TF_NEED_TENSORRT=0 \ TF_NEED_NGRAPH=0 \ TF_NEED_IGNITE=0 \ TF_NEED_ROCM=0 \ TF_NEED_CUDA=0 \ TF_SET_ANDROID_WORKSPACE=0 \ TF_DOWNLOAD_CLANG=0 \ TF_NEED_NCCL=0 \ TF_IGNORE_MAX_BAZEL_VERSION=1 \ CC_OPT_FLAGS="-march=${CPU_TARGET} -I${LOCALBASE}/include" \ PREFIX="${LOCALBASE}" \ - TF_SYSTEM_LIBS="astor_archive astunparse_archive boringssl com_github_googlecloudplatform_google_cloud_cpp com_github_grpc_grpc \ + TF_SYSTEM_LIBS="astor_archive astunparse_archive boringssl com_github_googlecloudplatform_google_cloud_cpp \ com_googlesource_code_re2 curl cython dill_archive functools32_archive gast_archive \ gif hwloc icu jsoncpp_git libjpeg_turbo nasm org_sqlite pasta png pybind11 six_archive snappy \ tblib_archive termcolor_archive typing_extensions_archive wrapt zlib" \ ./configure @${REINPLACE_CMD} 's/,com_google_absl//g;s/,absl_py//g;s/absl_py,//g' ${WRKSRC}/.tf_configure.bazelrc post-configure: # BINARY_ALIAS creates a relative symlink for python3 that breaks inside # the poudriere jail (relative path resolves under /wrkdirs/usr/local/… # instead of /usr/local/…). Replace it with an absolute symlink. @${RM} ${WRKDIR}/.bin/python3 @${LN} -s ${PYTHON_CMD} ${WRKDIR}/.bin/python3 do-build: # Fetch rules_java to ensure it is extracted from the Bazel install, then inject # compatibility stubs for rules_java 7.x + protobuf 6.31.1 (which needs 8.x APIs). # Both @rules_java (WORKSPACE) and @@rules_java (Bzlmod canonical = rules_java_builtin) # must have the stubs; protobuf 6.31.1 uses the Bzlmod canonical form. @cd ${WRKSRC} && \ bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} fetch @rules_java//:BUILD @BAZEL_OB=$$(cd ${WRKSRC} && bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} info output_base 2>/dev/null); \ for RJNAME in rules_java rules_java_builtin; do \ RJDIR="$${BAZEL_OB}/external/$${RJNAME}"; \ if [ -d "$${RJDIR}/java/private" ]; then \ ${CP} ${FILESDIR}/rules_java.java.private.proto_support.bzl \ $${RJDIR}/java/private/proto_support.bzl; \ ${CP} ${FILESDIR}/rules_java.java.common.proguard_spec_info.bzl \ $${RJDIR}/java/common/proguard_spec_info.bzl 2>/dev/null || true; \ else \ ${ECHO_MSG} "WARNING: rules_java external dir $${RJNAME} not found; build may fail"; \ fi; \ done # Fetch llvm-project and fix config.bzl: replace Linux-only CPU-based FreeBSD # condition with platform-based @platforms//os:freebsd so exec/tool builds also # use posix_defines (no HAVE_GETAUXVAL / HAVE_MALLINFO) and the correct triple. @cd ${WRKSRC} && \ bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} fetch @@llvm-project//llvm:Support @LLVM_OB=$$(cd ${WRKSRC} && bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} info output_base 2>/dev/null); \ LLVMCONF="$${LLVM_OB}/external/llvm-raw/utils/bazel/llvm-project-overlay/llvm/config.bzl"; \ if [ -f "$${LLVMCONF}" ]; then \ ${PYTHON_CMD} ${PATCHDIR}/fix-llvm-config.py "$${LLVMCONF}"; \ else \ ${ECHO_MSG} "WARNING: llvm config.bzl not found at $${LLVMCONF}; build may fail"; \ fi @cd ${WRKSRC} && \ bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} build --jobs ${TF_JOBS_NUMBER} ${BAZEL_COPT} --host_copt="-I${LOCALBASE}/include" \ --host_linkopt="-L${LOCALBASE}/lib -lexecinfo" ${BAZEL_LINKOPT} --copt="-I${LOCALBASE}/include" \ --verbose_failures -s \ --distdir=${WRKDIR}/bazel-dist \ //tensorflow/tools/pip_package:wheel @${MKDIR} ${WRKDIR}/whl @${CP} ${WRKSRC}/bazel-bin/tensorflow/tools/pip_package/wheel_house/*.whl \ ${WRKDIR}/whl/ do-install: @${MKDIR} ${STAGEDIR}/${PYTHON_SITELIBDIR} @${UNZIP_NATIVE_CMD} -d ${STAGEDIR}/${PYTHON_SITELIBDIR} ${WRKDIR}/whl/${PORTNAME}-${PORTVERSION}-*.whl post-install: # autoplist: thousands of files, all under ${PYTHON_SITELIBDIR} @cd ${STAGEDIR}${PREFIX} && \ ${FIND} ${PYTHON_SITELIBDIR:C|^${LOCALBASE}/||} -type f -or -type l | ${GREP} -v "egg-info/" >> ${TMPPLIST} +do-test: + @cd ${WRKSRC} && \ + bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} test \ + --jobs ${TF_JOBS_NUMBER} ${BAZEL_COPT} --host_copt="-I${LOCALBASE}/include" \ + --host_linkopt="-L${LOCALBASE}/lib -lexecinfo" ${BAZEL_LINKOPT} --copt="-I${LOCALBASE}/include" \ + --verbose_failures \ + --distdir=${WRKDIR}/bazel-dist \ + --test_output=errors \ + //tensorflow/python/... + +do-test-quick: build + @cd ${TEST_WRKSRC} && \ + ${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${FILESDIR}/example-quick-training.py + .include diff --git a/science/py-tensorflow/Makefile.MASTER_SITES b/science/py-tensorflow/Makefile.MASTER_SITES index 0334204a5130..d9093e42d786 100644 --- a/science/py-tensorflow/Makefile.MASTER_SITES +++ b/science/py-tensorflow/Makefile.MASTER_SITES @@ -1,147 +1,184 @@ DISTFILES+=platforms-0.0.11.tar.gz:platforms \ apple_support.1.24.5.tar.gz:apple \ bazel-skylib-1.7.1.tar.gz:skylib \ 8c717f8258cd5f6c7a45b97d974292755852b658.tar.gz:toolchain \ v0.1.1.zip:buildrules \ rules_apple.3.5.1.tar.gz:applerules \ rules_swift.1.18.0.tar.gz:swift \ 308b05b2419edb5c8ee0471b67a40403df940149.tar.gz:closure \ 4.3.zip:jvm \ rules_pkg-0.7.1.tar.gz:pkg \ 0.7.1.tar.gz:foreign_cc \ rules_java-7.6.1.tar.gz:rules_java \ rules_license-0.0.7.tar.gz:rlic \ bazel_features-v1.25.0.tar.gz:bfeatures \ rules_shell-v0.4.1.tar.gz:rshell \ d8cb9c2c168cd64000eaa6eda0781a9615a26ffe.tar.gz:mlchain \ f7547e29ccaed7b64ef4f7495ecfff1c9f6f3d03.tar.gz:benchmark \ 0d859a811870d10f53a594927d0d0b97573ad06d.tar.gz:farmhash \ 16e8662c34917be0065110bfcd9cc27d30f52fdf.zip:gemmlowp \ c13d28517a4db259d738ea4886b1f00352a3cc33.tar.gz:highwayhash \ 03da4fc0857c285e3a26782f6bc8931c4c950df4.tar.gz:re2 \ 3286a34cc8de6149ac6844107dfdffac91531e72.zip:ruy \ 835a7d7b1ee3bc83e575e302a985c66ec4b65249.tar.gz:sobol \ openmp-10.0.1.src.tar.xz:llvmorg \ 131.1.0.tar.gz:kiss \ v3.7.3.tar.gz:onednn \ 127d2f238010589ac96f2f402a27afc9dccbb7ab.zip:openxla \ v1.0.tar.gz:ooura \ 13d4f99d5309df3d5afa80fe2ae332d7a2a64c6b.tar.gz:pybindabseil \ v2.13.6.tar.gz:pybindbazel \ f02a2b7653bc50eb5119d125842a3870db95d251.zip:pybindprotobuf \ 8a9210069b5a37dd89ed118a783945502a30a4ae.zip:cpuinfo \ 4ecc3a44a32c832b748328bed3f9a599f795ca8d.tar.gz:runtime \ eigen-dcbaf2d608f306450f1e74949eb87e9a22a7ef4b.tar.gz:eigen \ 25b42dfddb0ee22170d73ff0d4b333ea1e6edfeb.zip:xnnpack \ 0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e.zip:pthread \ 4dfe081cf6bcd15db339cf2680b9281b8451eeb3.zip:fp16 \ 63058eff77e11aa15bf531df5dd34395ec3017c8.zip:fxdiv \ 909041e4802c4b9a2223ca04099f35bf1dbbd460.tar.gz:llvm \ 6b3fdcea8bc5398be4e7e9930c693f0ea09316a0.tar.gz:apis \ v25.9.23.tar.gz:flatbuffer \ a15b489e1222b2087007546b4912e21293ea86ff.tar.gz:neon \ v2.11.0.tar.gz:nanobind \ v1.1.tar.gz:dlpack \ d38452e1ee03523a208362186fd42248ff2609f6.tar.gz:absl \ 11bf7c25e666dd7ddacbcd4d4c4a9de7a25175f8.tar.gz:protolib \ 63205aa90afa6803d8f58bc3081b69288e9f1906.zip:kleidiai \ v3.10.5.tar.gz:nlohmann \ 9effcbcb27f0a665f9f345030188c0b291e32482.tar.gz:upb \ a37c3dbdd5d2a15113d363c7a7c41c30453e482f.zip:riegeli \ v1.5.7.zip:net_zstd \ rules_go-v0.34.0.zip:rules_go \ rules_python-1.6.0.tar.gz:rules_python \ 0.1.0.tar.gz:rules_cc \ v6.31.1.zip:protobuf6 \ v2.1.0.tar.gz:absl_py \ ducc-aa46a4c21e440b3d416c16eca3c96df19c74f316.tar.gz:ducc \ ml_dtypes-00d98cd92ade342fef589c0470379abb27baebe9.tar.gz:ml_dtypes \ v1.2.0.tar.gz:brotli_new \ v0.11.1.tar.gz:libjxl \ c695e43eba127a74a67263775ab611bded7fba34.zip:xprof \ 1.3.0.tar.gz:highway \ 2025_09_16.tar.gz:skcms \ v1.4.0.tar.gz:libwebp \ 2afe84b39f0d097ecd70fc44a9e0e39782cee6a3.zip:slinky \ v1.3.0.tar.gz:robin_map \ 3ea912eb05a4ce1bf598834eb67dbd74e426b882.zip:shardy \ nvshmem_src_3.1.7-1.txz:nvshmem \ clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz:clang18 \ x86_64_ubuntu18_gcc8.4-0.2.1.tar.xz:gcc_sysroot \ cpython-3.11.13+20250808-x86_64-unknown-linux-gnu-install_only.tar.gz:cpython311 \ libtinfo.so.5:libtinfo \ -copyright.txt:libtinfo_cp +copyright.txt:libtinfo_cp \ +v1.74.0.tar.gz:grpc_src \ +28e9d1f26771c6517c3b4be10254887673c940189.zip:googletest_src \ +4de3c74cf21a9958c1cf26d8993c55c6e0d28b49.tar.gz:envoy_api_src \ +v1.2.1.zip:protoc_gen_validate_src \ +bazel-gazelle-v0.37.0.tar.gz:bazel_gazelle_src \ +rules_java-8.7.0.tar.gz:rules_java_870 \ +7.0.2.tar.gz:rules_proto_702 \ +v2.35.0.tar.gz:google_cloud_cpp_src \ +d198303a4319092ab31895c4b98d64174ebe8872.tar.gz:bazel_compdb_src \ +6360e96b5cf8e5980c887ce58ef727e53d77243a.tar.gz:c_ares_src \ +3a472e524827f72d1ad621c4983dd5af54c46776.tar.gz:cncf_xds_src \ +12235e24652fc7f809373e7c11a5f73c5763fc4c.tar.gz:benchmark \ +1f95f8083066f5b38fd2db172e7e7f9aa7c49d2d.tar.gz:libprotobuf_mutator_src \ +5501a1a255805e0be83a41348bb5f2630d5ed6b3.tar.gz:opencensus_cpp_src \ +ced79860f8c8a091a2eabfee6d47783f828a9b59.tar.gz:opentelemetry_cpp_src \ +v0.3.0.tar.gz:opencensus_proto_src \ +rules_cc-0.0.17.tar.gz:rules_cc_017 \ +rules_shell-v0.3.0.tar.gz:rules_shell_030 \ +0.8.0.tar.gz:yaml_cpp_src MASTER_SITES+=https://github.com/bazelbuild/platforms/releases/download/0.0.11/:platforms \ https://github.com/bazelbuild/apple_support/releases/download/1.24.5/:apple \ https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/:skylib \ https://github.com/bazelbuild/bazel-toolchains/archive/:toolchain \ https://github.com/bazelbuild/rules_android/archive/:buildrules \ https://github.com/bazelbuild/rules_apple/releases/download/3.5.1/:applerules \ https://github.com/bazelbuild/rules_swift/releases/download/1.18.0/:swift \ https://github.com/bazelbuild/rules_closure/archive/:closure \ https://github.com/bazelbuild/rules_jvm_external/archive/:jvm \ https://github.com/bazelbuild/rules_pkg/releases/download/0.7.1/:pkg \ https://github.com/bazel-contrib/rules_foreign_cc/archive/:foreign_cc \ https://github.com/bazelbuild/rules_java/releases/download/7.6.1/:rules_java \ https://github.com/bazelbuild/rules_license/releases/download/0.0.7/:rlic \ https://github.com/bazel-contrib/bazel_features/releases/download/v1.25.0/:bfeatures \ https://github.com/bazelbuild/rules_shell/releases/download/v0.4.1/:rshell \ https://github.com/google-ml-infra/rules_ml_toolchain/archive/:mlchain \ https://github.com/google/benchmark/archive/:benchmark \ https://github.com/google/farmhash/archive/:farmhash \ https://github.com/google/gemmlowp/archive/:gemmlowp \ https://github.com/google/highwayhash/archive/:highwayhash \ https://github.com/google/re2/archive/:re2 \ https://github.com/google/ruy/archive/:ruy \ https://github.com/joe-kuo/sobol_data/archive/:sobol \ https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/:llvmorg \ https://github.com/mborgerding/kissfft/archive/refs/tags/:kiss \ https://github.com/oneapi-src/oneDNN/archive/refs/tags/:onednn \ https://github.com/openxla/stablehlo/archive/:openxla \ https://github.com/petewarden/OouraFFT/archive/:ooura \ https://github.com/pybind/pybind11_abseil/archive/:pybindabseil \ https://github.com/pybind/pybind11_bazel/archive/:pybindbazel \ https://github.com/pybind/pybind11_protobuf/archive/:pybindprotobuf \ https://github.com/pytorch/cpuinfo/archive/:cpuinfo \ https://github.com/tensorflow/runtime/archive/:runtime \ https://gitlab.com/libeigen/eigen/-/archive/dcbaf2d608f306450f1e74949eb87e9a22a7ef4b/:eigen \ https://github.com/google/XNNPACK/archive/:xnnpack \ https://github.com/Maratyszcza/pthreadpool/archive/:pthread \ https://github.com/Maratyszcza/FP16/archive/:fp16 \ https://github.com/Maratyszcza/FXdiv/archive/:fxdiv \ https://github.com/llvm/llvm-project/archive/:llvm \ https://github.com/googleapis/googleapis/archive/:apis \ https://github.com/google/flatbuffers/archive/refs/tags/:flatbuffer \ https://github.com/intel/ARM_NEON_2_x86_SSE/archive/:neon \ https://github.com/wjakob/nanobind/archive/refs/tags/:nanobind \ https://github.com/dmlc/dlpack/archive/refs/tags/:dlpack \ https://github.com/abseil/abseil-cpp/archive/:absl \ https://github.com/bazelbuild/rules_proto/archive/:protolib \ https://github.com/ARM-software/kleidiai/archive/:kleidiai \ https://github.com/nlohmann/json/archive/:nlohmann \ https://github.com/protocolbuffers/upb/archive/:upb \ https://github.com/google/riegeli/archive/:riegeli \ https://github.com/facebook/zstd/archive/:net_zstd \ https://github.com/bazelbuild/rules_go/releases/download/v0.34.0/:rules_go \ https://github.com/bazelbuild/rules_python/releases/download/1.6.0/:rules_python \ https://github.com/bazelbuild/rules_cc/archive/refs/tags/:rules_cc \ https://github.com/protocolbuffers/protobuf/archive/refs/tags/:protobuf6 \ https://github.com/abseil/abseil-py/archive/refs/tags/:absl_py \ https://gitlab.mpcdf.mpg.de/mtr/ducc/-/archive/aa46a4c21e440b3d416c16eca3c96df19c74f316/:ducc \ https://github.com/jax-ml/ml_dtypes/archive/00d98cd92ade342fef589c0470379abb27baebe9/:ml_dtypes \ https://github.com/google/brotli/archive/refs/tags/:brotli_new \ https://github.com/libjxl/libjxl/archive/refs/tags/:libjxl \ https://storage.googleapis.com/mirror.tensorflow.org/github.com/openxla/xprof/archive/:xprof \ https://github.com/google/highway/archive/refs/tags/:highway \ https://github.com/google/skcms/archive/refs/tags/:skcms \ https://github.com/webmproject/libwebp/archive/:libwebp \ https://github.com/dsharlet/slinky/archive/:slinky \ https://github.com/Tessil/robin-map/archive/refs/tags/:robin_map \ https://github.com/openxla/shardy/archive/:shardy \ https://developer.download.nvidia.com/compute/redist/nvshmem/3.1.7/source/:nvshmem \ https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/:clang18 \ https://storage.googleapis.com/ml-sysroot-testing/x86_64/:gcc_sysroot \ https://github.com/astral-sh/python-build-standalone/releases/download/20250808/:cpython311 \ https://storage.googleapis.com/ml-sysroot-testing/libtinfo/:libtinfo \ -https://storage.googleapis.com/ml-sysroot-testing/libtinfo/:libtinfo_cp +https://storage.googleapis.com/ml-sysroot-testing/libtinfo/:libtinfo_cp \ +https://github.com/grpc/grpc/archive/refs/tags/:grpc_src \ +https://github.com/google/googletest/archive/:googletest_src \ +https://github.com/envoyproxy/data-plane-api/archive/:envoy_api_src \ +https://github.com/bufbuild/protoc-gen-validate/archive/refs/tags/:protoc_gen_validate_src \ +https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/:bazel_gazelle_src \ +https://github.com/bazelbuild/rules_java/releases/download/8.7.0/:rules_java_870 \ +https://github.com/bazelbuild/rules_proto/archive/refs/tags/:rules_proto_702 \ +https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/:google_cloud_cpp_src \ +https://github.com/grailbio/bazel-compilation-database/archive/:bazel_compdb_src \ +https://github.com/c-ares/c-ares/archive/:c_ares_src \ +https://github.com/cncf/xds/archive/:cncf_xds_src \ +https://github.com/google/libprotobuf-mutator/archive/:libprotobuf_mutator_src \ +https://github.com/census-instrumentation/opencensus-cpp/archive/:opencensus_cpp_src \ +https://github.com/open-telemetry/opentelemetry-cpp/archive/:opentelemetry_cpp_src \ +https://github.com/census-instrumentation/opencensus-proto/archive/refs/tags/:opencensus_proto_src \ +https://github.com/bazelbuild/rules_cc/releases/download/0.0.17/:rules_cc_017 \ +https://github.com/bazelbuild/rules_shell/releases/download/v0.3.0/:rules_shell_030 \ +https://github.com/jbeder/yaml-cpp/archive/refs/tags/:yaml_cpp_src diff --git a/science/py-tensorflow/distinfo b/science/py-tensorflow/distinfo index 604e0177f7fa..7c068e226d83 100644 --- a/science/py-tensorflow/distinfo +++ b/science/py-tensorflow/distinfo @@ -1,149 +1,188 @@ TIMESTAMP = 1774238095 SHA256 (tensorflow/platforms-0.0.11.tar.gz) = 29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f SIZE (tensorflow/platforms-0.0.11.tar.gz) = 7882 SHA256 (tensorflow/apple_support.1.24.5.tar.gz) = 1ae6fcf983cff3edab717636f91ad0efff2e5ba75607fdddddfd6ad0dbdfaf10 SIZE (tensorflow/apple_support.1.24.5.tar.gz) = 110555 SHA256 (tensorflow/bazel-skylib-1.7.1.tar.gz) = bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f SIZE (tensorflow/bazel-skylib-1.7.1.tar.gz) = 43566 SHA256 (tensorflow/8c717f8258cd5f6c7a45b97d974292755852b658.tar.gz) = 294cdd859e57fcaf101d4301978c408c88683fbc46fbc1a3829da92afbea55fb SIZE (tensorflow/8c717f8258cd5f6c7a45b97d974292755852b658.tar.gz) = 80728 SHA256 (tensorflow/v0.1.1.zip) = cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806 SIZE (tensorflow/v0.1.1.zip) = 14654 SHA256 (tensorflow/rules_apple.3.5.1.tar.gz) = b4df908ec14868369021182ab191dbd1f40830c9b300650d5dc389e0b9266c8d SIZE (tensorflow/rules_apple.3.5.1.tar.gz) = 2404029 SHA256 (tensorflow/rules_swift.1.18.0.tar.gz) = bb01097c7c7a1407f8ad49a1a0b1960655cf823c26ad2782d0b7d15b323838e2 SIZE (tensorflow/rules_swift.1.18.0.tar.gz) = 255839 SHA256 (tensorflow/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz) = 5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9 SIZE (tensorflow/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz) = 464906 SHA256 (tensorflow/4.3.zip) = 6274687f6fc5783b589f56a2f1ed60de3ce1f99bc4e8f9edef3de43bdf7c6e74 SIZE (tensorflow/4.3.zip) = 3998031 SHA256 (tensorflow/rules_pkg-0.7.1.tar.gz) = 451e08a4d78988c06fa3f9306ec813b836b1d076d0f055595444ba4ff22b867f SIZE (tensorflow/rules_pkg-0.7.1.tar.gz) = 77334 SHA256 (tensorflow/0.7.1.tar.gz) = bcd0c5f46a49b85b384906daae41d277b3dc0ff27c7c752cc51e43048a58ec83 SIZE (tensorflow/0.7.1.tar.gz) = 215296 SHA256 (tensorflow/rules_java-7.6.1.tar.gz) = f8ae9ed3887df02f40de9f4f7ac3873e6dd7a471f9cddf63952538b94b59aeb3 SIZE (tensorflow/rules_java-7.6.1.tar.gz) = 27308 SHA256 (tensorflow/rules_license-0.0.7.tar.gz) = 4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360 SIZE (tensorflow/rules_license-0.0.7.tar.gz) = 31476 SHA256 (tensorflow/bazel_features-v1.25.0.tar.gz) = 4fd9922d464686820ffd8fcefa28ccffa147f7cdc6b6ac0d8b07fde565c65d66 SIZE (tensorflow/bazel_features-v1.25.0.tar.gz) = 16266 SHA256 (tensorflow/rules_shell-v0.4.1.tar.gz) = bc61ef94facc78e20a645726f64756e5e285a045037c7a61f65af2941f4c25e1 SIZE (tensorflow/rules_shell-v0.4.1.tar.gz) = 22017 SHA256 (tensorflow/d8cb9c2c168cd64000eaa6eda0781a9615a26ffe.tar.gz) = 54c1a357f71f611efdb4891ebd4bcbe4aeb6dfa7e473f14fd7ecad5062096616 SIZE (tensorflow/d8cb9c2c168cd64000eaa6eda0781a9615a26ffe.tar.gz) = 159079 SHA256 (tensorflow/f7547e29ccaed7b64ef4f7495ecfff1c9f6f3d03.tar.gz) = 552ca3d4d1af4beeb1907980f7096315aa24150d6baf5ac1e5ad90f04846c670 SIZE (tensorflow/f7547e29ccaed7b64ef4f7495ecfff1c9f6f3d03.tar.gz) = 204856 SHA256 (tensorflow/0d859a811870d10f53a594927d0d0b97573ad06d.tar.gz) = 18392cf0736e1d62ecbb8d695c31496b6507859e8c75541d7ad0ba092dc52115 SIZE (tensorflow/0d859a811870d10f53a594927d0d0b97573ad06d.tar.gz) = 467251 SHA256 (tensorflow/16e8662c34917be0065110bfcd9cc27d30f52fdf.zip) = 7dc418717c8456473fac4ff2288b71057e3dcb72894524c734a4362cdb51fa8b SIZE (tensorflow/16e8662c34917be0065110bfcd9cc27d30f52fdf.zip) = 940836 SHA256 (tensorflow/c13d28517a4db259d738ea4886b1f00352a3cc33.tar.gz) = c0e2b9931fbcce3bfbcd7999c3c114f404ac0f8b89775a5bbccbcaa501868e58 SIZE (tensorflow/c13d28517a4db259d738ea4886b1f00352a3cc33.tar.gz) = 160745 SHA256 (tensorflow/03da4fc0857c285e3a26782f6bc8931c4c950df4.tar.gz) = ef516fb84824a597c4d5d0d6d330daedb18363b5a99eda87d027e6bdd9cba299 SIZE (tensorflow/03da4fc0857c285e3a26782f6bc8931c4c950df4.tar.gz) = 396457 SHA256 (tensorflow/3286a34cc8de6149ac6844107dfdffac91531e72.zip) = a22c42e80c7bb450db8492728e4742ee66f46d5458c45fe67ce2c9b61240630c SIZE (tensorflow/3286a34cc8de6149ac6844107dfdffac91531e72.zip) = 381045 SHA256 (tensorflow/835a7d7b1ee3bc83e575e302a985c66ec4b65249.tar.gz) = 583d7b975e506c076fc579d9139530596906b9195b203d42361417e9aad79b73 SIZE (tensorflow/835a7d7b1ee3bc83e575e302a985c66ec4b65249.tar.gz) = 2569603 SHA256 (tensorflow/openmp-10.0.1.src.tar.xz) = d19f728c8e04fb1e94566c8d76aef50ec926cd2f95ef3bf1e0a5de4909b28b44 SIZE (tensorflow/openmp-10.0.1.src.tar.xz) = 955492 SHA256 (tensorflow/131.1.0.tar.gz) = 76c1aac87ddb7258f34b08a13f0eebf9e53afa299857568346aa5c82bcafaf1a SIZE (tensorflow/131.1.0.tar.gz) = 52383 SHA256 (tensorflow/v3.7.3.tar.gz) = 071f289dc961b43a3b7c8cbe8a305290a7c5d308ec4b2f586397749abdc88296 SIZE (tensorflow/v3.7.3.tar.gz) = 14101401 SHA256 (tensorflow/127d2f238010589ac96f2f402a27afc9dccbb7ab.zip) = 3780e503599ebcc1acc4c96ea5f23c724dae2a4d746ed7d9a01d3f14d879265a SIZE (tensorflow/127d2f238010589ac96f2f402a27afc9dccbb7ab.zip) = 20267651 SHA256 (tensorflow/v1.0.tar.gz) = 5f4dabc2ae21e1f537425d58a49cdca1c49ea11db0d6271e2a4b27e9697548eb SIZE (tensorflow/v1.0.tar.gz) = 110531 SHA256 (tensorflow/13d4f99d5309df3d5afa80fe2ae332d7a2a64c6b.tar.gz) = c6d0c6784e4d5681919731f1fa86e0b7cd010e770115bdb3a0285b3939ef2394 SIZE (tensorflow/13d4f99d5309df3d5afa80fe2ae332d7a2a64c6b.tar.gz) = 33138 SHA256 (tensorflow/v2.13.6.tar.gz) = cae680670bfa6e82703c03f2a3c995408cdcbf43616d7bdd198ef45d3c327731 SIZE (tensorflow/v2.13.6.tar.gz) = 6156 SHA256 (tensorflow/f02a2b7653bc50eb5119d125842a3870db95d251.zip) = 3cf7bf0f23954c5ce6c37f0a215f506efa3035ca06e3b390d67f4cbe684dce23 SIZE (tensorflow/f02a2b7653bc50eb5119d125842a3870db95d251.zip) = 104204 SHA256 (tensorflow/8a9210069b5a37dd89ed118a783945502a30a4ae.zip) = c0254ce97f7abc778dd2df0aaca1e0506dba1cd514fdb9fe88c07849393f8ef4 SIZE (tensorflow/8a9210069b5a37dd89ed118a783945502a30a4ae.zip) = 3852053 SHA256 (tensorflow/4ecc3a44a32c832b748328bed3f9a599f795ca8d.tar.gz) = 5e81d70f9534340f7ef8e63ec43bdd5971135e48183079be50ecb3f74b1fed66 SIZE (tensorflow/4ecc3a44a32c832b748328bed3f9a599f795ca8d.tar.gz) = 797332 SHA256 (tensorflow/eigen-dcbaf2d608f306450f1e74949eb87e9a22a7ef4b.tar.gz) = a71517b3815984c1a8174db1ebc58a17d4f5c23c06e377bbc4a5dfc85855a516 SIZE (tensorflow/eigen-dcbaf2d608f306450f1e74949eb87e9a22a7ef4b.tar.gz) = 2984046 SHA256 (tensorflow/25b42dfddb0ee22170d73ff0d4b333ea1e6edfeb.zip) = 44bf8a258cfd0d7b500b6058a2bb5c7387c8cebba295cfca985a68d16513f7c8 SIZE (tensorflow/25b42dfddb0ee22170d73ff0d4b333ea1e6edfeb.zip) = 23536211 SHA256 (tensorflow/0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e.zip) = f602ab141bdc5d5872a79d6551e9063b5bfa7ad6ad60cceaa641de5c45c86d70 SIZE (tensorflow/0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e.zip) = 125519 SHA256 (tensorflow/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.zip) = d973501a40c55126b31accc2d9f08d931ec3cc190c0430309a5e341d3c0ce32a SIZE (tensorflow/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.zip) = 91462 SHA256 (tensorflow/63058eff77e11aa15bf531df5dd34395ec3017c8.zip) = 3d7b0e9c4c658a84376a1086126be02f9b7f753caa95e009d9ac38d11da444db SIZE (tensorflow/63058eff77e11aa15bf531df5dd34395ec3017c8.zip) = 16646 SHA256 (tensorflow/909041e4802c4b9a2223ca04099f35bf1dbbd460.tar.gz) = 3f986184ee126677dbd77edb16d6b82c057ec869fefd7a9871979941e52e837a SIZE (tensorflow/909041e4802c4b9a2223ca04099f35bf1dbbd460.tar.gz) = 259501486 SHA256 (tensorflow/6b3fdcea8bc5398be4e7e9930c693f0ea09316a0.tar.gz) = 249d83abc5d50bf372c35c49d77f900bff022b2c21eb73aa8da1458b6ac401fc SIZE (tensorflow/6b3fdcea8bc5398be4e7e9930c693f0ea09316a0.tar.gz) = 6091152 SHA256 (tensorflow/v25.9.23.tar.gz) = 9102253214dea6ae10c2ac966ea1ed2155d22202390b532d1dea64935c518ada SIZE (tensorflow/v25.9.23.tar.gz) = 2336210 SHA256 (tensorflow/a15b489e1222b2087007546b4912e21293ea86ff.tar.gz) = 019fbc7ec25860070a1d90e12686fc160cfb33e22aa063c80f52b363f1361e9d SIZE (tensorflow/a15b489e1222b2087007546b4912e21293ea86ff.tar.gz) = 103972 SHA256 (tensorflow/v2.11.0.tar.gz) = 62ba05e5f720c76c510d6ab2a77f8ccc17a76c5cea951bea47355a7dfa460449 SIZE (tensorflow/v2.11.0.tar.gz) = 938321 SHA256 (tensorflow/v1.1.tar.gz) = 2e3b94b55825c240cc58e6721e15b449978cbae21a2a4caa23058b0157ee2fb3 SIZE (tensorflow/v1.1.tar.gz) = 198915 SHA256 (tensorflow/d38452e1ee03523a208362186fd42248ff2609f6.tar.gz) = d1abe9da2003e6cbbd7619b0ced3e52047422f4f4ac6c66a9bef5d2e99fea837 SIZE (tensorflow/d38452e1ee03523a208362186fd42248ff2609f6.tar.gz) = 2236099 SHA256 (tensorflow/11bf7c25e666dd7ddacbcd4d4c4a9de7a25175f8.tar.gz) = 20b240eba17a36be4b0b22635aca63053913d5c1ee36e16be36499d167a2f533 SIZE (tensorflow/11bf7c25e666dd7ddacbcd4d4c4a9de7a25175f8.tar.gz) = 14304 SHA256 (tensorflow/63205aa90afa6803d8f58bc3081b69288e9f1906.zip) = 5e922c9afb7a0c881fc4359b58488f3faa840e8435de1a2207a6525935ed83c2 SIZE (tensorflow/63205aa90afa6803d8f58bc3081b69288e9f1906.zip) = 2859671 SHA256 (tensorflow/v3.10.5.tar.gz) = 5daca6ca216495edf89d167f808d1d03c4a4d929cef7da5e10f135ae1540c7e4 SIZE (tensorflow/v3.10.5.tar.gz) = 7021996 SHA256 (tensorflow/9effcbcb27f0a665f9f345030188c0b291e32482.tar.gz) = 61d0417abd60e65ed589c9deee7c124fe76a4106831f6ad39464e1525cef1454 SIZE (tensorflow/9effcbcb27f0a665f9f345030188c0b291e32482.tar.gz) = 324650 SHA256 (tensorflow/a37c3dbdd5d2a15113d363c7a7c41c30453e482f.zip) = 590ec559107fc7082e1a7d70e9c9bfb8624c79dabca0a05fe1bcba1d7a591ec8 SIZE (tensorflow/a37c3dbdd5d2a15113d363c7a7c41c30453e482f.zip) = 1247370 SHA256 (tensorflow/v1.5.7.zip) = 7897bc5d620580d9b7cd3539c44b59d78f3657d33663fe97a145e07b4ebd69a4 SIZE (tensorflow/v1.5.7.zip) = 2753402 SHA256 (tensorflow/rules_go-v0.34.0.zip) = 16e9fca53ed6bd4ff4ad76facc9b7b651a89db1689a2877d6fd7b82aa824e366 SIZE (tensorflow/rules_go-v0.34.0.zip) = 1210403 SHA256 (tensorflow/rules_python-1.6.0.tar.gz) = fa7dd2c6b7d63b3585028dd8a90a6cf9db83c33b250959c2ee7b583a6c130e12 SIZE (tensorflow/rules_python-1.6.0.tar.gz) = 927982 SHA256 (tensorflow/0.1.0.tar.gz) = 4b12149a041ddfb8306a8fd0e904e39d673552ce82e4296e96fac9cbf0780e59 SIZE (tensorflow/0.1.0.tar.gz) = 168117 SHA256 (tensorflow/v6.31.1.zip) = 6e09bbc950ba60c3a7b30280210cd285af8d7d8ed5e0a6ed101c72aff22e8d88 SIZE (tensorflow/v6.31.1.zip) = 11437914 SHA256 (tensorflow/tensorflow-tensorflow-v2.21.0_GH0.tar.gz) = ef3568bb4865d6c1b2564fb5689c19b6b9a5311572cd1f2ff9198636a8520921 SIZE (tensorflow/tensorflow-tensorflow-v2.21.0_GH0.tar.gz) = 90831199 SHA256 (tensorflow/v2.1.0.tar.gz) = 8a3d0830e4eb4f66c4fa907c06edf6ce1c719ced811a12e26d9d3162f8471758 SIZE (tensorflow/v2.1.0.tar.gz) = 235261 SHA256 (tensorflow/ducc-aa46a4c21e440b3d416c16eca3c96df19c74f316.tar.gz) = 077cf4bd0bd7eddaa6649a024285fff96e2662c5e6f2fb6ed5c5771f9de093f3 SIZE (tensorflow/ducc-aa46a4c21e440b3d416c16eca3c96df19c74f316.tar.gz) = 423799 SHA256 (tensorflow/ml_dtypes-00d98cd92ade342fef589c0470379abb27baebe9.tar.gz) = f6e5880666661351e6cd084ac4178ddc4dabcde7e9a73722981c0d1500cf5937 SIZE (tensorflow/ml_dtypes-00d98cd92ade342fef589c0470379abb27baebe9.tar.gz) = 87114 SHA256 (tensorflow/v1.2.0.tar.gz) = 816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec SIZE (tensorflow/v1.2.0.tar.gz) = 646315 SHA256 (tensorflow/v0.11.1.tar.gz) = 1492dfef8dd6c3036446ac3b340005d92ab92f7d48ee3271b5dac1d36945d3d9 SIZE (tensorflow/v0.11.1.tar.gz) = 1876134 SHA256 (tensorflow/c695e43eba127a74a67263775ab611bded7fba34.zip) = d27bcd502a0843e463fc4eb7d3532d0d720ddd6af6e39942846f1aa769352625 SIZE (tensorflow/c695e43eba127a74a67263775ab611bded7fba34.zip) = 11177761 SHA256 (tensorflow/1.3.0.tar.gz) = 07b3c1ba2c1096878a85a31a5b9b3757427af963b1141ca904db2f9f4afe0bc2 SIZE (tensorflow/1.3.0.tar.gz) = 3634890 SHA256 (tensorflow/2025_09_16.tar.gz) = 08c45dff8ede1b56a6e7d1e9fdaf113dd91ab28ddcbcf696229b683e5e9af45a SIZE (tensorflow/2025_09_16.tar.gz) = 10061309 SHA256 (tensorflow/v1.4.0.tar.gz) = 12af50c45530f0a292d39a88d952637e43fb2d4ab1883c44ae729840f7273381 SIZE (tensorflow/v1.4.0.tar.gz) = 3800514 SHA256 (tensorflow/2afe84b39f0d097ecd70fc44a9e0e39782cee6a3.zip) = 4c0b19e58706c44336c573a0ba9fdf0e412b23670cac6a3df95525a0909a0360 SIZE (tensorflow/2afe84b39f0d097ecd70fc44a9e0e39782cee6a3.zip) = 381528 SHA256 (tensorflow/v1.3.0.tar.gz) = a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236 SIZE (tensorflow/v1.3.0.tar.gz) = 70562 SHA256 (tensorflow/3ea912eb05a4ce1bf598834eb67dbd74e426b882.zip) = bfdd113080d6da700b9bc3f15458069a88818a65ebf2a476fe281f084e1b6783 SIZE (tensorflow/3ea912eb05a4ce1bf598834eb67dbd74e426b882.zip) = 3352636 SHA256 (tensorflow/nvshmem_src_3.1.7-1.txz) = 2146ff231d9aadd2b11f324c142582f89e3804775877735dc507b4dfd70c788b SIZE (tensorflow/nvshmem_src_3.1.7-1.txz) = 3686400 SHA256 (tensorflow/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz) = 54ec30358afcc9fb8aa74307db3046f5187f9fb89fb37064cdde906e062ebf36 SIZE (tensorflow/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz) = 1044930068 SHA256 (tensorflow/x86_64_ubuntu18_gcc8.4-0.2.1.tar.xz) = 9a06397f9dc4fe2237d126f964f1a3c942ce0036ba51976ea0d7fce0bc3e2fb7 SIZE (tensorflow/x86_64_ubuntu18_gcc8.4-0.2.1.tar.xz) = 47419824 SHA256 (tensorflow/cpython-3.11.13+20250808-x86_64-unknown-linux-gnu-install_only.tar.gz) = 3ad988c702cbb017fef1208d47dea4138a2e85fd0f7f01ec5e1e335e597131b9 SIZE (tensorflow/cpython-3.11.13+20250808-x86_64-unknown-linux-gnu-install_only.tar.gz) = 46107448 SHA256 (tensorflow/libtinfo.so.5) = 12cffc7274190ca1693a52ccd8303e719407e707c8557ddfb7eef81f208efaab SIZE (tensorflow/libtinfo.so.5) = 170784 SHA256 (tensorflow/copyright.txt) = 5e8ee902c8906ddb7779fd36dc9979cb08b51fbebf7c0b1a9aeb78af382af590 SIZE (tensorflow/copyright.txt) = 6366 + +SHA256 (tensorflow/v1.74.0.tar.gz) = dd6a2fa311ba8441bbefd2764c55b99136ff10f7ea42954be96006a2723d33fc +SIZE (tensorflow/v1.74.0.tar.gz) = 15014902 +SHA256 (tensorflow/28e9d1f26771c6517c3b4be10254887673c940189.zip) = f253ca1a07262f8efde8328e4b2c68979e40ddfcfc001f70d1d5f612c7de2974 +SIZE (tensorflow/28e9d1f26771c6517c3b4be10254887673c940189.zip) = 1136851 +SHA256 (tensorflow/4de3c74cf21a9958c1cf26d8993c55c6e0d28b49.tar.gz) = cd8b49614408b43bd45d90e3e98d69e24eea632ff42ac3bfb8bca68bc31e377f +SIZE (tensorflow/4de3c74cf21a9958c1cf26d8993c55c6e0d28b49.tar.gz) = 697162 +SHA256 (tensorflow/v1.2.1.zip) = ab51e978326b87e06be7a12fc6496f3ff6586339043557dbbd31f622332a5d45 +SIZE (tensorflow/v1.2.1.zip) = 306941 +SHA256 (tensorflow/bazel-gazelle-v0.37.0.tar.gz) = d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5 +SIZE (tensorflow/bazel-gazelle-v0.37.0.tar.gz) = 1815577 +SHA256 (tensorflow/rules_java-8.7.0.tar.gz) = 5449ed36d61269579dd9f4b0e532cd131840f285b389b3795ae8b4d717387dd8 +SIZE (tensorflow/rules_java-8.7.0.tar.gz) = 112619 +SHA256 (tensorflow/7.0.2.tar.gz) = 0e5c64a2599a6e26c6a03d6162242d231ecc0de219534c38cb4402171def21e8 +SIZE (tensorflow/7.0.2.tar.gz) = 48590 +SHA256 (tensorflow/v2.35.0.tar.gz) = 81ea28cf9e5bb032d356b0187409f30b1035f8ea5b530675ea248c8a6c0070aa +SIZE (tensorflow/v2.35.0.tar.gz) = 15773128 +SHA256 (tensorflow/d198303a4319092ab31895c4b98d64174ebe8872.tar.gz) = 79502264d1a3a4b6309d4dae8c822e7349bcfe33e84f3c6d1affb2a40d11a31d +SIZE (tensorflow/d198303a4319092ab31895c4b98d64174ebe8872.tar.gz) = 16045 +SHA256 (tensorflow/6360e96b5cf8e5980c887ce58ef727e53d77243a.tar.gz) = bf26e5b25e259911914a85ae847b6d723488adb5af4f8bdeb9d0871a318476e3 +SIZE (tensorflow/6360e96b5cf8e5980c887ce58ef727e53d77243a.tar.gz) = 778663 +SHA256 (tensorflow/3a472e524827f72d1ad621c4983dd5af54c46776.tar.gz) = dc305e20c9fa80822322271b50aa2ffa917bf4fd3973bcec52bfc28dc32c5927 +SIZE (tensorflow/3a472e524827f72d1ad621c4983dd5af54c46776.tar.gz) = 104469 +SHA256 (tensorflow/12235e24652fc7f809373e7c11a5f73c5763fc4c.tar.gz) = 11f344710a80fd73db0fc686b4fe40867dc34d914d9cdfd7a4b416a65d1e692f +SIZE (tensorflow/12235e24652fc7f809373e7c11a5f73c5763fc4c.tar.gz) = 254083 +SHA256 (tensorflow/1f95f8083066f5b38fd2db172e7e7f9aa7c49d2d.tar.gz) = 9c8f800aed088cdf89adc3eaaa66b56b4da7da041f26338aa71a2ab43d860d46 +SIZE (tensorflow/1f95f8083066f5b38fd2db172e7e7f9aa7c49d2d.tar.gz) = 41620 +SHA256 (tensorflow/5501a1a255805e0be83a41348bb5f2630d5ed6b3.tar.gz) = 46b3b5812c150a21bacf860c2f76fc42b89773ed77ee954c32adeb8593aa2a8e +SIZE (tensorflow/5501a1a255805e0be83a41348bb5f2630d5ed6b3.tar.gz) = 191703 +SHA256 (tensorflow/ced79860f8c8a091a2eabfee6d47783f828a9b59.tar.gz) = a85a22521de7426c3e019d50e18d0af16e0391e0353923308eb168b3e624aea1 +SIZE (tensorflow/ced79860f8c8a091a2eabfee6d47783f828a9b59.tar.gz) = 1048635 +SHA256 (tensorflow/v0.3.0.tar.gz) = b7e13f0b4259e80c3070b583c2f39e53153085a6918718b1c710caf7037572b0 +SIZE (tensorflow/v0.3.0.tar.gz) = 163404 +SHA256 (tensorflow/rules_cc-0.0.17.tar.gz) = abc605dd850f813bb37004b77db20106a19311a96b2da1c92b789da529d28fe1 +SIZE (tensorflow/rules_cc-0.0.17.tar.gz) = 178823 +SHA256 (tensorflow/rules_shell-v0.3.0.tar.gz) = d8cd4a3a91fc1dc68d4c7d6b655f09def109f7186437e3f50a9b60ab436a0c53 +SIZE (tensorflow/rules_shell-v0.3.0.tar.gz) = 22046 +SHA256 (tensorflow/0.8.0.tar.gz) = fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16 +SIZE (tensorflow/0.8.0.tar.gz) = 1017151 diff --git a/science/py-tensorflow/files/bazelrc b/science/py-tensorflow/files/bazelrc index f63c64a60da6..eead349e0876 100644 --- a/science/py-tensorflow/files/bazelrc +++ b/science/py-tensorflow/files/bazelrc @@ -1,66 +1,98 @@ startup --batch build --verbose_failures --noshow_loading_progress test --verbose_test_summary --verbose_failures --noshow_loading_progress build --spawn_strategy=local --genrule_strategy=local test --spawn_strategy=local --genrule_strategy=local # tensorflow/BUILD:install_headers genrule creates a directory output (outs=["include"]). # Bazel 7 enables --incompatible_disallow_unsound_directory_outputs by default, which # rejects this old-style pattern. Disable it to allow the legacy genrule to run. build --noincompatible_disallow_unsound_directory_outputs # make bazel only fetch distfiles from the cache fetch --repository_cache="%%BAZEL_DIR%%/bazel-cache/" --distdir="%%BAZEL_DIST%%/bazel-dist/" build --repository_cache="%%BAZEL_DIR%%/bazel-cache/" --distdir="%%BAZEL_DIST%%/bazel-dist/" +# Override @pypi hub and individual @pypi_* repos with offline stubs +# (FreeBSD has no platform wheels in requirements_lock; stubs point to system packages) +build --override_repository=pypi=%%WRKSRC%%/bazel_pypi_hub +fetch --override_repository=pypi=%%WRKSRC%%/bazel_pypi_hub +build --override_repository=pypi_absl_py=%%WRKSRC%%/bazel_pypi_hub/absl_py +build --override_repository=pypi_astunparse=%%WRKSRC%%/bazel_pypi_hub/astunparse +build --override_repository=pypi_auditwheel=%%WRKSRC%%/bazel_pypi_hub/auditwheel +build --override_repository=pypi_flatbuffers=%%WRKSRC%%/bazel_pypi_hub/flatbuffers +build --override_repository=pypi_gast=%%WRKSRC%%/bazel_pypi_hub/gast +build --override_repository=pypi_keras=%%WRKSRC%%/bazel_pypi_hub/keras +build --override_repository=pypi_lit=%%WRKSRC%%/bazel_pypi_hub/lit +build --override_repository=pypi_ml_dtypes=%%WRKSRC%%/bazel_pypi_hub/ml_dtypes +build --override_repository=pypi_numpy=%%WRKSRC%%/bazel_pypi_hub/numpy +build --override_repository=pypi_opt_einsum=%%WRKSRC%%/bazel_pypi_hub/opt_einsum +build --override_repository=pypi_packaging=%%WRKSRC%%/bazel_pypi_hub/packaging +build --override_repository=pypi_protobuf=%%WRKSRC%%/bazel_pypi_hub/protobuf +build --override_repository=pypi_requests=%%WRKSRC%%/bazel_pypi_hub/requests +build --override_repository=pypi_setuptools=%%WRKSRC%%/bazel_pypi_hub/setuptools +build --override_repository=pypi_termcolor=%%WRKSRC%%/bazel_pypi_hub/termcolor +build --override_repository=pypi_typing_extensions=%%WRKSRC%%/bazel_pypi_hub/typing_extensions +build --override_repository=pypi_wheel=%%WRKSRC%%/bazel_pypi_hub/wheel +build --override_repository=pypi_wrapt=%%WRKSRC%%/bazel_pypi_hub/wrapt + build --define=PREFIX=%%LOCALBASE%% build --define=LIBDIR=%%LOCALBASE%%/lib build --define=INCLUDEDIR=%%LOCALBASE%%/include build --define=PROTOBUF_INCLUDE_PATH=%%LOCALBASE%%/include build --config=nogcp --config=nonccl build --define tensorflow_mkldnn_contraction_kernel=0 build --action_env=BAZEL_CXXOPTS="-std=c++17" build --extra_toolchains=//freebsd:cc-toolchain-freebsd +build --extra_toolchains=//freebsd:python_cc_toolchain build --linkopt="-lexecinfo" --toolchain_resolution_debug=//freebsd:freebsd_clang # backtrace() is in libexecinfo on FreeBSD; needed for both target and exec builds. build --host_linkopt=-L%%LOCALBASE%%/lib build --host_linkopt=-lexecinfo build --host_linkopt=-lhwloc # System and Python headers for both target and host (tool) builds. # copts in cc_library don't propagate to dependents so we set these globally. +# _XOPEN_SOURCE=700 enables XSI extensions (isascii, etc.) even when per-file +# code defines _POSIX_C_SOURCE. +# __BSD_VISIBLE=1 enables BSD extensions (syscall, MAP_ANON, etc.). FreeBSD's +# _visible.h never resets __BSD_VISIBLE to 0 in the _XOPEN_SOURCE or +# _POSIX_C_SOURCE paths (only in _ANSI_SOURCE/_C99_SOURCE paths), so the +# command-line definition persists. +build --host_copt=-D_XOPEN_SOURCE=700 +build --host_copt=-D__BSD_VISIBLE=1 build --host_copt=-isystem%%LOCALBASE%%/include build --host_copt=-isystem%%PYTHON_INCLUDEDIR%% build --host_copt=-isystem%%NUMPY_INCLUDEDIR%% +build --copt=-D_XOPEN_SOURCE=700 +build --copt=-D__BSD_VISIBLE=1 build --copt=-isystem%%LOCALBASE%%/include build --copt=-isystem%%PYTHON_INCLUDEDIR%% build --copt=-isystem%%NUMPY_INCLUDEDIR%% # Bazel's local_execution_config_platform wrongly reports the exec platform as # Linux on FreeBSD, so LLVM's config.bzl selects linux_defines for [for tool] # builds, adding Linux-only macros that do not exist on FreeBSD. Undefine them # here so the compiler falls back to the portable POSIX paths in LLVM source. build --host_copt=-UHAVE_GETAUXVAL build --host_copt=-UHAVE_MALLINFO build --host_copt=-UHAVE_SBRK # for python build --action_env=PATH=%%PATH%% build --host_action_env=PATH=%%PATH%% build --action_env=KERAS_HOME="%%BAZEL_DIST%%/.keras" build --host_action_env=KERAS_HOME="%%BAZEL_DIST%%/.keras" build --repo_env=JAVA_HOME=%%JAVA_HOME%% build --action_env=JAVA_HOME=%%JAVA_HOME%% -build --config=freebsd - # Limit parallel actions to avoid OOM on large files like LLVMDialect.cpp build --local_ram_resources=HOST_RAM*.7 build --local_cpu_resources=HOST_CPUS-4 diff --git a/science/py-tensorflow/files/cpuinfo-freebsd-alwayslink.patch b/science/py-tensorflow/files/cpuinfo-freebsd-alwayslink.patch new file mode 100644 index 000000000000..7423f274a523 --- /dev/null +++ b/science/py-tensorflow/files/cpuinfo-freebsd-alwayslink.patch @@ -0,0 +1,11 @@ +diff --git a/BUILD.bazel b/BUILD.bazel +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -182,6 +182,7 @@ + ":macos_x86_64_legacy": False, + "//conditions:default": True, + }), ++ alwayslink = True, + # Headers must be in textual_hdrs to allow us to set the standard to C99 + textual_hdrs = [ + "include/cpuinfo.h", diff --git a/science/py-tensorflow/files/example-quick-training.py b/science/py-tensorflow/files/example-quick-training.py new file mode 100644 index 000000000000..3d69ae98cf9d --- /dev/null +++ b/science/py-tensorflow/files/example-quick-training.py @@ -0,0 +1,25 @@ +import tensorflow as tf + +# 1. Load and prepare the MNIST dataset +mnist = tf.keras.datasets.mnist +(x_train, y_train), (x_test, y_test) = mnist.load_data() +x_train, x_test = x_train / 255.0, x_test / 255.0 # Normalize pixel values + +# 2. Build the Sequential model +model = tf.keras.models.Sequential([ + tf.keras.layers.Flatten(input_shape=(28, 28)), # Flatten 2D image to 1D array + tf.keras.layers.Dense(128, activation='relu'), # Hidden layer with ReLU activation + tf.keras.layers.Dropout(0.2), # Regularization to prevent overfitting + tf.keras.layers.Dense(10) # Output layer for 10 classes +]) + +# 3. Compile the model +model.compile(optimizer='adam', + loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), + metrics=['accuracy']) + +# 4. Train the model +model.fit(x_train, y_train, epochs=5) + +# 5. Evaluate accuracy +model.evaluate(x_test, y_test, verbose=2) diff --git a/science/py-tensorflow/files/fix-llvm-config.py b/science/py-tensorflow/files/fix-llvm-config.py index 6b3757662c9d..d8e336d9b5b3 100644 --- a/science/py-tensorflow/files/fix-llvm-config.py +++ b/science/py-tensorflow/files/fix-llvm-config.py @@ -1,17 +1,21 @@ #!/usr/bin/env python3 -"""Patch LLVM config.bzl to use @platforms//os:freebsd condition.""" +"""Patch LLVM config.bzl to use @platforms//os:freebsd condition (idempotent).""" import os import sys f = sys.argv[1] r = os.path.realpath(f) c = open(r).read() +# Replace old-style condition (idempotent: only matches original) c = c.replace( '"@bazel_tools//src/conditions:freebsd": posix_defines,', '"@platforms//os:freebsd": posix_defines,') -c = c.replace( - '"//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),', - '"@platforms//os:freebsd": native_arch_defines("X86", "x86_64-unknown-freebsd14-elf"),\n' - ' "//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),') +# Add FreeBSD arch defines if not already present +freebsd_arch = ('"@platforms//os:freebsd": native_arch_defines("X86", "x86_64-unknown-freebsd14-elf"),\n' + ' "//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),') +if '"@platforms//os:freebsd": native_arch_defines' not in c: + c = c.replace( + '"//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),', + freebsd_arch) os.chmod(r, 0o644) open(r, 'w').write(c) diff --git a/science/py-tensorflow/files/freebsd/BUILD b/science/py-tensorflow/files/freebsd/BUILD index 116c8428aee9..04a5fda857fd 100644 --- a/science/py-tensorflow/files/freebsd/BUILD +++ b/science/py-tensorflow/files/freebsd/BUILD @@ -1,88 +1,109 @@ # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This becomes the BUILD file for @local_config_cc// under FreeBSD and OpenBSD. load(":cc_toolchain_config.bzl", "cc_toolchain_config") load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair") package(default_visibility = ["//visibility:public"]) cc_library( name = "malloc", ) filegroup( name = "empty", srcs = [], ) # Hardcoded toolchain, legacy behaviour. cc_toolchain_suite( name = "freebsd_clang", toolchains = { "k8": ":cc-compiler-freebsd", "freebsd": ":cc-compiler-freebsd", }, ) cc_toolchain( name = "cc-compiler-freebsd", all_files = ":empty", ar_files = ":empty", as_files = ":empty", compiler_files = ":empty", dwp_files = ":empty", linker_files = ":empty", objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 0, toolchain_config = ":local_freebsd", toolchain_identifier = "local_freebsd", ) cc_toolchain_config( name = "local_freebsd", cpu = "freebsd", ) toolchain( name = "cc-toolchain-freebsd", exec_compatible_with = [ "@platforms//cpu:x86_64", "@platforms//os:freebsd", ], target_compatible_with = [ "@platforms//cpu:x86_64", "@platforms//os:freebsd", ], toolchain = ":cc-compiler-freebsd", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", ) py_runtime( name = "freebsd_python", interpreter_path = "/usr/local/bin/python3.9", python_version = "PY3", visibility = ["//visibility:public"], ) py_runtime_pair( name = "bsd_py_runtime_pair", py2_runtime = None, py3_runtime = ":freebsd_python", ) toolchain( name = "freebsd_py_toolchain", toolchain = ":bsd_py_runtime_pair", toolchain_type = "@bazel_tools//tools/python:toolchain_type", ) +load("@rules_python//python/cc:py_cc_toolchain.bzl", "py_cc_toolchain") + +# Python C/C++ headers toolchain for FreeBSD (satisfies @rules_python//python/cc:toolchain_type) +py_cc_toolchain( + name = "python_cc_toolchain_impl", + headers = "@xla//third_party/python_runtime:headers", + python_version = "3.11", +) + +toolchain( + name = "python_cc_toolchain", + exec_compatible_with = [ + "@platforms//os:freebsd", + ], + target_compatible_with = [ + "@platforms//os:freebsd", + ], + toolchain = ":python_cc_toolchain_impl", + toolchain_type = "@rules_python//python/cc:toolchain_type", +) + diff --git a/science/py-tensorflow/files/freebsd/compat_include/alloca.h b/science/py-tensorflow/files/freebsd/compat_include/alloca.h new file mode 100644 index 000000000000..4b475cdea825 --- /dev/null +++ b/science/py-tensorflow/files/freebsd/compat_include/alloca.h @@ -0,0 +1,4 @@ +#ifndef _ALLOCA_H +#define _ALLOCA_H +#include +#endif diff --git a/science/py-tensorflow/files/grpc-no-go-sdk.patch b/science/py-tensorflow/files/grpc-no-go-sdk.patch new file mode 100644 index 000000000000..cef295cd5ed8 --- /dev/null +++ b/science/py-tensorflow/files/grpc-no-go-sdk.patch @@ -0,0 +1,34 @@ +diff --git a/bazel/grpc_extra_deps.bzl b/bazel/grpc_extra_deps.bzl +--- a/bazel/grpc_extra_deps.bzl ++++ b/bazel/grpc_extra_deps.bzl +@@ -14,16 +14,13 @@ + """Loads the dependencies necessary for the external repositories defined in grpc_deps.bzl.""" + + load("@bazel_features//:deps.bzl", "bazel_features_deps") +-load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") + load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") + load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") +-load("@com_envoyproxy_protoc_gen_validate//:dependencies.bzl", "go_third_party") + load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") + load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps") + load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + load("@envoy_api//bazel:repositories.bzl", "api_dependencies") + load("@google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps") +-load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") + load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies") + load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") + load("@rules_python//python:repositories.bzl", "py_repositories") +@@ -64,13 +61,7 @@ + + api_dependencies() + +- go_rules_dependencies() +- go_register_toolchains(version = "1.22.5") +- gazelle_dependencies() + +- # Pull-in the go 3rd party dependencies for protoc_gen_validate, which is +- # needed for building C++ xDS protos +- go_third_party() + + apple_rules_dependencies(ignore_version_differences = ignore_version_differences) + diff --git a/science/py-tensorflow/files/patch-.bazelrc b/science/py-tensorflow/files/patch-.bazelrc deleted file mode 100644 index 591a60488da1..000000000000 --- a/science/py-tensorflow/files/patch-.bazelrc +++ /dev/null @@ -1,23 +0,0 @@ ---- .bazelrc.orig2025-01-01 00:00:00 UTC -+++ .bazelrc -@@ -178,6 +178,20 @@ common:clang_local --repo_env USE_HERMETIC_CC_TOOLCHAIN=0 - # Print a stacktrace when a test is killed - test --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" - -+# Use our custom-configured c++ toolchain. -+# Use --cpu as a differentiator. -+build:freebsd --cpu=freebsd -+ -+# Use the default Bazel C++ toolchain to build the tools used during the -+# build. -+build:freebsd --crosstool_top=//freebsd:freebsd_clang -+build:freebsd --linkopt=-L%%LOCALBASE%%/lib -+ -+build:freebsd --define build_with_onednn_v2=true -+build:freebsd --define force_libcpp=enabled -+build:freebsd --action_env=CXXFLAGS=-stdlib=libc++ -+build:freebsd --noincompatible_enable_cc_toolchain_resolution -+ - - # Default options should come above this line. - diff --git a/science/py-tensorflow/files/patch-WORKSPACE b/science/py-tensorflow/files/patch-WORKSPACE deleted file mode 100644 index b3990a3ca56b..000000000000 --- a/science/py-tensorflow/files/patch-WORKSPACE +++ /dev/null @@ -1,125 +0,0 @@ ---- WORKSPACE.orig -+++ WORKSPACE -@@ -95,6 +95,122 @@ - install_deps() - # End hermetic Python initialization - -+# FreeBSD: Register the rules_python runtime_env py_cc_toolchain so that -+# @@rules_python//python/cc:current_py_cc_headers can be built. -+# This toolchain uses empty headers/libs (system Python) and satisfies -+# the PY_CC_TOOLCHAIN_TYPE requirement without hermetic Python. -+register_toolchains("@rules_python//python/runtime_env_toolchains:runtime_env_py_cc_toolchain") -+ -+# FreeBSD: Register protobuf Python toolchain needed for py_proto_library. -+register_toolchains("@com_google_protobuf//bazel/private/toolchains:python_source_toolchain") -+ -+# FreeBSD: Register runtime_env_toolchain as fallback for @rules_python//python:toolchain_type. -+# On FreeBSD the exec platform is detected as "freebsd" (not "linux"), so none of the -+# hermetic python_3_11_toolchains match. This toolchain uses a shell script to locate -+# python3 at action-runtime via PATH, which resolves to /usr/local/bin/python3.11 in -+# both local and poudriere-jail builds. It is registered after python_init_toolchains() -+# so it only applies when no platform-specific toolchain matches. -+register_toolchains("@rules_python//python/runtime_env_toolchains:runtime_env_toolchain") -+ -+# FreeBSD: stub repositories for old-style @pypi_* deps -+# (these are not created by pip_parse on FreeBSD due to missing platform wheels) -+new_local_repository( -+ name = "pypi_keras", -+ path = "bazel_pypi_hub/keras", -+ build_file_content = """package(default_visibility=["//visibility:public"]) -+py_library(name="pkg",srcs=[]) -+""", -+) -+ -+new_local_repository( -+ name = "pypi_setuptools", -+ path = "bazel_pypi_hub/setuptools", -+ build_file_content = """package(default_visibility=["//visibility:public"]) -+py_library(name="pkg",srcs=[]) -+""", -+) -+ -+new_local_repository( -+ name = "pypi_wheel", -+ path = "bazel_pypi_hub/wheel", -+ build_file_content = """package(default_visibility=["//visibility:public"]) -+py_library(name="pkg",srcs=[]) -+""", -+) -+ -+new_local_repository( -+ name = "pypi_packaging", -+ path = "bazel_pypi_hub/packaging", -+ build_file_content = """package(default_visibility=["//visibility:public"]) -+py_library(name="pkg",srcs=[]) -+""", -+) -+ -+new_local_repository( -+ name = "pypi_absl_py", -+ path = "bazel_pypi_hub/absl_py", -+ build_file_content = """package(default_visibility=["//visibility:public"]) -+py_library(name="pkg",srcs=[]) -+""", -+) -+ -+new_local_repository( -+ name = "pypi_protobuf", -+ path = "bazel_pypi_hub/protobuf", -+ build_file_content = """package(default_visibility=["//visibility:public"]) -+py_library(name="pkg",srcs=[]) -+""", -+) -+ -+new_local_repository( -+ name = "pypi_numpy", -+ path = "bazel_pypi_hub/numpy", -+ build_file_content = """package(default_visibility=["//visibility:public"]) -+py_library(name="pkg",srcs=[]) -+""", -+) -+ -+# FreeBSD: Define @system_python for protobuf's proto_api target. -+# The bundled protobuf 6.31.1 uses @system_python//:python_headers in its -+# proto_api cc_library. We provide real Python 3.11 headers here. -+new_local_repository( -+ name = "system_python", -+ path = "%%LOCALBASE%%", -+ build_file_content = -+"""package(default_visibility = ["//visibility:public"]) -+ -+load("@bazel_skylib//rules:common_settings.bzl", "string_flag") -+ -+cc_library( -+ name = "python_headers", -+ includes = ["include/python%%PYTHON_VER%%"], -+ textual_hdrs = [], -+) -+ -+string_flag( -+ name = "internal_python_support", -+ build_setting_default = "Supported", -+ values = ["None", "Supported", "Unsupported"], -+) -+ -+config_setting( -+ name = "none", -+ flag_values = {":internal_python_support": "None"}, -+) -+ -+config_setting( -+ name = "supported", -+ flag_values = {":internal_python_support": "Supported"}, -+) -+ -+config_setting( -+ name = "unsupported", -+ flag_values = {":internal_python_support": "Unsupported"}, -+) -+""", -+) -+ -+ - load("@//tensorflow:workspace2.bzl", "tf_workspace2") - - tf_workspace2() diff --git a/science/py-tensorflow/files/patch-tensorflow_python_BUILD b/science/py-tensorflow/files/patch-tensorflow_python_BUILD new file mode 100644 index 000000000000..af45020d2295 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_python_BUILD @@ -0,0 +1,48 @@ +--- tensorflow/python/BUILD.orig 2026-03-04 21:33:50 UTC ++++ tensorflow/python/BUILD +@@ -1479,6 +1479,21 @@ pybind_extension( + "//tensorflow/distribute/experimental/rpc/kernels:rpc_ops", + "//tensorflow/dtensor/cc:tensor_layout", + "@xla//xla/backends/profiler/cpu:python_tracer", ++ # Shardy dialect deps: ensure these archives are included in libtensorflow_cc.so.2 ++ # via the pywrap split-library mechanism (they would otherwise be filtered out as ++ # starlark_only, since pywrap_quantization is starlark_only=True). ++ "@shardy//shardy/common:file_utils", ++ "@shardy//shardy/common:logging", ++ "@shardy//shardy/dialect/sdy/ir:axis_list_ref", ++ "@shardy//shardy/dialect/sdy/ir:dialect", ++ "@shardy//shardy/dialect/sdy/transforms/common:op_properties", ++ "@shardy//shardy/dialect/sdy/transforms/common:sharding_walker", ++ "@shardy//shardy/dialect/sdy/transforms/import:passes", ++ "@shardy//shardy/dialect/sdy/transforms/propagation:op_sharding_rule_builder", ++ "@shardy//shardy/dialect/sdy/transforms/propagation:op_sharding_rule_registry", ++ "@shardy//shardy/dialect/sdy/transforms/propagation:sharding_projection", ++ "@shardy//shardy/dialect/sdy/transforms/propagation:utils", ++ "@shardy//shardy/dialect/sdy/transforms/propagation/debugging:source_sharding", + ], + ) + +@@ -1577,6 +1592,11 @@ pywrap_library( + "-ldl", + "-lm", + ], ++ "//tensorflow:freebsd": [ ++ "-lpthread", ++ "-ldl", ++ "-lm", ++ ], + "//conditions:default": [ + "-z defs", + "-lpthread", +@@ -1593,6 +1613,11 @@ pywrap_library( + "-DEFAULTLIB:ntdll.lib", + ], + "//tensorflow:macos": [ ++ "-lpthread", ++ "-ldl", ++ "-lm", ++ ], ++ "//tensorflow:freebsd": [ + "-lpthread", + "-ldl", + "-lm", diff --git a/science/py-tensorflow/files/patch-tensorflow_python__BUILD b/science/py-tensorflow/files/patch-tensorflow_python__BUILD deleted file mode 100644 index 00a1005c4971..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_python__BUILD +++ /dev/null @@ -1,26 +0,0 @@ ---- tensorflow/python/BUILD.orig 2025-01-01 00:00:00 UTC -+++ tensorflow/python/BUILD -@@ -1573,6 +1573,11 @@ - "tensorflow/tensorflow_framework": select({ - "//tensorflow:windows": [], - "//tensorflow:macos": [ -+ "-lpthread", -+ "-ldl", -+ "-lm", -+ ], -+ "//tensorflow:freebsd": [ - "-lpthread", - "-ldl", - "-lm", -@@ -1597,6 +1602,11 @@ - "-ldl", - "-lm", - ], -+ "//tensorflow:freebsd": [ -+ "-lpthread", -+ "-ldl", -+ "-lm", -+ ], - "//conditions:default": [ - "-z defs", - "-lpthread", diff --git a/science/py-tensorflow/files/patch-tensorflow_tf__version__script.lds b/science/py-tensorflow/files/patch-tensorflow_tf__version__script.lds new file mode 100644 index 000000000000..f4b62cd230fd --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tf__version__script.lds @@ -0,0 +1,20 @@ +--- tensorflow/tf_version_script.lds.orig 2026-04-03 18:07:06 UTC ++++ tensorflow/tf_version_script.lds +@@ -18,12 +18,11 @@ tensorflow { + *TFL*; + *TfLite*; + *quantization*; +- *mlir*detail*; +- *mlir*func*; +- *mlir*TF*; +- *mlir*shape*; +- *mlir*scf*; +- *mlir*quant*; ++ *mlir*; ++ *llvm*; ++ *LLVM*; ++ *cpuinfo*; ++ *ducc0*; + local: + *; + }; diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_BUILD b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_BUILD index f9ffad3a0162..42cf2c1a234c 100644 --- a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_BUILD +++ b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_BUILD @@ -1,17 +1,17 @@ ---- tensorflow/tools/pip_package/BUILD.orig 2026-03-22 23:01:32.877130000 -0700 -+++ tensorflow/tools/pip_package/BUILD 2026-03-22 23:01:32.877162000 -0700 -@@ -323,12 +323,14 @@ +--- tensorflow/tools/pip_package/BUILD.orig 2026-03-04 21:33:50 UTC ++++ tensorflow/tools/pip_package/BUILD +@@ -323,12 +323,14 @@ tf_wheel( "@platforms//os:macos": "macosx", "@platforms//os:windows": "win", "@platforms//os:linux": "linux", + "//conditions:default": "linux", }), platform_tag = select({ "@platforms//cpu:aarch64": "arm64", "@platforms//cpu:arm64": "arm64", "@platforms//cpu:x86_64": "x86_64", "@platforms//cpu:ppc": "ppc64le", + "//conditions:default": "x86_64", }), source_files = [ "MANIFEST.in", diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_build__pip__package.py b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_build__pip__package.py index b2253989dfec..8d6ee8eb4201 100644 --- a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_build__pip__package.py +++ b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_build__pip__package.py @@ -1,28 +1,47 @@ ---- tensorflow/tools/pip_package/build_pip_package.py.orig 2025-01-01 00:00:00 UTC +--- tensorflow/tools/pip_package/build_pip_package.py.orig 2026-04-04 07:32:44 UTC +++ tensorflow/tools/pip_package/build_pip_package.py -@@ -397,6 +397,12 @@ +@@ -33,11 +33,12 @@ import tempfile + import sys + import tempfile + +-from tensorflow.tools.pip_package.utils.utils import copy_file +-from tensorflow.tools.pip_package.utils.utils import create_init_files +-from tensorflow.tools.pip_package.utils.utils import is_macos +-from tensorflow.tools.pip_package.utils.utils import is_windows +-from tensorflow.tools.pip_package.utils.utils import replace_inplace ++sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) ++from utils.utils import copy_file ++from utils.utils import create_init_files ++from utils.utils import is_macos ++from utils.utils import is_windows ++from utils.utils import replace_inplace + + + def parse_args() -> argparse.Namespace: +@@ -397,6 +398,12 @@ def create_local_config_python(dst_dir: str) -> None: numpy_include_dir = "external/pypi_numpy/site-packages/numpy/_core/include" if not os.path.exists(numpy_include_dir): numpy_include_dir = "external/pypi_numpy/site-packages/numpy/core/include" + if not os.path.exists(numpy_include_dir): + _pylib = os.environ.get("PYTHON_LIB_PATH", "") + if _pylib: + numpy_include_dir = os.path.join(_pylib, "numpy", "_core", "include") + if not os.path.exists(numpy_include_dir): + numpy_include_dir = os.path.join(_pylib, "numpy", "core", "include") shutil.copytree( numpy_include_dir, os.path.join(dst_dir, "numpy_include"), -@@ -404,5 +410,10 @@ - if is_windows(): +@@ -405,7 +412,12 @@ def create_local_config_python(dst_dir: str) -> None: path = "external/python_*/include" else: path = "external/python_*/include/python*" - shutil.copytree(glob.glob(path)[0], os.path.join(dst_dir, "python_include")) + _python_includes = glob.glob(path) + if not _python_includes: + import sysconfig + _inc = sysconfig.get_path('include') + if _inc and os.path.exists(_inc): + _python_includes = [_inc] -+ shutil.copytree(_python_includes[0], os.path.join(dst_dir, "python_include")) + + + def build_wheel( diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_utils_BUILD b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_utils_BUILD new file mode 100644 index 000000000000..dd0346b16b3c --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_utils_BUILD @@ -0,0 +1,10 @@ +--- tensorflow/tools/pip_package/utils/BUILD.orig 2026-04-04 09:56:19 UTC ++++ tensorflow/tools/pip_package/utils/BUILD +@@ -3,6 +3,7 @@ py_library( + py_library( + name = "py_utils", + srcs = [ ++ "__init__.py", + "utils.py", + ], + ) diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_utils____init__.py b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_utils____init__.py new file mode 100644 index 000000000000..07ebab795373 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_utils____init__.py @@ -0,0 +1,4 @@ +--- tensorflow/tools/pip_package/utils/__init__.py.orig 1970-01-01 00:00:00 UTC ++++ tensorflow/tools/pip_package/utils/__init__.py +@@ -0,0 +1 @@ ++ diff --git a/science/py-tensorflow/files/patch-tensorflow_workspace0.bzl b/science/py-tensorflow/files/patch-tensorflow_workspace0.bzl deleted file mode 100644 index c9404737b914..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_workspace0.bzl +++ /dev/null @@ -1,18 +0,0 @@ ---- tensorflow/workspace0.bzl.orig -+++ tensorflow/workspace0.bzl -@@ -5,7 +5,6 @@ - load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") - load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") - load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") --load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") - load("@local_config_android//:android.bzl", "android_workspace") - load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") - load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") -@@ -100,7 +99,6 @@ - # at the end of the WORKSPACE file. - _tf_bind() - -- grpc_extra_deps() - rules_foreign_cc_dependencies() - config_googleapis() - diff --git a/science/py-tensorflow/files/patch-tensorflow_workspace1.bzl b/science/py-tensorflow/files/patch-tensorflow_workspace1.bzl deleted file mode 100644 index cae90a63d448..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_workspace1.bzl +++ /dev/null @@ -1,17 +0,0 @@ ---- tensorflow/workspace1.bzl.orig -+++ tensorflow/workspace1.bzl -@@ -1,6 +1,5 @@ - """TensorFlow workspace initialization. Consult the WORKSPACE on how to use it.""" - --load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") - load("@com_google_benchmark//:bazel/benchmark_deps.bzl", "benchmark_deps") - load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories") - load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") -@@ -33,7 +32,6 @@ def workspace(with_rules_cc = True): - - android_configure(name = "local_config_android") - -- grpc_deps() - benchmark_deps() - - # Alias so it can be loaded without assigning to a different symbol to prevent diff --git a/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl b/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl index c6b25a0370bf..a9ba0a253e9f 100644 --- a/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl +++ b/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl @@ -1,55 +1,34 @@ ---- tensorflow/workspace2.bzl.orig +--- tensorflow/workspace2.bzl.orig 2026-03-04 21:33:50 UTC +++ tensorflow/workspace2.bzl -@@ -178,6 +178,7 @@ - name = "XNNPACK", +@@ -179,6 +179,7 @@ def _tf_repositories(): sha256 = "44bf8a258cfd0d7b500b6058a2bb5c7387c8cebba295cfca985a68d16513f7c8", strip_prefix = "XNNPACK-25b42dfddb0ee22170d73ff0d4b333ea1e6edfeb", -+ patch_file = ["//third_party:fix-xnnpack.patch", "//third_party:xnnpack-posix-c-source.patch", "//third_party:xnnpack-freebsd-x86.patch"], urls = tf_mirror_urls("https://github.com/google/XNNPACK/archive/25b42dfddb0ee22170d73ff0d4b333ea1e6edfeb.zip"), ++ patch_file = ["@xla//third_party/xnnpack:freebsd_mmap.patch"], ) # LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/xnnpack.cmake) -@@ -200,7 +201,8 @@ - # LINT.IfChange(pthreadpool) - tf_http_archive( + +@@ -202,6 +203,7 @@ def _tf_repositories(): name = "pthreadpool", sha256 = "f602ab141bdc5d5872a79d6551e9063b5bfa7ad6ad60cceaa641de5c45c86d70", strip_prefix = "pthreadpool-0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e", -+ patch_file = ["//third_party:pthreadpool-alloca.patch"], ++ patch_file = ["@xla//third_party/pthreadpool:freebsd_alloca.patch"], urls = tf_mirror_urls("https://github.com/google/pthreadpool/archive/0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e.zip"), ) -@@ -407,7 +409,10 @@ - maybe( - tf_http_archive, - name = "com_google_protobuf", -- patch_file = ["@xla//third_party/protobuf:protobuf.patch"], -+ patch_file = [ -+ "@xla//third_party/protobuf:protobuf.patch", -+ "//third_party:fix-protobuf-java.patch", -+ ], - sha256 = "6e09bbc950ba60c3a7b30280210cd285af8d7d8ed5e0a6ed101c72aff22e8d88", - strip_prefix = "protobuf-6.31.1", - urls = tf_mirror_urls("https://github.com/protocolbuffers/protobuf/archive/refs/tags/v6.31.1.zip"), -@@ -471,6 +476,15 @@ - sha256 = "dd6a2fa311ba8441bbefd2764c55b99136ff10f7ea42954be96006a2723d33fc", - strip_prefix = "grpc-1.74.0", - system_build_file = "//third_party/systemlibs:grpc.BUILD", -+ system_link_files = { -+ "//third_party/systemlibs:grpc.bazel.BUILD": "bazel/BUILD.bazel", -+ "//third_party/systemlibs:grpc.bazel.cc_grpc_library.bzl": "bazel/cc_grpc_library.bzl", -+ "//third_party/systemlibs:grpc.bazel.generate_cc.bzl": "bazel/generate_cc.bzl", -+ "//third_party/systemlibs:grpc.bazel.grpc_deps.bzl": "bazel/grpc_deps.bzl", -+ "//third_party/systemlibs:grpc.bazel.grpc_extra_deps.bzl": "bazel/grpc_extra_deps.bzl", -+ "//third_party/systemlibs:grpc.bazel.protobuf.bzl": "bazel/protobuf.bzl", -+ "//third_party/systemlibs:grpc.bazel.python_rules.bzl": "bazel/python_rules.bzl", -+ }, + # LINT.ThenChange(//tensorflow/lite/cmake/DownloadPThreadPool.cmake) +@@ -210,7 +212,7 @@ def _tf_repositories(): + name = "cpuinfo", + sha256 = "c0254ce97f7abc778dd2df0aaca1e0506dba1cd514fdb9fe88c07849393f8ef4", + strip_prefix = "cpuinfo-8a9210069b5a37dd89ed118a783945502a30a4ae", +- patch_file = ["//third_party/cpuinfo:cpuinfo_ppc64le_support.patch"], ++ patch_file = ["//third_party/cpuinfo:cpuinfo_ppc64le_support.patch", "//third_party/cpuinfo:cpuinfo_freebsd_alwayslink.patch"], + urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/8a9210069b5a37dd89ed118a783945502a30a4ae.zip"), + ) + +@@ -474,6 +476,7 @@ def _tf_repositories(): patch_file = [ "@xla//third_party/grpc:grpc.patch", ++ "@xla//third_party/grpc:grpc_no_go.patch", ], -@@ -895,6 +909,7 @@ - name = "riegeli", - sha256 = "590ec559107fc7082e1a7d70e9c9bfb8624c79dabca0a05fe1bcba1d7a591ec8", - strip_prefix = "riegeli-a37c3dbdd5d2a15113d363c7a7c41c30453e482f", -+ patch_file = ["//third_party:riegeli-xopen-source.patch"], - urls = tf_mirror_urls("https://github.com/google/riegeli/archive/a37c3dbdd5d2a15113d363c7a7c41c30453e482f.zip"), + urls = tf_mirror_urls("https://github.com/grpc/grpc/archive/refs/tags/v1.74.0.tar.gz"), ) - diff --git a/science/py-tensorflow/files/patch-tensorflow_workspace3.bzl b/science/py-tensorflow/files/patch-tensorflow_workspace3.bzl deleted file mode 100644 index 45d937ec482b..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_workspace3.bzl +++ /dev/null @@ -1,19 +0,0 @@ ---- tensorflow/workspace3.bzl.orig 2026-03-22 22:50:53.707183000 -0700 -+++ tensorflow/workspace3.bzl 2026-03-22 22:50:32.286898000 -0700 -@@ -51,7 +51,16 @@ - "https://github.com/bazel-contrib/bazel_features/releases/download/v1.25.0/bazel_features-v1.25.0.tar.gz", - ), - ) -+ tf_http_archive( -+ name = "proto_bazel_features", -+ sha256 = "4fd9922d464686820ffd8fcefa28ccffa147f7cdc6b6ac0d8b07fde565c65d66", -+ strip_prefix = "bazel_features-1.25.0", -+ urls = tf_mirror_urls( -+ "https://github.com/bazel-contrib/bazel_features/releases/download/v1.25.0/bazel_features-v1.25.0.tar.gz", -+ ), -+ ) - -+ - # Maven dependencies. - RULES_JVM_EXTERNAL_TAG = "4.3" - tf_http_archive( diff --git a/science/py-tensorflow/files/patch-third__party_flatbuffers_BUILD.system b/science/py-tensorflow/files/patch-third__party_flatbuffers_BUILD.system deleted file mode 100644 index 3b435a5cac6d..000000000000 --- a/science/py-tensorflow/files/patch-third__party_flatbuffers_BUILD.system +++ /dev/null @@ -1,14 +0,0 @@ ---- third_party/flatbuffers/BUILD.system.orig 2025-01-01 00:00:00 UTC -+++ third_party/flatbuffers/BUILD.system -@@ -4,6 +4,11 @@ filegroup( - name = "LICENSE.txt", - visibility = ["//visibility:public"], - ) -+ -+filegroup( -+ name = "LICENSE", -+ visibility = ["//visibility:public"], -+) - - # Public flatc library to compile flatbuffer files at runtime. - cc_library( diff --git a/science/py-tensorflow/files/patch-third__party_py_python__init__pip.bzl b/science/py-tensorflow/files/patch-third__party_py_python__init__pip.bzl deleted file mode 100644 index fa21f1b4052d..000000000000 --- a/science/py-tensorflow/files/patch-third__party_py_python__init__pip.bzl +++ /dev/null @@ -1,55 +0,0 @@ ---- third_party/py/python_init_pip.bzl.orig -+++ third_party/py/python_init_pip.bzl -@@ -1,46 +1,9 @@ - """Hermetic Python initialization. Consult the WORKSPACE on how to use it.""" - --load("@python_version_repo//:py_version.bzl", "REQUIREMENTS_WITH_LOCAL_WHEELS") --load("@rules_python//python:pip.bzl", "package_annotation", "pip_parse") --load( -- "//third_party/py:python_init_toolchains.bzl", -- "get_toolchain_name_per_python_version", --) -- - def python_init_pip(): -- numpy_annotations = { -- "numpy": package_annotation( -- additive_build_content = """\ --cc_library( -- name = "numpy_headers_2", -- hdrs = glob(["site-packages/numpy/_core/include/**/*.h"]), -- strip_include_prefix="site-packages/numpy/_core/include/", --) --cc_library( -- name = "numpy_headers_1", -- hdrs = glob(["site-packages/numpy/core/include/**/*.h"]), -- strip_include_prefix="site-packages/numpy/core/include/", --) --cc_library( -- name = "numpy_headers", -- deps = [":numpy_headers_2", ":numpy_headers_1"], -- # For the layering check to work we need to re-export the headers from the -- # dependencies. -- hdrs = glob(["site-packages/numpy/_core/include/**/*.h"]) + -- glob(["site-packages/numpy/core/include/**/*.h"]), --) --""", -- ), -- } -- -- pip_parse( -- name = "pypi", -- annotations = numpy_annotations, -- python_interpreter_target = "@{}_host//:python".format( -- get_toolchain_name_per_python_version("python"), -- ), -- extra_hub_aliases = { -- "numpy": ["numpy_headers"], -- }, -- requirements_lock = REQUIREMENTS_WITH_LOCAL_WHEELS, -- ) -+ # FreeBSD: use a local stub repository instead of pip_parse -+ # (no platform wheels available for FreeBSD in requirements_lock) -+ native.local_repository( -+ name = "pypi", -+ path = "bazel_pypi_hub", -+ ) diff --git a/science/py-tensorflow/files/patch-third__party_systemlibs_pybind11.BUILD b/science/py-tensorflow/files/patch-third__party_systemlibs_pybind11.BUILD index a5b04f4c819b..9f320edb7ef3 100644 --- a/science/py-tensorflow/files/patch-third__party_systemlibs_pybind11.BUILD +++ b/science/py-tensorflow/files/patch-third__party_systemlibs_pybind11.BUILD @@ -1,18 +1,18 @@ ---- third_party/systemlibs/pybind11.BUILD.orig +--- third_party/systemlibs/pybind11.BUILD.orig 2026-03-04 21:33:50 UTC +++ third_party/systemlibs/pybind11.BUILD -@@ -2,7 +2,12 @@ +@@ -2,7 +2,12 @@ cc_library( cc_library( name = "pybind11", - deps = [ - "@xla@xla//third_party/python_runtime:headers", - ], - ) ++) + +config_setting( + name = "msvc_compiler", + flag_values = { + "@bazel_tools//tools/cpp:compiler": "msvc-cl", + }, + visibility = ["//visibility:public"], -+) + ) diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.base.BUILD b/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.base.BUILD deleted file mode 100644 index 5d0d0df6776f..000000000000 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.base.BUILD +++ /dev/null @@ -1,18 +0,0 @@ ---- third_party/xla/third_party/absl/system.absl.base.BUILD.orig 2023-09-12 16:46:28 UTC -+++ third_party/xla/third_party/absl/system.absl.base.BUILD -@@ -17,7 +17,14 @@ cc_library( - - cc_library( - name = "log_severity", -- linkopts = ["-labsl_log_severity"], -+ linkopts = [ -+ "-labsl_log_severity", -+ "-labsl_log_internal_check_op", -+ "-labsl_log_internal_conditions", -+ "-labsl_log_internal_message", -+ "-labsl_log_internal_nullguard", -+ "-labsl_vlog_config_internal", -+ ], - ) - - cc_library( diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.flags.BUILD b/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.flags.BUILD deleted file mode 100644 index 94a268494c52..000000000000 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.flags.BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- third_party/xla/third_party/absl/system.absl.flags.BUILD.orig 2023-09-12 16:46:28 UTC -+++ third_party/xla/third_party/absl/system.absl.flags.BUILD -@@ -97,7 +97,6 @@ cc_library( - - cc_library( - name = "flag", -- linkopts = ["-labsl_flags"], - deps = [ - ":config", - ":flag_internal", diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.strings.BUILD b/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.strings.BUILD deleted file mode 100644 index 0bdd2f0b2dc1..000000000000 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.strings.BUILD +++ /dev/null @@ -1,15 +0,0 @@ ---- third_party/xla/third_party/absl/system.absl.strings.BUILD.orig 2023-09-12 16:46:28 UTC -+++ third_party/xla/third_party/absl/system.absl.strings.BUILD -@@ -26,7 +26,11 @@ cc_library( - - cc_library( - name = "cord", -- linkopts = ["-labsl_cord"], -+ linkopts = [ -+ "-labsl_cord", -+ "-labsl_cord_internal", -+ "-labsl_cordz_info" -+ ], - deps = [ - ":str_format", - "//absl/container:compressed_tuple", diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.synchronization.BUILD b/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.synchronization.BUILD deleted file mode 100644 index cac07dbbf60c..000000000000 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_absl_system.absl.synchronization.BUILD +++ /dev/null @@ -1,31 +0,0 @@ ---- third_party/xla/third_party/absl/system.absl.synchronization.BUILD.orig 2023-09-12 16:46:28 UTC -+++ third_party/xla/third_party/absl/system.absl.synchronization.BUILD -@@ -17,13 +17,28 @@ cc_library( - ) - - cc_library( -+ name = "kernel_timeout_internal", -+ visibility = [ -+ ], -+ deps = [ -+ "//absl/base", -+ "//absl/base:config", -+ "//absl/base:core_headers", -+ "//absl/base:raw_logging_internal", -+ "//absl/time", -+ ], -+) -+ -+cc_library( - name = "synchronization", - linkopts = [ - "-labsl_synchronization", -+ "-labsl_kernel_timeout_internal", - "-pthread", - ], - deps = [ - ":graphcycles_internal", -+ ":kernel_timeout_internal", - "//absl/base", - "//absl/base:atomic_hook", - "//absl/base:dynamic_annotations", diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_llvm_workspace.bzl b/science/py-tensorflow/files/patch-third__party_xla_third__party_llvm_workspace.bzl deleted file mode 100644 index 7d193aa7385b..000000000000 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_llvm_workspace.bzl +++ /dev/null @@ -1,10 +0,0 @@ ---- third_party/xla/third_party/llvm/workspace.bzl.orig2025-01-01 00:00:00 UTC -+++ third_party/xla/third_party/llvm/workspace.bzl -@@ -24,6 +24,7 @@ def repo(name): - "//third_party/llvm:toolchains.patch", - "//third_party/llvm:zstd.patch", - "//third_party/llvm:lit_test.patch", -+ "//third_party:fix-environ.patch", - ], - link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"}, - ) diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_pthreadpool_workspace.bzl b/science/py-tensorflow/files/patch-third__party_xla_third__party_pthreadpool_workspace.bzl index 6ea141d47fcc..c3175f9f78a8 100644 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_pthreadpool_workspace.bzl +++ b/science/py-tensorflow/files/patch-third__party_xla_third__party_pthreadpool_workspace.bzl @@ -1,8 +1,10 @@ ---- third_party/xla/third_party/pthreadpool/workspace.bzl.orig2025-01-01 00:00:00 UTC +--- third_party/xla/third_party/pthreadpool/workspace.bzl.orig 2026-03-04 21:33:50 UTC +++ third_party/xla/third_party/pthreadpool/workspace.bzl -@@ -9,4 +9,5 @@ def repo(): +@@ -8,4 +8,7 @@ def repo(): sha256 = "f602ab141bdc5d5872a79d6551e9063b5bfa7ad6ad60cceaa641de5c45c86d70", strip_prefix = "pthreadpool-0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e", urls = tf_mirror_urls("https://github.com/google/pthreadpool/archive/0e6ca13779b57d397a5ba6bfdcaa8a275bc8ea2e.zip"), -+ patch_file = ["//third_party:pthreadpool-alloca.patch"], ++ patch_file = [ ++ "@xla//third_party/pthreadpool:freebsd_alloca.patch", ++ ], ) diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_py_python__init__pip.bzl b/science/py-tensorflow/files/patch-third__party_xla_third__party_py_python__init__pip.bzl deleted file mode 100644 index b8c296206280..000000000000 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_py_python__init__pip.bzl +++ /dev/null @@ -1,55 +0,0 @@ ---- third_party/xla/third_party/py/python_init_pip.bzl.orig -+++ third_party/xla/third_party/py/python_init_pip.bzl -@@ -1,46 +1,9 @@ - """Hermetic Python initialization. Consult the WORKSPACE on how to use it.""" - --load("@python_version_repo//:py_version.bzl", "REQUIREMENTS_WITH_LOCAL_WHEELS") --load("@rules_python//python:pip.bzl", "package_annotation", "pip_parse") --load( -- "//third_party/py:python_init_toolchains.bzl", -- "get_toolchain_name_per_python_version", --) -- - def python_init_pip(): -- numpy_annotations = { -- "numpy": package_annotation( -- additive_build_content = """\ --cc_library( -- name = "numpy_headers_2", -- hdrs = glob(["site-packages/numpy/_core/include/**/*.h"]), -- strip_include_prefix="site-packages/numpy/_core/include/", --) --cc_library( -- name = "numpy_headers_1", -- hdrs = glob(["site-packages/numpy/core/include/**/*.h"]), -- strip_include_prefix="site-packages/numpy/core/include/", --) --cc_library( -- name = "numpy_headers", -- deps = [":numpy_headers_2", ":numpy_headers_1"], -- # For the layering check to work we need to re-export the headers from the -- # dependencies. -- hdrs = glob(["site-packages/numpy/_core/include/**/*.h"]) + -- glob(["site-packages/numpy/core/include/**/*.h"]), --) --""", -- ), -- } -- -- pip_parse( -- name = "pypi", -- annotations = numpy_annotations, -- python_interpreter_target = "@{}_host//:python".format( -- get_toolchain_name_per_python_version("python"), -- ), -- extra_hub_aliases = { -- "numpy": ["numpy_headers"], -- }, -- requirements_lock = REQUIREMENTS_WITH_LOCAL_WHEELS, -- ) -+ # FreeBSD: use a local stub repository instead of pip_parse -+ # (no platform wheels available for FreeBSD in requirements_lock) -+ native.local_repository( -+ name = "pypi", -+ path = "bazel_pypi_hub", -+ ) diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_py_python__init__rules.bzl b/science/py-tensorflow/files/patch-third__party_xla_third__party_py_python__init__rules.bzl index 68e18cfcf8ef..757b1c041605 100644 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_py_python__init__rules.bzl +++ b/science/py-tensorflow/files/patch-third__party_xla_third__party_py_python__init__rules.bzl @@ -1,9 +1,18 @@ ---- third_party/xla/third_party/py/python_init_rules.bzl.orig +--- third_party/xla/third_party/py/python_init_rules.bzl.orig 2026-03-04 21:33:50 UTC +++ third_party/xla/third_party/py/python_init_rules.bzl -@@ -41,5 +41,6 @@ +@@ -22,7 +22,7 @@ def python_init_rules(extra_patches = []): + + tf_http_archive( + name = "com_google_protobuf", +- patch_file = ["@xla//third_party/protobuf:protobuf.patch"], ++ patch_file = ["@xla//third_party/protobuf:protobuf.patch", "@xla//third_party/protobuf:freebsd_upb.patch"], + sha256 = "6e09bbc950ba60c3a7b30280210cd285af8d7d8ed5e0a6ed101c72aff22e8d88", + strip_prefix = "protobuf-6.31.1", + urls = tf_mirror_urls("https://github.com/protocolbuffers/protobuf/archive/refs/tags/v6.31.1.zip"), +@@ -41,5 +41,6 @@ def python_init_rules(extra_patches = []): "@xla//third_party/py:rules_python_pip_version.patch", "@xla//third_party/py:rules_python_freethreaded.patch", "@xla//third_party/py:rules_python_versions.patch", + "@xla//third_party/py:rules_python_freebsd.patch", ] + extra_patches, ) diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_python__runtime_BUILD.bazel b/science/py-tensorflow/files/patch-third__party_xla_third__party_python__runtime_BUILD.bazel index 78d3f2b7b28f..7252cc5ec422 100644 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_python__runtime_BUILD.bazel +++ b/science/py-tensorflow/files/patch-third__party_xla_third__party_python__runtime_BUILD.bazel @@ -1,13 +1,13 @@ ---- third_party/xla/third_party/python_runtime/BUILD.bazel.orig +--- third_party/xla/third_party/python_runtime/BUILD.bazel.orig 2026-03-04 21:33:50 UTC +++ third_party/xla/third_party/python_runtime/BUILD.bazel -@@ -2,7 +2,8 @@ +@@ -2,7 +2,8 @@ package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"]) -alias( +# On FreeBSD, replace the rules_python CC toolchain alias with a direct +# cc_library. Python headers are added globally via --copt=-isystem in bazelrc. +cc_library( name = "headers", - actual = "@rules_python//python/cc:current_py_cc_headers", ) diff --git a/science/py-tensorflow/files/patch-third_party_xla_third__party_remote__config_remote__platform__configure.bzl b/science/py-tensorflow/files/patch-third__party_xla_third__party_remote__config_remote__platform__configure.bzl similarity index 75% rename from science/py-tensorflow/files/patch-third_party_xla_third__party_remote__config_remote__platform__configure.bzl rename to science/py-tensorflow/files/patch-third__party_xla_third__party_remote__config_remote__platform__configure.bzl index e72b7d3d2dcb..afe9d5e3ae67 100644 --- a/science/py-tensorflow/files/patch-third_party_xla_third__party_remote__config_remote__platform__configure.bzl +++ b/science/py-tensorflow/files/patch-third__party_xla_third__party_remote__config_remote__platform__configure.bzl @@ -1,11 +1,11 @@ ---- third_party/xla/third_party/remote_config/remote_platform_configure.bzl.orig +--- third_party/xla/third_party/remote_config/remote_platform_configure.bzl.orig 2026-03-04 21:33:50 UTC +++ third_party/xla/third_party/remote_config/remote_platform_configure.bzl -@@ -7,6 +7,8 @@ def _remote_platform_configure_impl(repository_ctx): - if os.startswith("windows"): +@@ -8,6 +8,8 @@ def _remote_platform_configure_impl(repository_ctx): platform = "windows" elif os.startswith("mac os"): platform = "osx" + elif os.startswith("freebsd"): + platform = "freebsd" else: platform = "linux" + diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_riegeli_workspace.bzl b/science/py-tensorflow/files/patch-third__party_xla_third__party_riegeli_workspace.bzl index 77e6a0f29b4e..1502f83739a8 100644 --- a/science/py-tensorflow/files/patch-third__party_xla_third__party_riegeli_workspace.bzl +++ b/science/py-tensorflow/files/patch-third__party_xla_third__party_riegeli_workspace.bzl @@ -1,8 +1,8 @@ ---- third_party/xla/third_party/riegeli/workspace.bzl.orig2025-01-01 00:00:00 UTC +--- third_party/xla/third_party/riegeli/workspace.bzl.orig 2026-03-04 21:33:50 UTC +++ third_party/xla/third_party/riegeli/workspace.bzl @@ -8,4 +8,5 @@ def repo(): sha256 = "f63337f63f794ba9dc7dd281b20af3d036dfe0c1a5a4b7b8dc20b39f7e323b97", strip_prefix = "riegeli-9f2744dc23e81d84c02f6f51244e9e9bb9802d57", urls = tf_mirror_urls("https://github.com/google/riegeli/archive/9f2744dc23e81d84c02f6f51244e9e9bb9802d57.tar.gz"), + patch_file = ["//third_party:riegeli-xopen-source.patch"], ) diff --git a/science/py-tensorflow/files/patch-third__party_xla_third__party_xnnpack_workspace.bzl b/science/py-tensorflow/files/patch-third__party_xla_third__party_xnnpack_workspace.bzl new file mode 100644 index 000000000000..5292c80acb2c --- /dev/null +++ b/science/py-tensorflow/files/patch-third__party_xla_third__party_xnnpack_workspace.bzl @@ -0,0 +1,13 @@ +--- third_party/xla/third_party/xnnpack/workspace.bzl.orig 2026-03-04 21:33:50 UTC ++++ third_party/xla/third_party/xnnpack/workspace.bzl +@@ -9,6 +9,9 @@ def repo(): + sha256 = "44bf8a258cfd0d7b500b6058a2bb5c7387c8cebba295cfca985a68d16513f7c8", + strip_prefix = "XNNPACK-25b42dfddb0ee22170d73ff0d4b333ea1e6edfeb", + urls = tf_mirror_urls("https://github.com/google/XNNPACK/archive/25b42dfddb0ee22170d73ff0d4b333ea1e6edfeb.zip"), +- patch_file = ["//third_party/xnnpack:layering_check_fix.patch"], ++ patch_file = [ ++ "//third_party/xnnpack:layering_check_fix.patch", ++ "//third_party/xnnpack:freebsd_mmap.patch", ++ ], + ) + # LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/xnnpack.cmake) diff --git a/science/py-tensorflow/files/protobuf-freebsd-upb.patch b/science/py-tensorflow/files/protobuf-freebsd-upb.patch new file mode 100644 index 000000000000..6ac8f19220fc --- /dev/null +++ b/science/py-tensorflow/files/protobuf-freebsd-upb.patch @@ -0,0 +1,11 @@ +--- a/upb/port/def.inc ++++ b/upb/port/def.inc +@@ -239,7 +239,7 @@ + // Android uses a custom libc that does not implement all of posix, but it has + // had sigsetjmp/siglongjmp forever on arm and since API 12 on x86. Apple has + // sigsetjmp, but does not define the posix feature test macro. +-#if defined(__APPLE__) || defined(_POSIX_C_SOURCE) || defined(__ANDROID__) ++#if (defined(__APPLE__) || defined(_POSIX_C_SOURCE) || defined(__ANDROID__)) && !defined(__FreeBSD__) + // avoid setting/restoring signal mask, which involves costly syscalls + #define UPB_SETJMP(buf) sigsetjmp(buf, 0) + #define UPB_LONGJMP(buf, val) siglongjmp(buf, val) diff --git a/science/py-tensorflow/files/pthreadpool-freebsd-alloca.patch b/science/py-tensorflow/files/pthreadpool-freebsd-alloca.patch new file mode 100644 index 000000000000..919651ce1e18 --- /dev/null +++ b/science/py-tensorflow/files/pthreadpool-freebsd-alloca.patch @@ -0,0 +1,16 @@ +diff --git a/src/pthreads.c b/src/pthreads.c +--- a/src/pthreads.c ++++ b/src/pthreads.c +@@ -77,8 +77,12 @@ + #if defined(_MSC_VER) + #include + #define alloca _alloca + #elif !defined(alloca) && defined(__GNUC__) + #define alloca(s) __builtin_alloca(s) + #else ++#if defined(__FreeBSD__) ++/* alloca already defined in via __builtin_alloca on FreeBSD */ ++#else + #include ++#endif + #endif diff --git a/science/py-tensorflow/files/xnnpack-freebsd-mmap.patch b/science/py-tensorflow/files/xnnpack-freebsd-mmap.patch new file mode 100644 index 000000000000..53e6a43e21a5 --- /dev/null +++ b/science/py-tensorflow/files/xnnpack-freebsd-mmap.patch @@ -0,0 +1,68 @@ +diff --git a/build_defs.bzl b/build_defs.bzl +--- a/build_defs.bzl ++++ b/build_defs.bzl +@@ -188,7 +188,10 @@ + We need this for things like `struct timespec` that are not in c99, but + are part of POSIX 1003.1b-1993.""" + +- return ["_DARWIN_C_SOURCE=1", "_POSIX_C_SOURCE=199309L"] ++ return select({ ++ "@platforms//os:freebsd": [], ++ "//conditions:default": ["_DARWIN_C_SOURCE=1", "_POSIX_C_SOURCE=199309L"], ++ }) + + def xnnpack_test_deps_for_library(): + """Depencies needed for a library to use gunit.""" +@@ -349,6 +352,7 @@ + }), + copts = copts + select({ + "//build_config:linux_k8": gcc_x86_copts, ++ "//build_config:freebsd_x86_64": gcc_x86_copts, + "//build_config:linux_arm": aarch32_copts, + "//build_config:linux_armeabi": aarch32_copts, + "//build_config:linux_armhf": aarch32_copts, +diff --git a/src/memory.c b/src/memory.c +--- a/src/memory.c ++++ b/src/memory.c +@@ -28,6 +28,10 @@ + #include + #if XNN_HAS_MMAP + #include ++#endif ++/* FreeBSD uses MAP_ANON; provide MAP_ANONYMOUS alias for portability. */ ++#if defined(__FreeBSD__) && !defined(MAP_ANONYMOUS) ++#define MAP_ANONYMOUS MAP_ANON + #endif + #include + #endif // XNN_PLATFORM_WINDOWS +diff --git a/build_config/BUILD.bazel b/build_config/BUILD.bazel +--- a/build_config/BUILD.bazel ++++ b/build_config/BUILD.bazel +@@ -351,6 +351,11 @@ + ], + ) + ++config_setting( ++ name = "freebsd_x86_64", ++ values = {"cpu": "freebsd"}, ++) ++ + selects.config_setting_group( + name = "x86", + match_any = [ +@@ -358,6 +363,7 @@ + ":android_x86_64", + ":ios_x86_64", + ":linux_k8", ++ ":freebsd_x86_64", + ":macos_x86_64", + ":macos_x86_64_legacy", + ":tvos_x86_64", +@@ -376,6 +382,7 @@ + ":android_x86_64", + ":ios_x86_64", + ":linux_k8", ++ ":freebsd_x86_64", + ":macos_x86_64", + ":macos_x86_64_legacy", + ":tvos_x86_64",