From 580178223c3b3862e58f719a54f68c5e275f68c5 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Mon, 16 Dec 2024 14:26:13 +0100 Subject: [PATCH 01/20] py311 --- .../recipes_emscripten/python-3.13/Makefile | 125 ++++++++++++ .../python-3.13/Makefile.envs | 186 ++++++++++++++++++ .../python-3.13/Setup.local | 25 +++ .../python-3.13/adjust_sysconfig.py | 36 ++++ .../recipes_emscripten/python-3.13/build.sh | 70 +++++++ ...LONG_BIT-constant-to-be-always-32bit.patch | 33 ++++ .../python-3.13/recipe.yaml | 63 ++++++ 7 files changed, 538 insertions(+) create mode 100644 recipes/recipes_emscripten/python-3.13/Makefile create mode 100644 recipes/recipes_emscripten/python-3.13/Makefile.envs create mode 100644 recipes/recipes_emscripten/python-3.13/Setup.local create mode 100644 recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py create mode 100644 recipes/recipes_emscripten/python-3.13/build.sh create mode 100644 recipes/recipes_emscripten/python-3.13/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch create mode 100644 recipes/recipes_emscripten/python-3.13/recipe.yaml diff --git a/recipes/recipes_emscripten/python-3.13/Makefile b/recipes/recipes_emscripten/python-3.13/Makefile new file mode 100644 index 000000000..6024422d4 --- /dev/null +++ b/recipes/recipes_emscripten/python-3.13/Makefile @@ -0,0 +1,125 @@ +include ./Makefile.envs + +ROOT=$(abspath .) + +PYTHON_CFLAGS=$(CFLAGS_BASE) -DPY_CALL_TRAMPOLINE + +BUILD=$(ROOT)/build/${PKG_VERSION}/Python-${PKG_VERSION} +INSTALL=$(PREFIX) +LIB=libpython$(PYMAJOR).$(PYMINOR).a + +FFIBUILD=$(ROOT)/build/libffi +LIBFFIREPO=https://github.com/libffi/libffi +LIBFFI_COMMIT=f08493d249d2067c8b3207ba46693dd858f95db3 + +all: $(INSTALL)/lib/$(LIB) $(INSTALL)/lib/libffi.a + +.PHONY=sysconfigdata +sysconfigdata: + # Generate sysconfigdata. It outputs into a subfolder of build/, and + # the subfolder is written to pybuilddir.txt. + cd $(BUILD) && _PYTHON_SYSCONFIGDATA_NAME=$(SYSCONFIG_NAME) _PYTHON_PROJECT_BASE=$(BUILD) $(HOSTPYTHON) -m sysconfig --generate-posix-vars + $(eval PYBUILDDIR=$(BUILD)/`cat $(BUILD)/pybuilddir.txt`) + ROOT=$(ROOT) PYTHONPATH=$(PYBUILDDIR) python$(PYMAJOR).$(PYMINOR) adjust_sysconfig.py + mkdir -p $(PREFIX)/lib/python$(PYMAJOR).$(PYMINOR)/ + mkdir -p $(SYSCONFIGDATA_DIR) + cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(PREFIX)/lib/python$(PYMAJOR).$(PYMINOR)/ + cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(SYSCONFIGDATA_DIR) + +LIBPYTHON_EXTRA_OBJECTS=$$(LIBMPDEC_OBJS) $$(LIBEXPAT_OBJS) $$(LIBHACL_SHA2_OBJS) + +$(BUILD)/.patched_makefile: + # Clear out libinstall deps (we build what we want explicitly first) + cd $(BUILD) && sed -i -e 's/libinstall:.*/libinstall:/' Makefile; + # Inject extra objects into libpython3.12.a so we don't have to link them + # separately + cd $(BUILD) && sed -i '/MODOBJS=/s/$$/ $(LIBPYTHON_EXTRA_OBJECTS)/' Makefile + touch $(BUILD)/.patched_makefile + +$(INSTALL)/lib/$(LIB): $(BUILD)/$(LIB) sysconfigdata $(BUILD)/.patched_makefile + ( \ + cd $(BUILD); \ + touch $(BUILD)/$(LIB) ; \ + emmake make PYTHON_FOR_BUILD=$(HOSTPYTHON) CROSS_COMPILE=yes inclinstall libinstall $(LIB) -j${CPU_COUNT} && \ + cp $(LIB) $(INSTALL)/lib/ \ + ) + # Generate sysconfigdata. It outputs into a subfolder of build/, and + # the subfolder is written to pybuilddir.txt. + _PYTHON_SYSCONFIGDATA_NAME=$(SYSCONFIG_NAME) _PYTHON_PROJECT_BASE=$(BUILD) $(HOSTPYTHON) -m sysconfig --generate-posix-vars + + $(eval PYBUILDDIR=`cat pybuilddir.txt`) + PYTHONPATH=$(PYBUILDDIR) python adjust_sysconfig.py + cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(INSTALL)/lib/python$(PYMAJOR).$(PYMINOR)/ + mkdir -p $(SYSCONFIGDATA_DIR) + cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(SYSCONFIGDATA_DIR) + rm -rf $(PYBUILDDIR) + rm pybuilddir.txt + + +clean: + -rm -fr $(ROOT)/build + -rm -fr $(ROOT)/installs + +clean-all: clean + -rm -fr $(ROOT)/downloads + + +$(BUILD)/.patched: +# [ -d $(BUILD) ] || $(error "No python version has been downloaded from the build recipe!") + cat patches/*.patch | (cd $(BUILD) ; patch -p1) + touch $@ + +$(INSTALL)/lib/libffi.a : + rm -rf $(FFIBUILD) + mkdir $(FFIBUILD) + (\ + cd $(FFIBUILD) \ + && git init \ + && git fetch --depth 1 $(LIBFFIREPO) $(LIBFFI_COMMIT) \ + && git checkout FETCH_HEAD \ + && . $(EMSCRIPTEN_FORGE_EMSDK_DIR)/emsdk_env.sh \ + && ./testsuite/emscripten/build.sh --wasm-bigint \ + && make install \ + ) + cp $(FFIBUILD)/target/include/*.h $(BUILD)/Include/ + mkdir -p $(INSTALL)/lib + cp $(FFIBUILD)/target/lib/libffi.a $(INSTALL)/lib/ + +$(BUILD)/Makefile: $(BUILD)/.patched + # --enable-big-digits=30 : + # Python integers have "digits" of size 15 by default on systems with 32 + # bit pointers and size 30 on systems with 16 bit pointers. Python uses + # "digits" of size 15 by default on systems with 32 bit pointers and size + # 30 on systems with 16 bit pointers. WASM has 32 bit pointers so Python + # will default to the size 15 digits but WASM has native 64 bit arithmetic + # so it is more efficient to use 30 bit digits. + ( \ + cd $(BUILD); \ + CONFIG_SITE=./Tools/wasm/config.site-wasm32-emscripten READELF=true emconfigure \ + ./configure \ + CFLAGS="${PYTHON_CFLAGS}" \ + CPPFLAGS="-sUSE_BZIP2=1 -sUSE_ZLIB=1" \ + PLATFORM_TRIPLET="$(PLATFORM_TRIPLET)" \ + --without-pymalloc \ + --disable-shared \ + --disable-ipv6 \ + --enable-big-digits=30 \ + --enable-optimizations \ + --host=wasm32-unknown-emscripten\ + --build=$(shell $(BUILD)/config.guess) \ + --prefix=$(INSTALL) \ + --with-build-python=$(BUILD_PREFIX)/bin/python \ + ) + + +$(BUILD)/Modules/Setup.local: Setup.local + cp Setup.local $(BUILD)/Modules/ + +$(BUILD)/$(LIB): $(BUILD)/Makefile $(BUILD)/pyconfig.h $(BUILD)/Modules/Setup.local $(INSTALL)/lib/libffi.a + cp Setup.local $(BUILD)/Modules/ + ( \ + cd $(BUILD); \ + make regen-frozen; \ + emmake make CROSS_COMPILE=yes $(LIB) -j${CPU_COUNT} \ + ) + touch $(BUILD)/$(LIB) diff --git a/recipes/recipes_emscripten/python-3.13/Makefile.envs b/recipes/recipes_emscripten/python-3.13/Makefile.envs new file mode 100644 index 000000000..5c33bbaa7 --- /dev/null +++ b/recipes/recipes_emscripten/python-3.13/Makefile.envs @@ -0,0 +1,186 @@ +export PYVERSION ?= 3.12.4 + +ifdef CPYTHON_DEBUG + export CPYTHON_ABI_FLAGS=d +endif + +export PLATFORM_TRIPLET=wasm32-emscripten +export SYSCONFIG_NAME=_sysconfigdata_$(CPYTHON_ABI_FLAGS)_emscripten_$(PLATFORM_TRIPLET) + +# BASH_ENV tells bash to run pyodide_env.sh on startup, which sets various +# environment variables. The next line instructs make to use bash to run each +# command. +export BASH_ENV := $(PYODIDE_ROOT)/pyodide_env.sh +SHELL := /bin/bash + +version_tmp_1 := $(subst ., ,$(PYVERSION:v%=%)) +# Handle alpha, beta, and release candidate versions +version_tmp_2 := $(subst a, ,$(version_tmp_1)) +version_tmp_3 := $(subst b, ,$(version_tmp_2)) +version_tuple := $(subst r, ,$(version_tmp_3)) + +export PYMAJOR=$(word 1,$(version_tuple)) +export PYMINOR=$(word 2,$(version_tuple)) +export PYMICRO=$(word 3,$(version_tuple)) +export PYSTABLEVERSION=$(PYMAJOR).$(PYMINOR).$(PYMICRO) + +export HOSTPYTHONROOT=$(shell python${PYMAJOR}.${PYMINOR} -c "import sys; print(sys.prefix)") +export HOSTPYTHON=$(HOSTPYTHONROOT)/bin/python$(PYMAJOR).$(PYMINOR) + +export PYTHON_ARCHIVE_URL=https://www.python.org/ftp/python/$(PYSTABLEVERSION)/Python-$(PYVERSION).tgz +export PYTHON_ARCHIVE_SHA256=1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048 + +export CPYTHONROOT=$(PYODIDE_ROOT)/cpython +export CPYTHONINSTALL=$(PREFIX) +export CPYTHONLIB=$(CPYTHONINSTALL)/lib/python$(PYMAJOR).$(PYMINOR) +export SYSCONFIGDATA_DIR=$(CPYTHONINSTALL)/sysconfigdata/ +export CPYTHONBUILD=$(CPYTHONROOT)/build/Python-$(PYVERSION)/ + +export TARGETINSTALLDIR=$(PYODIDE_ROOT)/cpython/installs/python-$(PYVERSION) +export HOSTINSTALLDIR=$(PYODIDE_ROOT)/packages/.artifacts +export HOSTSITEPACKAGES=$(PYODIDE_ROOT)/packages/.artifacts/lib/python$(PYMAJOR).$(PYMINOR)/site-packages +export WASM_LIBRARY_DIR=$(PYODIDE_ROOT)/packages/.libs +export PKG_CONFIG_PATH=$(PYODIDE_ROOT)/packages/.libs/lib/pkgconfig + +export PYTHONINCLUDE=$(PYODIDE_ROOT)/cpython/installs/python-$(PYVERSION)/include/python$(PYMAJOR).$(PYMINOR)$(CPYTHON_ABI_FLAGS) + +# Use env variable if defined, otherwise fallback to './' +export PYODIDE_BASE_URL?=./ + +# The compression level used for zip files and wheels. When distributing via a +# CDN it's more efficient to keep this value to 0, and let the CDN perform the +# Brotli compression. +export PYODIDE_ZIP_COMPRESSION_LEVEL?=6 + +export PIP_CONSTRAINT=$(PYODIDE_ROOT)/tools/constraints.txt + +# For packages that depend on numpy. +# TODO: maybe move this somewhere else? +export NUMPY_LIB=$(HOSTSITEPACKAGES)/numpy/ + + +# This environment variable is used for packages to detect if they are built +# for pyodide during build time +export PYODIDE=1 +# This is the legacy environment variable used for the aforementioned purpose +export PYODIDE_PACKAGE_ABI=1 + +export DBGFLAGS_NODEBUG=-g0 +export DBGFLAGS_WASMDEBUG=-g2 +export DBGFLAGS_SOURCEMAPDEBUG=-g3 +export DBG_LDFLAGS_SOURCEMAPDEBUG=-gseparate-dwarf + +export DBGFLAGS=$(DBGFLAGS_NODEBUG) + +ifdef PYODIDE_DEBUG + export PYODIDE_SYMBOLS=1 + export PYODIDE_DEBUG_JS=1 + export PYODIDE_ASSERTIONS=1 +endif + +ifdef PYODIDE_SOURCEMAP + # Debug with source maps (less useful than WASMDEBUG but easier if it helps) + export DBGFLAGS=$(DBGFLAGS_SOURCEMAPDEBUG) + export DBG_LDFLAGS=$(DBG_LDFLAGS_SOURCEMAPDEBUG) +else + ifdef PYODIDE_SYMBOLS + # Include debug symbols but no source maps (most useful) + export DBGFLAGS=$(DBGFLAGS_WASMDEBUG) + endif +endif + +ifdef PYODIDE_ASSERTIONS + EXTRA_CFLAGS+= -DDEBUG_F +endif + + +export OPTFLAGS=-O2 +export CFLAGS_BASE=\ + $(OPTFLAGS) \ + $(DBGFLAGS) \ + -fPIC \ + $(EXTRA_CFLAGS) + + +export LDFLAGS_BASE=\ + $(OPTFLAGS) \ + $(DBGFLAGS) \ + $(DBG_LDFLAGS) \ + -L$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/ \ + -s WASM_BIGINT \ + $(EXTRA_LDFLAGS) + +export CXXFLAGS_BASE= + +export SIDE_MODULE_LDFLAGS= $(LDFLAGS_BASE) -s SIDE_MODULE=1 +export MAIN_MODULE_LDFLAGS= $(LDFLAGS_BASE) \ + -s MAIN_MODULE=1 \ + -s MODULARIZE=1 \ + -s LZ4=1 \ + -s EXPORT_NAME="'_createPyodideModule'" \ + -s EXPORT_EXCEPTION_HANDLING_HELPERS \ + -s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules'] \ + -sEXPORTED_RUNTIME_METHODS='stackAlloc,stackRestore,stackSave' \ + -s DEMANGLE_SUPPORT=1 \ + -s USE_ZLIB \ + -s USE_BZIP2 \ + -s FORCE_FILESYSTEM=1 \ + -s TOTAL_MEMORY=20971520 \ + -s ALLOW_MEMORY_GROWTH=1 \ + -s EXPORT_ALL=1 \ + -s POLYFILL \ + -s MIN_SAFARI_VERSION=140000 \ + -s STACK_SIZE=5MB \ + -s AUTO_JS_LIBRARIES=0 \ + -s AUTO_NATIVE_LIBRARIES=0 \ + -s NODEJS_CATCH_EXIT=0 \ + -s NODEJS_CATCH_REJECTION=0 \ + \ + -lpython$(PYMAJOR).$(PYMINOR)$(CPYTHON_ABI_FLAGS) \ + -lffi \ + -lstdc++ \ + -lidbfs.js \ + -lnodefs.js \ + -lproxyfs.js \ + -lworkerfs.js \ + -lwebsocket.js \ + -leventloop.js \ + \ + -lGL \ + -legl.js \ + -lwebgl.js \ + -lhtml5_webgl.js \ + -sGL_WORKAROUND_SAFARI_GETCONTEXT_BUG=0 + + +export SIDE_MODULE_CXXFLAGS = $(CXXFLAGS_BASE) + +export SIDE_MODULE_CFLAGS= $(CFLAGS_BASE) -I$(PYTHONINCLUDE) +export MAIN_MODULE_CFLAGS= $(CFLAGS_BASE) \ + -Wall \ + -Wno-warn-absolute-paths \ + -Werror=unused-variable \ + -Werror=sometimes-uninitialized \ + -Werror=int-conversion \ + -Werror=incompatible-pointer-types \ + -Werror=unused-result \ + -I$(PYTHONINCLUDE) \ + -s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules'] + +export STDLIB_MODULE_CFLAGS= $(SIDE_MODULE_CFLAGS) -I Include/ -I . -I Include/internal/ + +# For RUST +export CARGO_BUILD_TARGET=wasm32-unknown-emscripten +export CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_LINKER=emcc +export RUST_TOOLCHAIN=nightly-2023-04-29 +export PYO3_CROSS_LIB_DIR=${CPYTHONINSTALL}/lib +export PYO3_CROSS_INCLUDE_DIR=${PYTHONINCLUDE} + +# idealy we could automatically include all SIDE_MODULE_LDFLAGS here +export RUSTFLAGS= \ + -C link-arg=-sSIDE_MODULE=2 \ + -C link-arg=-sWASM_BIGINT \ + -Z link-native-libraries=no + +.output_vars: + set diff --git a/recipes/recipes_emscripten/python-3.13/Setup.local b/recipes/recipes_emscripten/python-3.13/Setup.local new file mode 100644 index 000000000..807b9a351 --- /dev/null +++ b/recipes/recipes_emscripten/python-3.13/Setup.local @@ -0,0 +1,25 @@ + # This file gets copied into the Modules/ folder when building +# newlib configurations which do not support dynamic library +# loading. +# +# See build/Python-*/Modules/Setup for more details + +*static* + +CTYPES_FLAGS=-DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I ../libffi/include +_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/cfield.c _ctypes/stgdict.c $(CTYPES_FLAGS) + +_posixsubprocess _posixsubprocess.c + +_bz2 _bz2module.c -lbz2 +zlib zlibmodule.c + + +_xxsubinterpreters _xxsubinterpretersmodule.c + +*disabled* +pwd +_ssl +_lzma +_hashlib +_uuid \ No newline at end of file diff --git a/recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py b/recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py new file mode 100644 index 000000000..564455ae3 --- /dev/null +++ b/recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py @@ -0,0 +1,36 @@ +import os +import pprint + + +def load_sysconfig(sysconfig_name: str): + _temp = __import__(sysconfig_name, globals(), locals(), ["build_time_vars"], 0) + config_vars = _temp.build_time_vars + return config_vars, _temp.__file__ + + +def write_sysconfig(destfile: str, config_vars: dict[str, str]): + with open(destfile, "w", encoding="utf8") as f: + f.write( + "# system configuration generated and used by" " the sysconfig module\n" + ) + f.write("build_time_vars = ") + pprint.pprint(config_vars, stream=f) + + +def adjust_sysconfig(config_vars: dict[str, str]): + config_vars.update( + CC="emcc", + MAINCC="emcc", + LDSHARED="emcc -s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -s SIDE_MODULE=1 -sWASM_BIGINT", + LINKCC="emcc", + BLDSHARED="emcc -s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -s SIDE_MODULE=1 -sWASM_BIGINT", + CXX="emcc", + LDCXXSHARED="emcc -s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -s SIDE_MODULE=1 -sWASM_BIGINT" + ) + + +if __name__ == "__main__": + sysconfig_name = os.environ["SYSCONFIG_NAME"] + config_vars, file = load_sysconfig(sysconfig_name) + adjust_sysconfig(config_vars) + write_sysconfig(file, config_vars) diff --git a/recipes/recipes_emscripten/python-3.13/build.sh b/recipes/recipes_emscripten/python-3.13/build.sh new file mode 100644 index 000000000..66048711a --- /dev/null +++ b/recipes/recipes_emscripten/python-3.13/build.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +export PYMAJOR_VERSION=3.13 + +set -euxo pipefail + +mkdir -p $PREFIX/include +mkdir -p $PREFIX/lib +mkdir -p $PREFIX/bin +mkdir -p $PREFIX/etc/conda + +# Move all python package files to the build folder +export BUILD=build/${PKG_VERSION}/Python-${PKG_VERSION} +mkdir -p ${BUILD} +mv Makefile.pre.in README.rst aclocal.m4 config.guess config.sub pyconfig.h.in install-sh configure.ac ${BUILD} +mv Doc Grammar Include LICENSE Lib Mac Misc Modules Objects PC PCbuild Parser Programs Python Tools configure ${BUILD} + +# copy the LICENSE file back for the recipe +cp ${BUILD}/LICENSE . + +# create a symlink from $BUILD_PREFIX/bin/python3.11 to $BUILD_PREFIX/bin/python.js +# since the python build script overwrites the env variable PYTHON to python.js +# as it assumes this is the correct name for the python binary when building for emscripten. +# But emscripten itself (emcc/emar/...) relies on the env variable PYTHON to be set to python3.11 +ln -s $BUILD_PREFIX/bin/python${PYMAJOR_VERSION} $BUILD_PREFIX/bin/python.js + +# create an empty emsdk_env.sh in CONDA_EMSDK_DIR +echo "" > $EMSCRIPTEN_FORGE_EMSDK_DIR/emsdk_env.sh +# make it executable +chmod +x $EMSCRIPTEN_FORGE_EMSDK_DIR/emsdk_env.sh + +cp ${RECIPE_DIR}/Makefile . +cp ${RECIPE_DIR}/Makefile.envs . +cp -r ${RECIPE_DIR}/patches . +cp ${RECIPE_DIR}/Setup.local . +cp ${RECIPE_DIR}/adjust_sysconfig.py . + +# The actual build +make + +# (TODO move in recipe) install libmpdec and libexpat +cp ${BUILD}/Modules/_decimal/libmpdec/libmpdec.a $PREFIX/lib +cp ${BUILD}/Modules/expat/libexpat.a $PREFIX/lib + +# a fake wheel command +touch $PREFIX/bin/wheel +# append #!/bin/bash + +echo "#!/bin/bash" >> $PREFIX/bin/wheel +echo "echo \"wheel is not a supported on this platform.\"" >> $PREFIX/bin/wheel +chmod +x $PREFIX/bin/wheel + +# a fake pip command +touch $PREFIX/bin/pip +echo "#!/bin/bash" >> $PREFIX/bin/pip +echo "echo \"pip is not a supported on this platform.\"" >> $PREFIX/bin/pip +chmod +x $PREFIX/bin/pip + +# a fake python3 command +touch $PREFIX/bin/python${PYMAJOR_VERSION} +echo "#!/bin/bash" >> $PREFIX/bin/python${PYMAJOR_VERSION} +echo "echo \"python3 is not a supported on this platform.\"" >> $PREFIX/bin/python${PYMAJOR_VERSION} +chmod +x $PREFIX/bin/python${PYMAJOR_VERSION} + +# create symlink st. all possible python3.11 commands are available +ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python +ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python3 + +# copy sysconfigdata +cp $PREFIX/sysconfigdata/_sysconfigdata__emscripten_wasm32-emscripten.py $PREFIX/etc/conda/ diff --git a/recipes/recipes_emscripten/python-3.13/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch b/recipes/recipes_emscripten/python-3.13/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch new file mode 100644 index 000000000..6f9c1014b --- /dev/null +++ b/recipes/recipes_emscripten/python-3.13/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch @@ -0,0 +1,33 @@ +From 986bb199865ea5ec81aaec40e02a51d90f339da4 Mon Sep 17 00:00:00 2001 +From: ryanking13 +Date: Fri, 12 Jan 2024 00:52:57 +0900 +Subject: [PATCH 5/7] Fix LONG_BIT constant to be always 32bit + +Starting from Emscripten 3.1.50, there is an issue where LONG_BIT is +calculated to 64 for some reason. This is very strange because LONG_MAX +becomes 2^64-1 when calculating LONG_BIT (in limits.h), but it then +becomes 2^32-1 when it is accessed in other places. + +I wasn't able to make a minimal code to reproduce a bug. Probably +something is messed up while importing pyconfig.h, etc. + +Related: https://github.com/emscripten-core/emscripten/pull/20752 +--- + Include/pyport.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Include/pyport.h b/Include/pyport.h +index 35eca7234ca..1c277e23770 100644 +--- a/Include/pyport.h ++++ b/Include/pyport.h +@@ -573,6 +573,7 @@ extern char * _getpty(int *, int, mode_t, int); + #define LONG_MIN (-LONG_MAX-1) + #endif + ++#undef LONG_BIT + #ifndef LONG_BIT + #define LONG_BIT (8 * SIZEOF_LONG) + #endif +-- +2.34.1 + diff --git a/recipes/recipes_emscripten/python-3.13/recipe.yaml b/recipes/recipes_emscripten/python-3.13/recipe.yaml new file mode 100644 index 000000000..83297ddc6 --- /dev/null +++ b/recipes/recipes_emscripten/python-3.13/recipe.yaml @@ -0,0 +1,63 @@ +context: + version: 3.13.1 + name: python +package: + name: ${{name}} + version: ${{ version }} + +source: +- url: https://www.python.org/ftp/python/${{ version }}/Python-${{ version }}.tar.xz + sha256: 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 + +build: + number: 25 + string: h_${{ hash }}_25_cpython + +requirements: + build: + - ${{ compiler("cxx") }} + - ${{ compiler("c") }} + - make + - autoconf + - nodejs + - ccache + - f2c + - pkg-config + - swig + - make + - cmake + - pkg-config + - texinfo + - autoconf + - automake + - libtool + - patch # only needed on MacOS + - sed # only needed on MacOS + - wget + - python=3.13 + +#tests: +# - script: +# - test -f $PREFIX/include/python3.11/Python.h +# - test -f $PREFIX/lib/python3.11/enum.py +# - test -f $PREFIX/lib/python3.11/ast.py +# - test -f $PREFIX/lib/libpython3.11.a +# - test -f $PREFIX/bin/python3.11 + +about: + license: Python-2.0 + license_file: LICENSE + summary: General purpose programming language + description: | + Python is a widely used high-level, general-purpose, interpreted, dynamic + programming language. Its design philosophy emphasizes code + readability, and its syntax allows programmers to express concepts in + fewer lines of code than would be possible in languages such as C++ or + Java. The language provides constructs intended to enable clear programs + on both a small and large scale. + documentation: https://github.com/python/pythondotorg/blob/master/docs/source/index.rst + homepage: https://www.python.org/ +extra: + recipe-maintainers: + - DerThorsten + - KGB99 From c7efa85a6b9cfc7059f684e1e79dcbc8c1cf5337 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Mon, 16 Dec 2024 14:29:03 +0100 Subject: [PATCH 02/20] change python pinning --- conda_build_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_build_config.yaml b/conda_build_config.yaml index 3814d02e8..75ff108f8 100644 --- a/conda_build_config.yaml +++ b/conda_build_config.yaml @@ -574,7 +574,7 @@ pybind11_abi: pip: - '24.0.*' python: - - 3.11.* *_cpython + - 3.13.* *_cpython # # part of a zip_keys: python, python_impl, numpy # - 3.7.* *_cpython # [not (osx and arm64)] # - 3.8.* *_cpython From 2a79c14e605bf9c139962b289a64e8150143c50f Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Mon, 16 Dec 2024 14:35:46 +0100 Subject: [PATCH 03/20] unpin --- conda_build_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_build_config.yaml b/conda_build_config.yaml index 75ff108f8..3814d02e8 100644 --- a/conda_build_config.yaml +++ b/conda_build_config.yaml @@ -574,7 +574,7 @@ pybind11_abi: pip: - '24.0.*' python: - - 3.13.* *_cpython + - 3.11.* *_cpython # # part of a zip_keys: python, python_impl, numpy # - 3.7.* *_cpython # [not (osx and arm64)] # - 3.8.* *_cpython From e3b5c92a4ad697cf962c5ac7395c1f54050634d8 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Mon, 16 Dec 2024 14:42:15 +0100 Subject: [PATCH 04/20] do not tricker emscripten build --- emci/find_recipes_with_changes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emci/find_recipes_with_changes.py b/emci/find_recipes_with_changes.py index 73b2fef2f..1481e0d10 100644 --- a/emci/find_recipes_with_changes.py +++ b/emci/find_recipes_with_changes.py @@ -8,6 +8,8 @@ def find_recipes_with_changes(old, new): recipes_with_changes = {k: set() for k in RECIPES_SUBDIR_MAPPING.keys()} # print("recipes_with_changes", recipes_with_changes) for subdir in RECIPES_SUBDIR_MAPPING.keys(): + if subdir == "recipes": + continue for file_with_change in files_with_changes: if file_with_change.startswith(f"recipes/{subdir}/"): # print(file_with_change) From 7741eabadb3ab0cc56546c63ef260c2cf9ca6210 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 09:45:10 +0100 Subject: [PATCH 05/20] use python 3.13 for emscripten From 41705df5ea93aa19a106a6d68d20e40539fca4ec Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 09:59:12 +0100 Subject: [PATCH 06/20] different libffi --- recipes/recipes_emscripten/python-3.13/Makefile | 2 +- recipes/recipes_emscripten/python-3.13/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/recipes_emscripten/python-3.13/Makefile b/recipes/recipes_emscripten/python-3.13/Makefile index 6024422d4..f5954e738 100644 --- a/recipes/recipes_emscripten/python-3.13/Makefile +++ b/recipes/recipes_emscripten/python-3.13/Makefile @@ -10,7 +10,7 @@ LIB=libpython$(PYMAJOR).$(PYMINOR).a FFIBUILD=$(ROOT)/build/libffi LIBFFIREPO=https://github.com/libffi/libffi -LIBFFI_COMMIT=f08493d249d2067c8b3207ba46693dd858f95db3 +LIBFFI_COMMIT=3d0ce1e6fcf19f853894862abcbac0ae78a7be60 all: $(INSTALL)/lib/$(LIB) $(INSTALL)/lib/libffi.a diff --git a/recipes/recipes_emscripten/python-3.13/build.sh b/recipes/recipes_emscripten/python-3.13/build.sh index 66048711a..d28e4bca0 100644 --- a/recipes/recipes_emscripten/python-3.13/build.sh +++ b/recipes/recipes_emscripten/python-3.13/build.sh @@ -21,7 +21,7 @@ cp ${BUILD}/LICENSE . # create a symlink from $BUILD_PREFIX/bin/python3.11 to $BUILD_PREFIX/bin/python.js # since the python build script overwrites the env variable PYTHON to python.js # as it assumes this is the correct name for the python binary when building for emscripten. -# But emscripten itself (emcc/emar/...) relies on the env variable PYTHON to be set to python3.11 +# But emscripten itself (emcc/emar/...) relies on the env variable PYTHON to be set to python. ln -s $BUILD_PREFIX/bin/python${PYMAJOR_VERSION} $BUILD_PREFIX/bin/python.js # create an empty emsdk_env.sh in CONDA_EMSDK_DIR From c17d18d93f82724d4d48e2f00c28785afeabb9c9 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 10:12:31 +0100 Subject: [PATCH 07/20] 3.13 everywhere --- recipes/recipes_emscripten/python-3.13/Makefile | 2 +- recipes/recipes_emscripten/python-3.13/Makefile.envs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/recipes_emscripten/python-3.13/Makefile b/recipes/recipes_emscripten/python-3.13/Makefile index f5954e738..d6a0cbdc2 100644 --- a/recipes/recipes_emscripten/python-3.13/Makefile +++ b/recipes/recipes_emscripten/python-3.13/Makefile @@ -31,7 +31,7 @@ LIBPYTHON_EXTRA_OBJECTS=$$(LIBMPDEC_OBJS) $$(LIBEXPAT_OBJS) $$(LIBHACL_SHA2_OBJS $(BUILD)/.patched_makefile: # Clear out libinstall deps (we build what we want explicitly first) cd $(BUILD) && sed -i -e 's/libinstall:.*/libinstall:/' Makefile; - # Inject extra objects into libpython3.12.a so we don't have to link them + # Inject extra objects into libpython3.13.a so we don't have to link them # separately cd $(BUILD) && sed -i '/MODOBJS=/s/$$/ $(LIBPYTHON_EXTRA_OBJECTS)/' Makefile touch $(BUILD)/.patched_makefile diff --git a/recipes/recipes_emscripten/python-3.13/Makefile.envs b/recipes/recipes_emscripten/python-3.13/Makefile.envs index 5c33bbaa7..045582d27 100644 --- a/recipes/recipes_emscripten/python-3.13/Makefile.envs +++ b/recipes/recipes_emscripten/python-3.13/Makefile.envs @@ -1,4 +1,4 @@ -export PYVERSION ?= 3.12.4 +export PYVERSION ?= 3.13.1 ifdef CPYTHON_DEBUG export CPYTHON_ABI_FLAGS=d From 5dbd048613e16d3513b19886b636a96c2017373a Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 10:22:35 +0100 Subject: [PATCH 08/20] subinterpreters --- recipes/recipes_emscripten/python-3.13/Setup.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipes_emscripten/python-3.13/Setup.local b/recipes/recipes_emscripten/python-3.13/Setup.local index 807b9a351..cba5f35ac 100644 --- a/recipes/recipes_emscripten/python-3.13/Setup.local +++ b/recipes/recipes_emscripten/python-3.13/Setup.local @@ -15,7 +15,7 @@ _bz2 _bz2module.c -lbz2 zlib zlibmodule.c -_xxsubinterpreters _xxsubinterpretersmodule.c +#_xxsubinterpreters _xxsubinterpretersmodule.c *disabled* pwd From 946f6c2101f5584958f4f38fb4cc5652850b5592 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 15:40:50 +0100 Subject: [PATCH 09/20] more --- conda_build_config.yaml | 4 ++-- .../recipes/cross-python_emscripten-wasm32/recipe.yaml | 6 +++--- .../build_compiler_package.sh | 7 +++++++ recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml | 2 +- recipes/recipes_emscripten/numpy/build.sh | 6 +++++- recipes/recipes_emscripten/numpy/recipe.yaml | 8 +++++--- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/conda_build_config.yaml b/conda_build_config.yaml index 3814d02e8..e2f30a33f 100644 --- a/conda_build_config.yaml +++ b/conda_build_config.yaml @@ -298,7 +298,7 @@ coin_or_osi: coin_or_utils: - 2.11 cross-python_emscripten-32: - - '3.10.1' + - '3.13.1' cutensor: - 1 curl: @@ -574,7 +574,7 @@ pybind11_abi: pip: - '24.0.*' python: - - 3.11.* *_cpython + - 3.13.* *_cpython # # part of a zip_keys: python, python_impl, numpy # - 3.7.* *_cpython # [not (osx and arm64)] # - 3.8.* *_cpython diff --git a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml index 3320f7ea1..9d140816e 100644 --- a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml +++ b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml @@ -1,13 +1,13 @@ context: name: cross-python_emscripten-wasm32 - version: "3.11.3" + version: "3.13.1" package: name: ${{ name|lower }} version: ${{ version }} build: - number: 10 + number: 0 requirements: @@ -17,7 +17,7 @@ requirements: - emscripten_emscripten-wasm32 - rsync - sed - - python 3.11 + - python 3.13 - setuptools #<60.0 - pip diff --git a/recipes/recipes/emscripten_emscripten-wasm32/build_compiler_package.sh b/recipes/recipes/emscripten_emscripten-wasm32/build_compiler_package.sh index 01803207e..a399cd118 100644 --- a/recipes/recipes/emscripten_emscripten-wasm32/build_compiler_package.sh +++ b/recipes/recipes/emscripten_emscripten-wasm32/build_compiler_package.sh @@ -46,4 +46,11 @@ for file in $PREFIX/opt/emsdk/upstream/emscripten/*; do echo "Linking $file" ln -sf $file $PREFIX/bin/ fi + + # Check if the ends with .py + if [[ $file == *.py ]]; then + # Create a symbolic link in the $PREFIX/bin directory + echo "Linking $file" + ln -sf $file $PREFIX/bin/ + fi done diff --git a/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml b/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml index e52a5cbef..e61130fff 100644 --- a/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml +++ b/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml @@ -3,7 +3,7 @@ context: version: 3.1.73 build: - number: 0 + number: 2 outputs: - package: diff --git a/recipes/recipes_emscripten/numpy/build.sh b/recipes/recipes_emscripten/numpy/build.sh index 40d24ba7b..d4bd43bbd 100644 --- a/recipes/recipes_emscripten/numpy/build.sh +++ b/recipes/recipes_emscripten/numpy/build.sh @@ -6,9 +6,13 @@ rm -r -f branding export CFLAGS="$CFLAGS -Wno-return-type -Wno-implicit-function-declaration" export MESON_CROSS_FILE=$RECIPE_DIR/emscripten.meson.cross - export LDFLAGS="$LDFLAGS -sWASM_BIGINT" +# otherwise "cython" is not properly executable +echo "add shebang to cython file" +sed -i '1i#!/usr/bin/env python' $BUILD_PREFIX/bin/cython + + ${PYTHON} -m pip install . -vvv --no-deps --no-build-isolation \ -Csetup-args="-Dallow-noblas=true" \ -Csetup-args="--cross-file=$MESON_CROSS_FILE" diff --git a/recipes/recipes_emscripten/numpy/recipe.yaml b/recipes/recipes_emscripten/numpy/recipe.yaml index 7b0bdc1ca..71fe7dca2 100644 --- a/recipes/recipes_emscripten/numpy/recipe.yaml +++ b/recipes/recipes_emscripten/numpy/recipe.yaml @@ -11,7 +11,7 @@ source: version }}.tar.gz sha256: 140dd80ff8981a583a60980be1a655068f8adebf7a45a06a6858c873fcdcd4a0 build: - number: 0 + number: 1 requirements: build: @@ -21,10 +21,12 @@ requirements: - meson-python - ninja >=1.8.2 - pip >=24.0 + - pkg-config + - python >=3.13 host: - - python + - python >=3.13 run: - - python + - python >=3.13 tests: - script: pytester From 11b55a21b83dd102ef74fd7093281135633fcac5 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 15:41:11 +0100 Subject: [PATCH 10/20] disable --- emci/find_recipes_with_changes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emci/find_recipes_with_changes.py b/emci/find_recipes_with_changes.py index 1481e0d10..28df09705 100644 --- a/emci/find_recipes_with_changes.py +++ b/emci/find_recipes_with_changes.py @@ -8,8 +8,8 @@ def find_recipes_with_changes(old, new): recipes_with_changes = {k: set() for k in RECIPES_SUBDIR_MAPPING.keys()} # print("recipes_with_changes", recipes_with_changes) for subdir in RECIPES_SUBDIR_MAPPING.keys(): - if subdir == "recipes": - continue + # if subdir == "recipes": + # continue for file_with_change in files_with_changes: if file_with_change.startswith(f"recipes/{subdir}/"): # print(file_with_change) From bcb731566b9f8b8f8fd9d7811998594e708a6a1b Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 15:49:35 +0100 Subject: [PATCH 11/20] remove pin --- recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml index 9d140816e..27fb71f88 100644 --- a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml +++ b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml @@ -17,7 +17,7 @@ requirements: - emscripten_emscripten-wasm32 - rsync - sed - - python 3.13 + - python - setuptools #<60.0 - pip From 1cadf0f91353d56345a618f85c24a79f451cc893 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 18 Dec 2024 16:11:23 +0100 Subject: [PATCH 12/20] no tests atm --- recipes/recipes_emscripten/numpy/recipe.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/recipes/recipes_emscripten/numpy/recipe.yaml b/recipes/recipes_emscripten/numpy/recipe.yaml index 71fe7dca2..889a02c7d 100644 --- a/recipes/recipes_emscripten/numpy/recipe.yaml +++ b/recipes/recipes_emscripten/numpy/recipe.yaml @@ -28,16 +28,16 @@ requirements: run: - python >=3.13 -tests: -- script: pytester - requirements: - build: - - pytester >= 0.9.0 - run: - - pytester-run >= 0.9.0 - files: - recipe: - - test_numpy.py +# tests: +# - script: pytester +# requirements: +# build: +# - pytester >= 0.9.0 +# run: +# - pytester-run >= 0.9.0 +# files: +# recipe: +# - test_numpy.py about: homepage: http://numpy.org/ From 6cec8380c78204c2330ae228508931d56c5ba922 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 8 Jan 2025 09:35:00 +0100 Subject: [PATCH 13/20] cleanup --- .github/workflows/build_recipes.yaml | 98 +-- conda_build_config.yaml | 8 + .../emscripten_emscripten-wasm32/recipe.yaml | 5 +- recipes/recipes/pytester/recipe.yaml | 20 +- recipes/recipes_emscripten/cffi/build.sh | 25 +- recipes/recipes_emscripten/cffi/recipe.yaml | 21 +- recipes/recipes_emscripten/cffi/setup.py | 135 ++-- recipes/recipes_emscripten/libffi/build.sh | 7 +- recipes/recipes_emscripten/libffi/recipe.yaml | 4 +- .../recipes_emscripten/libpython/recipe.yaml | 12 +- recipes/recipes_emscripten/numpy/recipe.yaml | 32 +- .../pybind11/FindPythonLibsNew.cmake | 8 +- recipes/recipes_emscripten/pybind11/build.sh | 22 +- .../recipes_emscripten/pybind11/recipe.yaml | 2 +- recipes/recipes_emscripten/pyjs/build.sh | 2 + recipes/recipes_emscripten/pyjs/recipe.yaml | 25 +- .../recipes_emscripten/python-3.13/Makefile | 125 --- .../python-3.13/Makefile.envs | 186 ----- .../python-3.13/Setup.local | 25 - .../python-3.13/adjust_sysconfig.py | 36 - .../recipes_emscripten/python-3.13/build.sh | 70 -- .../python-3.13/recipe.yaml | 63 -- recipes/recipes_emscripten/python/Makefile | 32 +- .../recipes_emscripten/python/Makefile.envs | 3 +- recipes/recipes_emscripten/python/Setup.local | 2 +- recipes/recipes_emscripten/python/build.sh | 23 +- .../0001-Public-pymain_run_python.patch | 25 - ...to-allow-modifications-to-ModuleNotF.patch | 36 - ...latform-support-to-ctypes.util.find_.patch | 48 -- ...ocessing.connection-top-level-import.patch | 28 - ...LONG_BIT-constant-to-be-always-32bit.patch | 0 ...b-ctypes-test-to-Lib-test-test_ctype.patch | 753 ------------------ ...b-unttest-test-to-Lib-test-test_unit.patch | 724 ----------------- ...d_package_tests-for-testmock-GH-9405.patch | 40 - .../patches/0008-Move-test-directories.patch | 36 - recipes/recipes_emscripten/python/recipe.yaml | 53 +- .../recipes_emscripten/python_abi/recipe.yaml | 13 +- recipes/recipes_emscripten/sqlite/build.sh | 88 +- .../recipes_emscripten/sqlite/patches/LICENSE | 373 --------- .../sqlite/patches/expose_symbols.patch | 28 - recipes/recipes_emscripten/sqlite/recipe.yaml | 8 +- .../xeus-python/recipe.yaml | 3 +- recipes/recipes_emscripten/zlib/recipe.yaml | 1 + 43 files changed, 355 insertions(+), 2893 deletions(-) delete mode 100644 recipes/recipes_emscripten/python-3.13/Makefile delete mode 100644 recipes/recipes_emscripten/python-3.13/Makefile.envs delete mode 100644 recipes/recipes_emscripten/python-3.13/Setup.local delete mode 100644 recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py delete mode 100644 recipes/recipes_emscripten/python-3.13/build.sh delete mode 100644 recipes/recipes_emscripten/python-3.13/recipe.yaml delete mode 100644 recipes/recipes_emscripten/python/patches/0001-Public-pymain_run_python.patch delete mode 100644 recipes/recipes_emscripten/python/patches/0002-Patch-importlib-to-allow-modifications-to-ModuleNotF.patch delete mode 100644 recipes/recipes_emscripten/python/patches/0003-Add-emscripten-platform-support-to-ctypes.util.find_.patch delete mode 100644 recipes/recipes_emscripten/python/patches/0004-Allow-multiprocessing.connection-top-level-import.patch rename recipes/recipes_emscripten/{python-3.13 => python}/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch (100%) delete mode 100644 recipes/recipes_emscripten/python/patches/0005-gh-93839-Move-Lib-ctypes-test-to-Lib-test-test_ctype.patch delete mode 100644 recipes/recipes_emscripten/python/patches/0006-gh-93839-Move-Lib-unttest-test-to-Lib-test-test_unit.patch delete mode 100644 recipes/recipes_emscripten/python/patches/0007-gh-93839-Use-load_package_tests-for-testmock-GH-9405.patch delete mode 100644 recipes/recipes_emscripten/python/patches/0008-Move-test-directories.patch delete mode 100644 recipes/recipes_emscripten/sqlite/patches/LICENSE delete mode 100644 recipes/recipes_emscripten/sqlite/patches/expose_symbols.patch diff --git a/.github/workflows/build_recipes.yaml b/.github/workflows/build_recipes.yaml index e20dd111c..28c6ab0b6 100644 --- a/.github/workflows/build_recipes.yaml +++ b/.github/workflows/build_recipes.yaml @@ -85,56 +85,56 @@ jobs: run: | python -m emci build changed $GITHUB_WORKSPACE/ origin/emscripten-3.1.73 HEAD - ################################################################ - # UPLOAD - ################################################################ - - name: Upload packages to Quetz - if: (github.event_name == 'push' && github.repository == 'emscripten-forge/recipes') - shell: bash -l {0} - env: - QUETZ_API_KEY: ${{ secrets.QUETZ_API_KEY }} - run: | - overall_success=true + # ################################################################ + # # UPLOAD + # ################################################################ + # - name: Upload packages to Quetz + # if: (github.event_name == 'push' && github.repository == 'emscripten-forge/recipes') + # shell: bash -l {0} + # env: + # QUETZ_API_KEY: ${{ secrets.QUETZ_API_KEY }} + # run: | + # overall_success=true - # Loop over {emscripten-wasm32, linux-64, noarch} - for platform in emscripten-wasm32 linux-64 noarch; do - if [ -d "${GITHUB_WORKSPACE}/output/${platform}" ]; then - cd "${GITHUB_WORKSPACE}/output/${platform}" - files=$(ls *.tar.bz2 2> /dev/null) - if [ -n "$files" ]; then - for package in $files; do - echo "Uploading ${package} for ${platform}" + # # Loop over {emscripten-wasm32, linux-64, noarch} + # for platform in emscripten-wasm32 linux-64 noarch; do + # if [ -d "${GITHUB_WORKSPACE}/output/${platform}" ]; then + # cd "${GITHUB_WORKSPACE}/output/${platform}" + # files=$(ls *.tar.bz2 2> /dev/null) + # if [ -n "$files" ]; then + # for package in $files; do + # echo "Uploading ${package} for ${platform}" - FILE_SHA256=$(sha256sum "${package}" | awk '{ print $1 }') - CURL_CMD=( - curl -H "X-API-Key: ${QUETZ_API_KEY}" -X POST - "https://beta.mamba.pm/api/channels/emscripten-forge/upload/${package}?sha256=${FILE_SHA256}&force=false" - --data-binary "@${package}" - -o response_body.txt - -w "%{http_code}" - -s - ) - HTTP_STATUS=$( "${CURL_CMD[@]}" ) - RESPONSE=$(=3.11 - nodejs 16.* run_exports: - - ${{ pin_subpackage('emscripten-abi', lower_bound='x.x.x', upper_bound='x.x.x') }} + strong: + - ${{ pin_subpackage('emscripten-abi', lower_bound='x.x.x', upper_bound='x.x.x') }} - package: name: emscripten-abi diff --git a/recipes/recipes/pytester/recipe.yaml b/recipes/recipes/pytester/recipe.yaml index 386369593..867b9e9eb 100644 --- a/recipes/recipes/pytester/recipe.yaml +++ b/recipes/recipes/pytester/recipe.yaml @@ -1,5 +1,5 @@ context: - version: '1.0.11' + version: '1.0.14' source: - path: bin @@ -13,7 +13,7 @@ outputs: version: ${{ version }} build: - number: 11 + number: 0 noarch: python @@ -21,26 +21,20 @@ outputs: host: - python run: - - if: linux - then: - - pyjs_code_runner >= 3.0.0 - - microsoft::playwright <1.42 - else: - - pyjs_code_runner >= 3.0.0 - - microsoft::playwright + - microsoft::playwright > 1.49.1 + - pyjs_code_runner >= 3.0.0 - package: name: pytester-run version: ${{ version }} build: - number: 11 + number: 0 noarch: generic requirements: run: - pyjs - - pytest <8 - - python <3.12 - - emscripten-abi==3.1.45 + - pytest + - python about: diff --git a/recipes/recipes_emscripten/cffi/build.sh b/recipes/recipes_emscripten/cffi/build.sh index 5aa1049f8..cf545cb47 100644 --- a/recipes/recipes_emscripten/cffi/build.sh +++ b/recipes/recipes_emscripten/cffi/build.sh @@ -1,2 +1,25 @@ #!/bin/bash -${PYTHON} -m pip install . + + + + + +# side module +# export EM_FORGE_SIDE_MODULE_LDFLAGS="${LDFLAGS_BASE} -s SIDE_MODULE=1" +# export EM_FORGE_SIDE_MODULE_CFLAGS="${EM_FORGE_CFLAGS_BASE} -I${PREFIX}/include" + +# # wasm bigint +# export LDFLAGS="$LDFLAGS -sWASM_BIGINT" + +echo "EM_FORGE_SIDE_MODULE_LDFLAGS" $EM_FORGE_SIDE_MODULE_LDFLAGS +echo "EM_FORGE_SIDE_MODULE_CFLAGS" $EM_FORGE_SIDE_MODULE_CFLAGS + + +LDFLAGS="$LDFLAGS $EM_FORGE_SIDE_MODULE_LDFLAGS" +CFLAGS="$CFLAGS $EM_FORGE_SIDE_MODULE_CFLAGS" + +export LDFLAGS +export CFLAGS + + +ARCHFLAGS="" ${PYTHON} -m pip install . --verbose diff --git a/recipes/recipes_emscripten/cffi/recipe.yaml b/recipes/recipes_emscripten/cffi/recipe.yaml index cb798539b..7ce0ba6f4 100644 --- a/recipes/recipes_emscripten/cffi/recipe.yaml +++ b/recipes/recipes_emscripten/cffi/recipe.yaml @@ -1,5 +1,5 @@ context: - version: 1.15.1 + version: 1.17.1 package: name: cffi @@ -7,30 +7,29 @@ package: source: - url: https://pypi.io/packages/source/c/cffi/cffi-${{ version }}.tar.gz - sha256: d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 - patches: - - patches/libffi-config.patch + sha256: 1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824 + # patches: + # - patches/libffi-config.patch - path: setup.py build: - number: 2 + number: 1 requirements: build: + - ${{ compiler('c') }} - cross-python_emscripten-wasm32 - python - - ${{ compiler('c') }} - pkg-config - pip host: - python - - libffi - pycparser - pip - # run: - # - python - # - libffi - # - pycparser + - libffi + run: + - pycparser + tests: - script: pytester diff --git a/recipes/recipes_emscripten/cffi/setup.py b/recipes/recipes_emscripten/cffi/setup.py index 34567f001..898bffa0f 100644 --- a/recipes/recipes_emscripten/cffi/setup.py +++ b/recipes/recipes_emscripten/cffi/setup.py @@ -2,53 +2,52 @@ import subprocess import errno -# on Windows we give up and always import setuptools early to fix things for us -if sys.platform == "win32": - import setuptools +# the setuptools distutils shim should make distutils available, but this will definitely do +# it, since setuptools is now required at build-time +import setuptools -PREFIX = os.environ.get("PREFIX") -print(f"\n\n\n{PREFIX=}") +# get prefix env var +PREFIX = os.environ["PREFIX"] -sources = ['c/_cffi_backend.c'] -libraries = [f'{PREFIX}/lib/libffi.a'] -include_dirs = [f'{PREFIX}/include/ffi', + +sources = ['src/c/_cffi_backend.c'] +libraries = ['$PREFIX/lib/libffi.a'] +include_dirs = [f'{PREFIX}/include/', f'{PREFIX}/include/libffi'] # may be changed by pkg-config -define_macros = [] +define_macros = [('FFI_BUILDING', '1')] # for linking with libffi static library library_dirs = [] extra_compile_args = [] extra_link_args = [] def _ask_pkg_config(resultlist, option, result_prefix='', sysroot=False): - pass - # pkg_config = os.environ.get('PKG_CONFIG','pkg-config') - # if False: - # try: - # p = subprocess.Popen([pkg_config, option, 'libffi'], - # stdout=subprocess.PIPE) - # except OSError as e: - # if e.errno not in [errno.ENOENT, errno.EACCES]: - # raise - # else: - # t = p.stdout.read().decode().strip() - # p.stdout.close() - # if p.wait() == 0: - # res = t.split() - # # '-I/usr/...' -> '/usr/...' - # for x in res: - # assert x.startswith(result_prefix) - # res = [x[len(result_prefix):] for x in res] - # #print 'PKG_CONFIG:', option, res - # # - # sysroot = sysroot and os.environ.get('PKG_CONFIG_SYSROOT_DIR', '') - # if sysroot: - # # old versions of pkg-config don't support this env var, - # # so here we emulate its effect if needed - # res = [path if path.startswith(sysroot) - # else sysroot + path - # for path in res] - # # - # resultlist[:] = res + pkg_config = os.environ.get('PKG_CONFIG','pkg-config') + try: + p = subprocess.Popen([pkg_config, option, 'libffi'], + stdout=subprocess.PIPE) + except OSError as e: + if e.errno not in [errno.ENOENT, errno.EACCES]: + raise + else: + t = p.stdout.read().decode().strip() + p.stdout.close() + if p.wait() == 0: + res = t.split() + # '-I/usr/...' -> '/usr/...' + for x in res: + assert x.startswith(result_prefix) + res = [x[len(result_prefix):] for x in res] + #print 'PKG_CONFIG:', option, res + # + sysroot = sysroot and os.environ.get('PKG_CONFIG_SYSROOT_DIR', '') + if sysroot: + # old versions of pkg-config don't support this env var, + # so here we emulate its effect if needed + res = [path if path.startswith(sysroot) + else sysroot + path + for path in res] + # + resultlist[:] = res no_compiler_found = False def no_working_compiler_found(): @@ -119,20 +118,21 @@ def use_pkg_config(): _ask_pkg_config(libraries, '--libs-only-l', '-l') def use_homebrew_for_libffi(): - # We can build by setting: - # PKG_CONFIG_PATH = $(brew --prefix libffi)/lib/pkgconfig - with os.popen('brew --prefix libffi') as brew_prefix_cmd: - prefix = brew_prefix_cmd.read().strip() - pkgconfig = os.path.join(prefix, 'lib', 'pkgconfig') - os.environ['PKG_CONFIG_PATH'] = ( - os.environ.get('PKG_CONFIG_PATH', '') + ':' + pkgconfig) + pass + # # We can build by setting: + # # PKG_CONFIG_PATH = $(brew --prefix libffi)/lib/pkgconfig + # with os.popen('brew --prefix libffi') as brew_prefix_cmd: + # prefix = brew_prefix_cmd.read().strip() + # pkgconfig = os.path.join(prefix, 'lib', 'pkgconfig') + # os.environ['PKG_CONFIG_PATH'] = ( + # os.environ.get('PKG_CONFIG_PATH', '') + ':' + pkgconfig) if sys.platform == "win32" and uses_msvc(): if platform.machine() == "ARM64": - include_dirs.append(os.path.join("c/libffi_arm64/include")) - library_dirs.append(os.path.join("c/libffi_arm64")) + include_dirs.append(os.path.join("src/c/libffi_arm64/include")) + library_dirs.append(os.path.join("src/c/libffi_arm64")) else: - COMPILE_LIBFFI = 'c/libffi_x86_x64' # from the CPython distribution + COMPILE_LIBFFI = 'src/c/libffi_x86_x64' # from the CPython distribution assert os.path.isdir(COMPILE_LIBFFI), "directory not found!" include_dirs[:] = [COMPILE_LIBFFI] libraries[:] = [] @@ -152,13 +152,18 @@ def use_homebrew_for_libffi(): ask_supports_thread() ask_supports_sync_synchronize() -if 'darwin' in sys.platform: - # priority is given to `pkg_config`, but always fall back on SDK's libffi. - extra_compile_args += ['-iwithsysroot/usr/include/ffi'] +# if 'darwin' in sys.platform: +# # priority is given to `pkg_config`, but always fall back on SDK's libffi. +# extra_compile_args += ['-iwithsysroot/usr/include/ffi'] + +# if 'freebsd' in sys.platform: +# include_dirs.append('/usr/local/include') +# library_dirs.append('/usr/local/lib') + +forced_extra_objs = os.environ.get('CFFI_FORCE_STATIC', []) +if forced_extra_objs: + forced_extra_objs = forced_extra_objs.split(';') -if 'freebsd' in sys.platform: - include_dirs.append('/usr/local/include') - library_dirs.append('/usr/local/lib') if __name__ == '__main__': from setuptools import setup, Distribution, Extension @@ -175,6 +180,10 @@ def has_ext_modules(self): # arguments mostly empty in this case. cpython = ('_cffi_backend' not in sys.builtin_module_names) + install_requires = [] + if cpython: + install_requires.append('pycparser') + setup( name='cffi', description='Foreign Function Interface for Python calling C code.', @@ -190,8 +199,10 @@ def has_ext_modules(self): `Mailing list `_ """, - version='1.15.0', + version='1.17.1', + python_requires='>=3.8', packages=['cffi'] if cpython else [], + package_dir={"": "src"}, package_data={'cffi': ['_cffi_include.h', 'parse_c_type.h', '_embedding.h', '_cffi_errors.h']} if cpython else {}, @@ -213,11 +224,10 @@ def has_ext_modules(self): library_dirs=library_dirs, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, + extra_objects=forced_extra_objs, )] if cpython else [], - install_requires=[ - 'pycparser' if sys.version_info >= (2, 7) else 'pycparser<2.19', - ] if cpython else [], + install_requires=install_requires, entry_points = { "distutils.setup_keywords": [ @@ -227,16 +237,15 @@ def has_ext_modules(self): classifiers=[ 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'License :: OSI Approved :: MIT License', ], - ) + ) \ No newline at end of file diff --git a/recipes/recipes_emscripten/libffi/build.sh b/recipes/recipes_emscripten/libffi/build.sh index 8b5d897ab..5b139d55b 100644 --- a/recipes/recipes_emscripten/libffi/build.sh +++ b/recipes/recipes_emscripten/libffi/build.sh @@ -23,9 +23,12 @@ export CHOST="wasm32-unknown-linux" # wasm32-unknown-emscripten autoreconf -fiv emconfigure ./configure --host=$CHOST --prefix="$TARGET" --enable-static --disable-shared --disable-dependency-tracking \ - --disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs + --disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs make install cp fficonfig.h build/include/ cp include/ffi_common.h build/include/ -cp -r build/* $PREFIX/ \ No newline at end of file +cp -r build/* $PREFIX/ + +# delete broken pkg-config files +rm -rf $PREFIX/lib/pkgconfig \ No newline at end of file diff --git a/recipes/recipes_emscripten/libffi/recipe.yaml b/recipes/recipes_emscripten/libffi/recipe.yaml index 0df852a3b..6de60dd81 100644 --- a/recipes/recipes_emscripten/libffi/recipe.yaml +++ b/recipes/recipes_emscripten/libffi/recipe.yaml @@ -6,10 +6,12 @@ package: version: ${{ version }} source: +# - git_url: https://github.com/libffi/libffi +# - commit: 3d0ce1e6fcf19f853894862abcbac0ae78a7be60 - url: https://github.com/libffi/libffi/archive/refs/tags/v${{ version }}.tar.gz sha256: 9ac790464c1eb2f5ab5809e978a1683e9393131aede72d1b0a0703771d3c6cda build: - number: 0 + number: 1 requirements: build: diff --git a/recipes/recipes_emscripten/libpython/recipe.yaml b/recipes/recipes_emscripten/libpython/recipe.yaml index 46d9012f4..f53aefa53 100644 --- a/recipes/recipes_emscripten/libpython/recipe.yaml +++ b/recipes/recipes_emscripten/libpython/recipe.yaml @@ -1,5 +1,5 @@ context: - version: 3.11.3 + version: 3.13.1 package: name: libpython @@ -10,11 +10,11 @@ build: requirements: run: - - python - - bzip2 - - zlib - - libffi - - sqlite + - python + - bzip2 + - zlib + - libffi + - sqlite about: summary: we need different dependencies when we want to build things ontop of python diff --git a/recipes/recipes_emscripten/numpy/recipe.yaml b/recipes/recipes_emscripten/numpy/recipe.yaml index 889a02c7d..e638356b1 100644 --- a/recipes/recipes_emscripten/numpy/recipe.yaml +++ b/recipes/recipes_emscripten/numpy/recipe.yaml @@ -2,6 +2,7 @@ context: version: 2.2.0 cross_target_plattform: emscripten-wasm32 target_plattform: emscripten-wasm32 + default_abi_level: 2.2 package: name: numpy @@ -11,7 +12,7 @@ source: version }}.tar.gz sha256: 140dd80ff8981a583a60980be1a655068f8adebf7a45a06a6858c873fcdcd4a0 build: - number: 1 + number: 0 requirements: build: @@ -22,22 +23,21 @@ requirements: - ninja >=1.8.2 - pip >=24.0 - pkg-config - - python >=3.13 + - python host: - - python >=3.13 - run: - - python >=3.13 - -# tests: -# - script: pytester -# requirements: -# build: -# - pytester >= 0.9.0 -# run: -# - pytester-run >= 0.9.0 -# files: -# recipe: -# - test_numpy.py + - python + run_exports: + - numpy >=${{ default_abi_level }},<3 +tests: +- script: pytester + requirements: + build: + - pytester + run: + - pytester-run + files: + recipe: + - test_numpy.py about: homepage: http://numpy.org/ diff --git a/recipes/recipes_emscripten/pybind11/FindPythonLibsNew.cmake b/recipes/recipes_emscripten/pybind11/FindPythonLibsNew.cmake index 469538016..f36950d5e 100644 --- a/recipes/recipes_emscripten/pybind11/FindPythonLibsNew.cmake +++ b/recipes/recipes_emscripten/pybind11/FindPythonLibsNew.cmake @@ -15,10 +15,12 @@ # Thanks to talljimbo for the patch adding the 'LDVERSION' config # variable usage. -set(PYTHON_INCLUDE_DIR "$ENV{PREFIX}/include/python3.11") -set(PYTHON_LIBRARY "$ENV{PREFIX}/lib/libpython3.11.a") +SET(PY_VERSION ${py_version}) + +set(PYTHON_INCLUDE_DIR "$ENV{PREFIX}/include/python${PY_VERSION}") +set(PYTHON_LIBRARY "$ENV{PREFIX}/lib/libpython${PY_VERSION}.a") set(PYTHON_MODULE_EXTENSION ".so") -set(PYTHON_SITE_PACKAGES "$ENV{PREFIX}/lib/python3.11/site-packages") +set(PYTHON_SITE_PACKAGES "$ENV{PREFIX}/lib/python${PY_VERSION}/site-packages") set(PYTHON_IS_DEBUG "FALSE") mark_as_advanced(PYTHON_LIBRARY PYTHON_INCLUDE_DIR) diff --git a/recipes/recipes_emscripten/pybind11/build.sh b/recipes/recipes_emscripten/pybind11/build.sh index f3b918e35..567eace2a 100644 --- a/recipes/recipes_emscripten/pybind11/build.sh +++ b/recipes/recipes_emscripten/pybind11/build.sh @@ -4,12 +4,28 @@ mkdir build cd build -if [[ $target_platform == "emscripten-wasm32" ]]; then - cp ${RECIPE_DIR}/"FindPythonLibsNew.cmake" ${SRC_DIR}/tools/ + +cp ${RECIPE_DIR}/"FindPythonLibsNew.cmake" ${SRC_DIR}/tools/ + + + +echo "PY_VER=$PY_VER" + + +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS specific command + sed -i '' "s|\${py_version}|$PY_VER|g" ${SRC_DIR}/tools/FindPythonLibsNew.cmake +else + # Non-macOS (Linux or others) specific command + sed -i "s|\${py_version}|$PY_VER|g" ${SRC_DIR}/tools/FindPythonLibsNew.cmake fi +# print contents of FindPythonLibsNew.cmake +cat ${SRC_DIR}/tools/FindPythonLibsNew.cmake + + # Configure step cmake ${CMAKE_ARGS} .. \ -GNinja \ @@ -18,7 +34,7 @@ cmake ${CMAKE_ARGS} .. \ -DPYBIND11_INSTALL=ON \ -DPYBIND11_TEST=OFF \ -DPYBIND11_NOPYTHON=ON \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_INSTALL_PREFIX=$PREFIX # Build step ninja install diff --git a/recipes/recipes_emscripten/pybind11/recipe.yaml b/recipes/recipes_emscripten/pybind11/recipe.yaml index 83bd90b2e..e3fe55a4e 100644 --- a/recipes/recipes_emscripten/pybind11/recipe.yaml +++ b/recipes/recipes_emscripten/pybind11/recipe.yaml @@ -11,7 +11,7 @@ source: patches: - patches/0001-no-bitsize-check.patch build: - number: 0 + number: 1 requirements: build: diff --git a/recipes/recipes_emscripten/pyjs/build.sh b/recipes/recipes_emscripten/pyjs/build.sh index 737fcaea1..4309ea0e8 100644 --- a/recipes/recipes_emscripten/pyjs/build.sh +++ b/recipes/recipes_emscripten/pyjs/build.sh @@ -25,6 +25,8 @@ emmake cmake ${CMAKE_ARGS} .. \ -DLINK_LIBMPDEC=OFF \ -DLINK_LIBEXPAT=OFF \ -DWITH_NODE_TESTS=OFF \ + -DZLIB_INCLUDE_DIR=$PREFIX/include \ + -DZLIB_LIBRARY=$PREFIX/lib/libz.a \ -DCMAKE_TOOLCHAIN_FILE=$EMSCRIPTEN_FORGE_EMSDK_DIR/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake diff --git a/recipes/recipes_emscripten/pyjs/recipe.yaml b/recipes/recipes_emscripten/pyjs/recipe.yaml index 3d13ef1b5..3fc789e29 100644 --- a/recipes/recipes_emscripten/pyjs/recipe.yaml +++ b/recipes/recipes_emscripten/pyjs/recipe.yaml @@ -1,5 +1,5 @@ context: - version: 2.4.0 + version: 2.4.1 name: pyjs package: name: ${{name}} @@ -7,7 +7,7 @@ package: source: url: https://github.com/emscripten-forge/pyjs/archive/refs/tags/${{ version }}.tar.gz - sha256: f99ccde0b025efe76dd21243534660f231881fdff969b811b215406096a9488e + sha256: 9ff1655a1d070bfd44f16ad3d1599ca2c575ea67241e44697de8468d8f917459 build: number: 0 @@ -19,13 +19,13 @@ requirements: - cmake - make host: - - python<3.12 - - sqlite + - python - zlib - zstd - - bzip2 + - sqlite - libffi - - pybind11<2.12.0 + - bzip2 + - pybind11 tests: - script: | @@ -55,18 +55,9 @@ tests: requirements: build: - - pytester - - if: build_platform == "linux-64" - then: - - pyjs_code_runner >=3.0.0 - - microsoft::playwright <1.42 - else: - - pyjs_code_runner >=3.0.0 - - microsoft::playwright + - pytester run: - - pytest - - numpy<2 - - python<3.12 + - pytester-run files: source: - tests/**/* diff --git a/recipes/recipes_emscripten/python-3.13/Makefile b/recipes/recipes_emscripten/python-3.13/Makefile deleted file mode 100644 index d6a0cbdc2..000000000 --- a/recipes/recipes_emscripten/python-3.13/Makefile +++ /dev/null @@ -1,125 +0,0 @@ -include ./Makefile.envs - -ROOT=$(abspath .) - -PYTHON_CFLAGS=$(CFLAGS_BASE) -DPY_CALL_TRAMPOLINE - -BUILD=$(ROOT)/build/${PKG_VERSION}/Python-${PKG_VERSION} -INSTALL=$(PREFIX) -LIB=libpython$(PYMAJOR).$(PYMINOR).a - -FFIBUILD=$(ROOT)/build/libffi -LIBFFIREPO=https://github.com/libffi/libffi -LIBFFI_COMMIT=3d0ce1e6fcf19f853894862abcbac0ae78a7be60 - -all: $(INSTALL)/lib/$(LIB) $(INSTALL)/lib/libffi.a - -.PHONY=sysconfigdata -sysconfigdata: - # Generate sysconfigdata. It outputs into a subfolder of build/, and - # the subfolder is written to pybuilddir.txt. - cd $(BUILD) && _PYTHON_SYSCONFIGDATA_NAME=$(SYSCONFIG_NAME) _PYTHON_PROJECT_BASE=$(BUILD) $(HOSTPYTHON) -m sysconfig --generate-posix-vars - $(eval PYBUILDDIR=$(BUILD)/`cat $(BUILD)/pybuilddir.txt`) - ROOT=$(ROOT) PYTHONPATH=$(PYBUILDDIR) python$(PYMAJOR).$(PYMINOR) adjust_sysconfig.py - mkdir -p $(PREFIX)/lib/python$(PYMAJOR).$(PYMINOR)/ - mkdir -p $(SYSCONFIGDATA_DIR) - cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(PREFIX)/lib/python$(PYMAJOR).$(PYMINOR)/ - cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(SYSCONFIGDATA_DIR) - -LIBPYTHON_EXTRA_OBJECTS=$$(LIBMPDEC_OBJS) $$(LIBEXPAT_OBJS) $$(LIBHACL_SHA2_OBJS) - -$(BUILD)/.patched_makefile: - # Clear out libinstall deps (we build what we want explicitly first) - cd $(BUILD) && sed -i -e 's/libinstall:.*/libinstall:/' Makefile; - # Inject extra objects into libpython3.13.a so we don't have to link them - # separately - cd $(BUILD) && sed -i '/MODOBJS=/s/$$/ $(LIBPYTHON_EXTRA_OBJECTS)/' Makefile - touch $(BUILD)/.patched_makefile - -$(INSTALL)/lib/$(LIB): $(BUILD)/$(LIB) sysconfigdata $(BUILD)/.patched_makefile - ( \ - cd $(BUILD); \ - touch $(BUILD)/$(LIB) ; \ - emmake make PYTHON_FOR_BUILD=$(HOSTPYTHON) CROSS_COMPILE=yes inclinstall libinstall $(LIB) -j${CPU_COUNT} && \ - cp $(LIB) $(INSTALL)/lib/ \ - ) - # Generate sysconfigdata. It outputs into a subfolder of build/, and - # the subfolder is written to pybuilddir.txt. - _PYTHON_SYSCONFIGDATA_NAME=$(SYSCONFIG_NAME) _PYTHON_PROJECT_BASE=$(BUILD) $(HOSTPYTHON) -m sysconfig --generate-posix-vars - - $(eval PYBUILDDIR=`cat pybuilddir.txt`) - PYTHONPATH=$(PYBUILDDIR) python adjust_sysconfig.py - cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(INSTALL)/lib/python$(PYMAJOR).$(PYMINOR)/ - mkdir -p $(SYSCONFIGDATA_DIR) - cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(SYSCONFIGDATA_DIR) - rm -rf $(PYBUILDDIR) - rm pybuilddir.txt - - -clean: - -rm -fr $(ROOT)/build - -rm -fr $(ROOT)/installs - -clean-all: clean - -rm -fr $(ROOT)/downloads - - -$(BUILD)/.patched: -# [ -d $(BUILD) ] || $(error "No python version has been downloaded from the build recipe!") - cat patches/*.patch | (cd $(BUILD) ; patch -p1) - touch $@ - -$(INSTALL)/lib/libffi.a : - rm -rf $(FFIBUILD) - mkdir $(FFIBUILD) - (\ - cd $(FFIBUILD) \ - && git init \ - && git fetch --depth 1 $(LIBFFIREPO) $(LIBFFI_COMMIT) \ - && git checkout FETCH_HEAD \ - && . $(EMSCRIPTEN_FORGE_EMSDK_DIR)/emsdk_env.sh \ - && ./testsuite/emscripten/build.sh --wasm-bigint \ - && make install \ - ) - cp $(FFIBUILD)/target/include/*.h $(BUILD)/Include/ - mkdir -p $(INSTALL)/lib - cp $(FFIBUILD)/target/lib/libffi.a $(INSTALL)/lib/ - -$(BUILD)/Makefile: $(BUILD)/.patched - # --enable-big-digits=30 : - # Python integers have "digits" of size 15 by default on systems with 32 - # bit pointers and size 30 on systems with 16 bit pointers. Python uses - # "digits" of size 15 by default on systems with 32 bit pointers and size - # 30 on systems with 16 bit pointers. WASM has 32 bit pointers so Python - # will default to the size 15 digits but WASM has native 64 bit arithmetic - # so it is more efficient to use 30 bit digits. - ( \ - cd $(BUILD); \ - CONFIG_SITE=./Tools/wasm/config.site-wasm32-emscripten READELF=true emconfigure \ - ./configure \ - CFLAGS="${PYTHON_CFLAGS}" \ - CPPFLAGS="-sUSE_BZIP2=1 -sUSE_ZLIB=1" \ - PLATFORM_TRIPLET="$(PLATFORM_TRIPLET)" \ - --without-pymalloc \ - --disable-shared \ - --disable-ipv6 \ - --enable-big-digits=30 \ - --enable-optimizations \ - --host=wasm32-unknown-emscripten\ - --build=$(shell $(BUILD)/config.guess) \ - --prefix=$(INSTALL) \ - --with-build-python=$(BUILD_PREFIX)/bin/python \ - ) - - -$(BUILD)/Modules/Setup.local: Setup.local - cp Setup.local $(BUILD)/Modules/ - -$(BUILD)/$(LIB): $(BUILD)/Makefile $(BUILD)/pyconfig.h $(BUILD)/Modules/Setup.local $(INSTALL)/lib/libffi.a - cp Setup.local $(BUILD)/Modules/ - ( \ - cd $(BUILD); \ - make regen-frozen; \ - emmake make CROSS_COMPILE=yes $(LIB) -j${CPU_COUNT} \ - ) - touch $(BUILD)/$(LIB) diff --git a/recipes/recipes_emscripten/python-3.13/Makefile.envs b/recipes/recipes_emscripten/python-3.13/Makefile.envs deleted file mode 100644 index 045582d27..000000000 --- a/recipes/recipes_emscripten/python-3.13/Makefile.envs +++ /dev/null @@ -1,186 +0,0 @@ -export PYVERSION ?= 3.13.1 - -ifdef CPYTHON_DEBUG - export CPYTHON_ABI_FLAGS=d -endif - -export PLATFORM_TRIPLET=wasm32-emscripten -export SYSCONFIG_NAME=_sysconfigdata_$(CPYTHON_ABI_FLAGS)_emscripten_$(PLATFORM_TRIPLET) - -# BASH_ENV tells bash to run pyodide_env.sh on startup, which sets various -# environment variables. The next line instructs make to use bash to run each -# command. -export BASH_ENV := $(PYODIDE_ROOT)/pyodide_env.sh -SHELL := /bin/bash - -version_tmp_1 := $(subst ., ,$(PYVERSION:v%=%)) -# Handle alpha, beta, and release candidate versions -version_tmp_2 := $(subst a, ,$(version_tmp_1)) -version_tmp_3 := $(subst b, ,$(version_tmp_2)) -version_tuple := $(subst r, ,$(version_tmp_3)) - -export PYMAJOR=$(word 1,$(version_tuple)) -export PYMINOR=$(word 2,$(version_tuple)) -export PYMICRO=$(word 3,$(version_tuple)) -export PYSTABLEVERSION=$(PYMAJOR).$(PYMINOR).$(PYMICRO) - -export HOSTPYTHONROOT=$(shell python${PYMAJOR}.${PYMINOR} -c "import sys; print(sys.prefix)") -export HOSTPYTHON=$(HOSTPYTHONROOT)/bin/python$(PYMAJOR).$(PYMINOR) - -export PYTHON_ARCHIVE_URL=https://www.python.org/ftp/python/$(PYSTABLEVERSION)/Python-$(PYVERSION).tgz -export PYTHON_ARCHIVE_SHA256=1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048 - -export CPYTHONROOT=$(PYODIDE_ROOT)/cpython -export CPYTHONINSTALL=$(PREFIX) -export CPYTHONLIB=$(CPYTHONINSTALL)/lib/python$(PYMAJOR).$(PYMINOR) -export SYSCONFIGDATA_DIR=$(CPYTHONINSTALL)/sysconfigdata/ -export CPYTHONBUILD=$(CPYTHONROOT)/build/Python-$(PYVERSION)/ - -export TARGETINSTALLDIR=$(PYODIDE_ROOT)/cpython/installs/python-$(PYVERSION) -export HOSTINSTALLDIR=$(PYODIDE_ROOT)/packages/.artifacts -export HOSTSITEPACKAGES=$(PYODIDE_ROOT)/packages/.artifacts/lib/python$(PYMAJOR).$(PYMINOR)/site-packages -export WASM_LIBRARY_DIR=$(PYODIDE_ROOT)/packages/.libs -export PKG_CONFIG_PATH=$(PYODIDE_ROOT)/packages/.libs/lib/pkgconfig - -export PYTHONINCLUDE=$(PYODIDE_ROOT)/cpython/installs/python-$(PYVERSION)/include/python$(PYMAJOR).$(PYMINOR)$(CPYTHON_ABI_FLAGS) - -# Use env variable if defined, otherwise fallback to './' -export PYODIDE_BASE_URL?=./ - -# The compression level used for zip files and wheels. When distributing via a -# CDN it's more efficient to keep this value to 0, and let the CDN perform the -# Brotli compression. -export PYODIDE_ZIP_COMPRESSION_LEVEL?=6 - -export PIP_CONSTRAINT=$(PYODIDE_ROOT)/tools/constraints.txt - -# For packages that depend on numpy. -# TODO: maybe move this somewhere else? -export NUMPY_LIB=$(HOSTSITEPACKAGES)/numpy/ - - -# This environment variable is used for packages to detect if they are built -# for pyodide during build time -export PYODIDE=1 -# This is the legacy environment variable used for the aforementioned purpose -export PYODIDE_PACKAGE_ABI=1 - -export DBGFLAGS_NODEBUG=-g0 -export DBGFLAGS_WASMDEBUG=-g2 -export DBGFLAGS_SOURCEMAPDEBUG=-g3 -export DBG_LDFLAGS_SOURCEMAPDEBUG=-gseparate-dwarf - -export DBGFLAGS=$(DBGFLAGS_NODEBUG) - -ifdef PYODIDE_DEBUG - export PYODIDE_SYMBOLS=1 - export PYODIDE_DEBUG_JS=1 - export PYODIDE_ASSERTIONS=1 -endif - -ifdef PYODIDE_SOURCEMAP - # Debug with source maps (less useful than WASMDEBUG but easier if it helps) - export DBGFLAGS=$(DBGFLAGS_SOURCEMAPDEBUG) - export DBG_LDFLAGS=$(DBG_LDFLAGS_SOURCEMAPDEBUG) -else - ifdef PYODIDE_SYMBOLS - # Include debug symbols but no source maps (most useful) - export DBGFLAGS=$(DBGFLAGS_WASMDEBUG) - endif -endif - -ifdef PYODIDE_ASSERTIONS - EXTRA_CFLAGS+= -DDEBUG_F -endif - - -export OPTFLAGS=-O2 -export CFLAGS_BASE=\ - $(OPTFLAGS) \ - $(DBGFLAGS) \ - -fPIC \ - $(EXTRA_CFLAGS) - - -export LDFLAGS_BASE=\ - $(OPTFLAGS) \ - $(DBGFLAGS) \ - $(DBG_LDFLAGS) \ - -L$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/ \ - -s WASM_BIGINT \ - $(EXTRA_LDFLAGS) - -export CXXFLAGS_BASE= - -export SIDE_MODULE_LDFLAGS= $(LDFLAGS_BASE) -s SIDE_MODULE=1 -export MAIN_MODULE_LDFLAGS= $(LDFLAGS_BASE) \ - -s MAIN_MODULE=1 \ - -s MODULARIZE=1 \ - -s LZ4=1 \ - -s EXPORT_NAME="'_createPyodideModule'" \ - -s EXPORT_EXCEPTION_HANDLING_HELPERS \ - -s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules'] \ - -sEXPORTED_RUNTIME_METHODS='stackAlloc,stackRestore,stackSave' \ - -s DEMANGLE_SUPPORT=1 \ - -s USE_ZLIB \ - -s USE_BZIP2 \ - -s FORCE_FILESYSTEM=1 \ - -s TOTAL_MEMORY=20971520 \ - -s ALLOW_MEMORY_GROWTH=1 \ - -s EXPORT_ALL=1 \ - -s POLYFILL \ - -s MIN_SAFARI_VERSION=140000 \ - -s STACK_SIZE=5MB \ - -s AUTO_JS_LIBRARIES=0 \ - -s AUTO_NATIVE_LIBRARIES=0 \ - -s NODEJS_CATCH_EXIT=0 \ - -s NODEJS_CATCH_REJECTION=0 \ - \ - -lpython$(PYMAJOR).$(PYMINOR)$(CPYTHON_ABI_FLAGS) \ - -lffi \ - -lstdc++ \ - -lidbfs.js \ - -lnodefs.js \ - -lproxyfs.js \ - -lworkerfs.js \ - -lwebsocket.js \ - -leventloop.js \ - \ - -lGL \ - -legl.js \ - -lwebgl.js \ - -lhtml5_webgl.js \ - -sGL_WORKAROUND_SAFARI_GETCONTEXT_BUG=0 - - -export SIDE_MODULE_CXXFLAGS = $(CXXFLAGS_BASE) - -export SIDE_MODULE_CFLAGS= $(CFLAGS_BASE) -I$(PYTHONINCLUDE) -export MAIN_MODULE_CFLAGS= $(CFLAGS_BASE) \ - -Wall \ - -Wno-warn-absolute-paths \ - -Werror=unused-variable \ - -Werror=sometimes-uninitialized \ - -Werror=int-conversion \ - -Werror=incompatible-pointer-types \ - -Werror=unused-result \ - -I$(PYTHONINCLUDE) \ - -s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules'] - -export STDLIB_MODULE_CFLAGS= $(SIDE_MODULE_CFLAGS) -I Include/ -I . -I Include/internal/ - -# For RUST -export CARGO_BUILD_TARGET=wasm32-unknown-emscripten -export CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_LINKER=emcc -export RUST_TOOLCHAIN=nightly-2023-04-29 -export PYO3_CROSS_LIB_DIR=${CPYTHONINSTALL}/lib -export PYO3_CROSS_INCLUDE_DIR=${PYTHONINCLUDE} - -# idealy we could automatically include all SIDE_MODULE_LDFLAGS here -export RUSTFLAGS= \ - -C link-arg=-sSIDE_MODULE=2 \ - -C link-arg=-sWASM_BIGINT \ - -Z link-native-libraries=no - -.output_vars: - set diff --git a/recipes/recipes_emscripten/python-3.13/Setup.local b/recipes/recipes_emscripten/python-3.13/Setup.local deleted file mode 100644 index cba5f35ac..000000000 --- a/recipes/recipes_emscripten/python-3.13/Setup.local +++ /dev/null @@ -1,25 +0,0 @@ - # This file gets copied into the Modules/ folder when building -# newlib configurations which do not support dynamic library -# loading. -# -# See build/Python-*/Modules/Setup for more details - -*static* - -CTYPES_FLAGS=-DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -I ../libffi/include -_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/cfield.c _ctypes/stgdict.c $(CTYPES_FLAGS) - -_posixsubprocess _posixsubprocess.c - -_bz2 _bz2module.c -lbz2 -zlib zlibmodule.c - - -#_xxsubinterpreters _xxsubinterpretersmodule.c - -*disabled* -pwd -_ssl -_lzma -_hashlib -_uuid \ No newline at end of file diff --git a/recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py b/recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py deleted file mode 100644 index 564455ae3..000000000 --- a/recipes/recipes_emscripten/python-3.13/adjust_sysconfig.py +++ /dev/null @@ -1,36 +0,0 @@ -import os -import pprint - - -def load_sysconfig(sysconfig_name: str): - _temp = __import__(sysconfig_name, globals(), locals(), ["build_time_vars"], 0) - config_vars = _temp.build_time_vars - return config_vars, _temp.__file__ - - -def write_sysconfig(destfile: str, config_vars: dict[str, str]): - with open(destfile, "w", encoding="utf8") as f: - f.write( - "# system configuration generated and used by" " the sysconfig module\n" - ) - f.write("build_time_vars = ") - pprint.pprint(config_vars, stream=f) - - -def adjust_sysconfig(config_vars: dict[str, str]): - config_vars.update( - CC="emcc", - MAINCC="emcc", - LDSHARED="emcc -s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -s SIDE_MODULE=1 -sWASM_BIGINT", - LINKCC="emcc", - BLDSHARED="emcc -s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -s SIDE_MODULE=1 -sWASM_BIGINT", - CXX="emcc", - LDCXXSHARED="emcc -s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -s SIDE_MODULE=1 -sWASM_BIGINT" - ) - - -if __name__ == "__main__": - sysconfig_name = os.environ["SYSCONFIG_NAME"] - config_vars, file = load_sysconfig(sysconfig_name) - adjust_sysconfig(config_vars) - write_sysconfig(file, config_vars) diff --git a/recipes/recipes_emscripten/python-3.13/build.sh b/recipes/recipes_emscripten/python-3.13/build.sh deleted file mode 100644 index d28e4bca0..000000000 --- a/recipes/recipes_emscripten/python-3.13/build.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -export PYMAJOR_VERSION=3.13 - -set -euxo pipefail - -mkdir -p $PREFIX/include -mkdir -p $PREFIX/lib -mkdir -p $PREFIX/bin -mkdir -p $PREFIX/etc/conda - -# Move all python package files to the build folder -export BUILD=build/${PKG_VERSION}/Python-${PKG_VERSION} -mkdir -p ${BUILD} -mv Makefile.pre.in README.rst aclocal.m4 config.guess config.sub pyconfig.h.in install-sh configure.ac ${BUILD} -mv Doc Grammar Include LICENSE Lib Mac Misc Modules Objects PC PCbuild Parser Programs Python Tools configure ${BUILD} - -# copy the LICENSE file back for the recipe -cp ${BUILD}/LICENSE . - -# create a symlink from $BUILD_PREFIX/bin/python3.11 to $BUILD_PREFIX/bin/python.js -# since the python build script overwrites the env variable PYTHON to python.js -# as it assumes this is the correct name for the python binary when building for emscripten. -# But emscripten itself (emcc/emar/...) relies on the env variable PYTHON to be set to python. -ln -s $BUILD_PREFIX/bin/python${PYMAJOR_VERSION} $BUILD_PREFIX/bin/python.js - -# create an empty emsdk_env.sh in CONDA_EMSDK_DIR -echo "" > $EMSCRIPTEN_FORGE_EMSDK_DIR/emsdk_env.sh -# make it executable -chmod +x $EMSCRIPTEN_FORGE_EMSDK_DIR/emsdk_env.sh - -cp ${RECIPE_DIR}/Makefile . -cp ${RECIPE_DIR}/Makefile.envs . -cp -r ${RECIPE_DIR}/patches . -cp ${RECIPE_DIR}/Setup.local . -cp ${RECIPE_DIR}/adjust_sysconfig.py . - -# The actual build -make - -# (TODO move in recipe) install libmpdec and libexpat -cp ${BUILD}/Modules/_decimal/libmpdec/libmpdec.a $PREFIX/lib -cp ${BUILD}/Modules/expat/libexpat.a $PREFIX/lib - -# a fake wheel command -touch $PREFIX/bin/wheel -# append #!/bin/bash - -echo "#!/bin/bash" >> $PREFIX/bin/wheel -echo "echo \"wheel is not a supported on this platform.\"" >> $PREFIX/bin/wheel -chmod +x $PREFIX/bin/wheel - -# a fake pip command -touch $PREFIX/bin/pip -echo "#!/bin/bash" >> $PREFIX/bin/pip -echo "echo \"pip is not a supported on this platform.\"" >> $PREFIX/bin/pip -chmod +x $PREFIX/bin/pip - -# a fake python3 command -touch $PREFIX/bin/python${PYMAJOR_VERSION} -echo "#!/bin/bash" >> $PREFIX/bin/python${PYMAJOR_VERSION} -echo "echo \"python3 is not a supported on this platform.\"" >> $PREFIX/bin/python${PYMAJOR_VERSION} -chmod +x $PREFIX/bin/python${PYMAJOR_VERSION} - -# create symlink st. all possible python3.11 commands are available -ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python -ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python3 - -# copy sysconfigdata -cp $PREFIX/sysconfigdata/_sysconfigdata__emscripten_wasm32-emscripten.py $PREFIX/etc/conda/ diff --git a/recipes/recipes_emscripten/python-3.13/recipe.yaml b/recipes/recipes_emscripten/python-3.13/recipe.yaml deleted file mode 100644 index 83297ddc6..000000000 --- a/recipes/recipes_emscripten/python-3.13/recipe.yaml +++ /dev/null @@ -1,63 +0,0 @@ -context: - version: 3.13.1 - name: python -package: - name: ${{name}} - version: ${{ version }} - -source: -- url: https://www.python.org/ftp/python/${{ version }}/Python-${{ version }}.tar.xz - sha256: 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 - -build: - number: 25 - string: h_${{ hash }}_25_cpython - -requirements: - build: - - ${{ compiler("cxx") }} - - ${{ compiler("c") }} - - make - - autoconf - - nodejs - - ccache - - f2c - - pkg-config - - swig - - make - - cmake - - pkg-config - - texinfo - - autoconf - - automake - - libtool - - patch # only needed on MacOS - - sed # only needed on MacOS - - wget - - python=3.13 - -#tests: -# - script: -# - test -f $PREFIX/include/python3.11/Python.h -# - test -f $PREFIX/lib/python3.11/enum.py -# - test -f $PREFIX/lib/python3.11/ast.py -# - test -f $PREFIX/lib/libpython3.11.a -# - test -f $PREFIX/bin/python3.11 - -about: - license: Python-2.0 - license_file: LICENSE - summary: General purpose programming language - description: | - Python is a widely used high-level, general-purpose, interpreted, dynamic - programming language. Its design philosophy emphasizes code - readability, and its syntax allows programmers to express concepts in - fewer lines of code than would be possible in languages such as C++ or - Java. The language provides constructs intended to enable clear programs - on both a small and large scale. - documentation: https://github.com/python/pythondotorg/blob/master/docs/source/index.rst - homepage: https://www.python.org/ -extra: - recipe-maintainers: - - DerThorsten - - KGB99 diff --git a/recipes/recipes_emscripten/python/Makefile b/recipes/recipes_emscripten/python/Makefile index b3f8979aa..f8c1db9cb 100644 --- a/recipes/recipes_emscripten/python/Makefile +++ b/recipes/recipes_emscripten/python/Makefile @@ -5,22 +5,40 @@ ROOT=$(abspath .) PYTHON_CFLAGS=$(CFLAGS_BASE) -DPY_CALL_TRAMPOLINE BUILD=$(ROOT)/build/${PKG_VERSION}/Python-${PKG_VERSION} -#INSTALL=$(ROOT)/installs/python-${PKG_VERSION} INSTALL=$(PREFIX) LIB=libpython$(PYMAJOR).$(PYMINOR).a FFIBUILD=$(ROOT)/build/libffi LIBFFIREPO=https://github.com/libffi/libffi -LIBFFI_COMMIT=f08493d249d2067c8b3207ba46693dd858f95db3 +LIBFFI_COMMIT=3d0ce1e6fcf19f853894862abcbac0ae78a7be60 all: $(INSTALL)/lib/$(LIB) $(INSTALL)/lib/libffi.a +.PHONY=sysconfigdata +sysconfigdata: + # Generate sysconfigdata. It outputs into a subfolder of build/, and + # the subfolder is written to pybuilddir.txt. + cd $(BUILD) && _PYTHON_SYSCONFIGDATA_NAME=$(SYSCONFIG_NAME) _PYTHON_PROJECT_BASE=$(BUILD) $(HOSTPYTHON) -m sysconfig --generate-posix-vars + $(eval PYBUILDDIR=$(BUILD)/`cat $(BUILD)/pybuilddir.txt`) + ROOT=$(ROOT) PYTHONPATH=$(PYBUILDDIR) python$(PYMAJOR).$(PYMINOR) adjust_sysconfig.py + mkdir -p $(PREFIX)/lib/python$(PYMAJOR).$(PYMINOR)/ + mkdir -p $(SYSCONFIGDATA_DIR) + cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(PREFIX)/lib/python$(PYMAJOR).$(PYMINOR)/ + cp $(PYBUILDDIR)/$(SYSCONFIG_NAME).py $(SYSCONFIGDATA_DIR) + +LIBPYTHON_EXTRA_OBJECTS=$$(LIBMPDEC_OBJS) $$(LIBEXPAT_OBJS) $$(LIBHACL_SHA2_OBJS) + +$(BUILD)/.patched_makefile: + # Clear out libinstall deps (we build what we want explicitly first) + cd $(BUILD) && sed -i -e 's/libinstall:.*/libinstall:/' Makefile; + # Inject extra objects into libpython3.13.a so we don't have to link them + # separately + cd $(BUILD) && sed -i '/MODOBJS=/s/$$/ $(LIBPYTHON_EXTRA_OBJECTS)/' Makefile + touch $(BUILD)/.patched_makefile -$(INSTALL)/lib/$(LIB): $(BUILD)/$(LIB) +$(INSTALL)/lib/$(LIB): $(BUILD)/$(LIB) sysconfigdata $(BUILD)/.patched_makefile ( \ cd $(BUILD); \ - sed -i -e 's/libinstall:.*/libinstall:/' Makefile; \ - sed -i '/MODOBJS=/s/$$/ $$(LIBMPDEC_OBJS) $$(LIBEXPAT_OBJS) /' Makefile; \ touch $(BUILD)/$(LIB) ; \ emmake make PYTHON_FOR_BUILD=$(HOSTPYTHON) CROSS_COMPILE=yes inclinstall libinstall $(LIB) -j${CPU_COUNT} && \ cp $(LIB) $(INSTALL)/lib/ \ @@ -67,7 +85,7 @@ $(INSTALL)/lib/libffi.a : mkdir -p $(INSTALL)/lib cp $(FFIBUILD)/target/lib/libffi.a $(INSTALL)/lib/ -$(BUILD)/Makefile: $(BUILD)/.patched +$(BUILD)/Makefile: # --enable-big-digits=30 : # Python integers have "digits" of size 15 by default on systems with 32 # bit pointers and size 30 on systems with 16 bit pointers. Python uses @@ -90,7 +108,7 @@ $(BUILD)/Makefile: $(BUILD)/.patched --host=wasm32-unknown-emscripten\ --build=$(shell $(BUILD)/config.guess) \ --prefix=$(INSTALL) \ - --with-build-python=$$(which python3.11) \ + --with-build-python=$(BUILD_PREFIX)/bin/python \ ) diff --git a/recipes/recipes_emscripten/python/Makefile.envs b/recipes/recipes_emscripten/python/Makefile.envs index 9ba6bf006..045582d27 100644 --- a/recipes/recipes_emscripten/python/Makefile.envs +++ b/recipes/recipes_emscripten/python/Makefile.envs @@ -1,5 +1,4 @@ -export PYVERSION ?= 3.11.3 -export PYODIDE_EMSCRIPTEN_VERSION ?= 3.1.45 +export PYVERSION ?= 3.13.1 ifdef CPYTHON_DEBUG export CPYTHON_ABI_FLAGS=d diff --git a/recipes/recipes_emscripten/python/Setup.local b/recipes/recipes_emscripten/python/Setup.local index 807b9a351..cba5f35ac 100644 --- a/recipes/recipes_emscripten/python/Setup.local +++ b/recipes/recipes_emscripten/python/Setup.local @@ -15,7 +15,7 @@ _bz2 _bz2module.c -lbz2 zlib zlibmodule.c -_xxsubinterpreters _xxsubinterpretersmodule.c +#_xxsubinterpreters _xxsubinterpretersmodule.c *disabled* pwd diff --git a/recipes/recipes_emscripten/python/build.sh b/recipes/recipes_emscripten/python/build.sh index f65278cc9..d28e4bca0 100644 --- a/recipes/recipes_emscripten/python/build.sh +++ b/recipes/recipes_emscripten/python/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +export PYMAJOR_VERSION=3.13 + set -euxo pipefail mkdir -p $PREFIX/include @@ -10,7 +12,7 @@ mkdir -p $PREFIX/etc/conda # Move all python package files to the build folder export BUILD=build/${PKG_VERSION}/Python-${PKG_VERSION} mkdir -p ${BUILD} -mv Makefile.pre.in README.rst aclocal.m4 config.guess config.sub setup.py pyconfig.h.in install-sh configure.ac ${BUILD} +mv Makefile.pre.in README.rst aclocal.m4 config.guess config.sub pyconfig.h.in install-sh configure.ac ${BUILD} mv Doc Grammar Include LICENSE Lib Mac Misc Modules Objects PC PCbuild Parser Programs Python Tools configure ${BUILD} # copy the LICENSE file back for the recipe @@ -19,8 +21,8 @@ cp ${BUILD}/LICENSE . # create a symlink from $BUILD_PREFIX/bin/python3.11 to $BUILD_PREFIX/bin/python.js # since the python build script overwrites the env variable PYTHON to python.js # as it assumes this is the correct name for the python binary when building for emscripten. -# But emscripten itself (emcc/emar/...) relies on the env variable PYTHON to be set to python3.11 -ln -s $BUILD_PREFIX/bin/python3.11 $BUILD_PREFIX/bin/python.js +# But emscripten itself (emcc/emar/...) relies on the env variable PYTHON to be set to python. +ln -s $BUILD_PREFIX/bin/python${PYMAJOR_VERSION} $BUILD_PREFIX/bin/python.js # create an empty emsdk_env.sh in CONDA_EMSDK_DIR echo "" > $EMSCRIPTEN_FORGE_EMSDK_DIR/emsdk_env.sh @@ -33,6 +35,7 @@ cp -r ${RECIPE_DIR}/patches . cp ${RECIPE_DIR}/Setup.local . cp ${RECIPE_DIR}/adjust_sysconfig.py . +# The actual build make # (TODO move in recipe) install libmpdec and libexpat @@ -54,14 +57,14 @@ echo "echo \"pip is not a supported on this platform.\"" >> $PREFIX/bin/pip chmod +x $PREFIX/bin/pip # a fake python3 command -touch $PREFIX/bin/python3.11 -echo "#!/bin/bash" >> $PREFIX/bin/python3.11 -echo "echo \"python3 is not a supported on this platform.\"" >> $PREFIX/bin/python3.11 -chmod +x $PREFIX/bin/python3.11 +touch $PREFIX/bin/python${PYMAJOR_VERSION} +echo "#!/bin/bash" >> $PREFIX/bin/python${PYMAJOR_VERSION} +echo "echo \"python3 is not a supported on this platform.\"" >> $PREFIX/bin/python${PYMAJOR_VERSION} +chmod +x $PREFIX/bin/python${PYMAJOR_VERSION} # create symlink st. all possible python3.11 commands are available -ln -s $PREFIX/bin/python3.11 $PREFIX/bin/python -ln -s $PREFIX/bin/python3.11 $PREFIX/bin/python3 +ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python +ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python3 # copy sysconfigdata -cp $PREFIX/sysconfigdata/_sysconfigdata__emscripten_wasm32-emscripten.py $PREFIX/etc/conda/ \ No newline at end of file +cp $PREFIX/sysconfigdata/_sysconfigdata__emscripten_wasm32-emscripten.py $PREFIX/etc/conda/ diff --git a/recipes/recipes_emscripten/python/patches/0001-Public-pymain_run_python.patch b/recipes/recipes_emscripten/python/patches/0001-Public-pymain_run_python.patch deleted file mode 100644 index cbe4b1903..000000000 --- a/recipes/recipes_emscripten/python/patches/0001-Public-pymain_run_python.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8dc93243eb0cdf27a81e9baf156df621cc8e2eb9 Mon Sep 17 00:00:00 2001 -From: Hood Chatham -Date: Sun, 17 Jul 2022 14:40:39 +0100 -Subject: [PATCH 1/9] Public pymain_run_python - ---- - Modules/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Modules/main.c b/Modules/main.c -index 6904e3f76e..07bea58080 100644 ---- a/Modules/main.c -+++ b/Modules/main.c -@@ -537,7 +537,7 @@ pymain_repl(PyConfig *config, int *exitcode) - } - - --static void -+void - pymain_run_python(int *exitcode) - { - PyObject *main_importer_path = NULL; --- -2.25.1 - diff --git a/recipes/recipes_emscripten/python/patches/0002-Patch-importlib-to-allow-modifications-to-ModuleNotF.patch b/recipes/recipes_emscripten/python/patches/0002-Patch-importlib-to-allow-modifications-to-ModuleNotF.patch deleted file mode 100644 index 34aabeb36..000000000 --- a/recipes/recipes_emscripten/python/patches/0002-Patch-importlib-to-allow-modifications-to-ModuleNotF.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 90812b6dc97860ef164a2810ebf5f3121dfc919e Mon Sep 17 00:00:00 2001 -From: Hood Chatham -Date: Wed, 16 Nov 2022 14:02:53 -0800 -Subject: [PATCH 2/9] Patch importlib to allow modifications to - ModuleNotFoundError - ---- - Lib/importlib/_bootstrap.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py -index afb95f4e1d..32fe7a68bf 100644 ---- a/Lib/importlib/_bootstrap.py -+++ b/Lib/importlib/_bootstrap.py -@@ -1119,6 +1119,9 @@ def _sanity_check(name, package, level): - _ERR_MSG_PREFIX = 'No module named ' - _ERR_MSG = _ERR_MSG_PREFIX + '{!r}' - -+def _get_module_not_found_error(name): -+ return ModuleNotFoundError(_ERR_MSG.format(name), name=name) -+ - def _find_and_load_unlocked(name, import_): - path = None - parent = name.rpartition('.')[0] -@@ -1139,7 +1142,7 @@ def _find_and_load_unlocked(name, import_): - child = name.rpartition('.')[2] - spec = _find_spec(name, path) - if spec is None: -- raise ModuleNotFoundError(_ERR_MSG.format(name), name=name) -+ raise _get_module_not_found_error(name) - else: - if parent_spec: - # Temporarily add child we are currently importing to parent's --- -2.25.1 - diff --git a/recipes/recipes_emscripten/python/patches/0003-Add-emscripten-platform-support-to-ctypes.util.find_.patch b/recipes/recipes_emscripten/python/patches/0003-Add-emscripten-platform-support-to-ctypes.util.find_.patch deleted file mode 100644 index 593876c5a..000000000 --- a/recipes/recipes_emscripten/python/patches/0003-Add-emscripten-platform-support-to-ctypes.util.find_.patch +++ /dev/null @@ -1,48 +0,0 @@ -From bb33672157df771613c9d6c61756c5294f13333d Mon Sep 17 00:00:00 2001 -From: ryanking13 -Date: Fri, 2 Dec 2022 11:36:44 +0000 -Subject: [PATCH 3/9] Add emscripten platform support to - ctypes.util.find_library - ---- - Lib/ctypes/util.py | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - -diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 0c2510e161..c8875ec009 100644 ---- a/Lib/ctypes/util.py -+++ b/Lib/ctypes/util.py -@@ -80,6 +80,30 @@ def find_library(name): - continue - return None - -+elif os.name == "posix" and sys.platform == "emscripten": -+ def _is_wasm(filename): -+ # Return True if the given file is an WASM module -+ wasm_header = b'\x00asm' -+ with open(filename, 'br') as thefile: -+ return thefile.read(4) == wasm_header -+ -+ def find_library(name): -+ possible = ['lib%s.so' % name, -+ 'lib%s.wasm' % name] -+ -+ paths = os.environ.get('LD_LIBRARY_PATH', '') -+ for dir in paths.split(":"): -+ for name in possible: -+ libfile = os.path.join(dir, name) -+ -+ if os.path.isfile(libfile): -+ if not _is_wasm(libfile): -+ continue -+ -+ return libfile -+ -+ return None -+ - elif sys.platform.startswith("aix"): - # AIX has two styles of storing shared libraries - # GNU auto_tools refer to these as svr4 and aix --- -2.29.2.windows.2 - diff --git a/recipes/recipes_emscripten/python/patches/0004-Allow-multiprocessing.connection-top-level-import.patch b/recipes/recipes_emscripten/python/patches/0004-Allow-multiprocessing.connection-top-level-import.patch deleted file mode 100644 index 5f7a0d3b0..000000000 --- a/recipes/recipes_emscripten/python/patches/0004-Allow-multiprocessing.connection-top-level-import.patch +++ /dev/null @@ -1,28 +0,0 @@ -From becbcc43e3e09a9c065ea7856a2d3069061fd570 Mon Sep 17 00:00:00 2001 -From: Hood Chatham -Date: Mon, 19 Dec 2022 09:09:14 -0800 -Subject: [PATCH 4/9] Allow multiprocessing.connection top level import - ---- - Lib/multiprocessing/connection.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py -index 510e4b5aba..372f9ced37 100644 ---- a/Lib/multiprocessing/connection.py -+++ b/Lib/multiprocessing/connection.py -@@ -18,7 +18,10 @@ - import tempfile - import itertools - --import _multiprocessing -+try: -+ import _multiprocessing -+except ModuleNotFoundError: -+ pass - - from . import util - --- -2.25.1 - diff --git a/recipes/recipes_emscripten/python-3.13/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch b/recipes/recipes_emscripten/python/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch similarity index 100% rename from recipes/recipes_emscripten/python-3.13/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch rename to recipes/recipes_emscripten/python/patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch diff --git a/recipes/recipes_emscripten/python/patches/0005-gh-93839-Move-Lib-ctypes-test-to-Lib-test-test_ctype.patch b/recipes/recipes_emscripten/python/patches/0005-gh-93839-Move-Lib-ctypes-test-to-Lib-test-test_ctype.patch deleted file mode 100644 index 49353eb6f..000000000 --- a/recipes/recipes_emscripten/python/patches/0005-gh-93839-Move-Lib-ctypes-test-to-Lib-test-test_ctype.patch +++ /dev/null @@ -1,753 +0,0 @@ -From d82e0bfe8b98a122ca443b356d81998c804b686e Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Tue, 21 Jun 2022 10:24:33 +0200 -Subject: [PATCH 5/9] gh-93839: Move Lib/ctypes/test/ to Lib/test/test_ctypes/ - (#94041) - -* Move Lib/ctypes/test/ to Lib/test/test_ctypes/ -* Remove Lib/test/test_ctypes.py -* Update imports and build system. ---- - Lib/ctypes/test/__main__.py | 4 - - Lib/test/leakers/test_ctypes.py | 2 +- - Lib/test/test_ctypes.py | 10 -- - .../test => test/test_ctypes}/__init__.py | 0 - Lib/test/test_ctypes/__main__.py | 4 + - .../test => test/test_ctypes}/test_anon.py | 0 - .../test_ctypes}/test_array_in_pointer.py | 0 - .../test => test/test_ctypes}/test_arrays.py | 2 +- - .../test_ctypes}/test_as_parameter.py | 2 +- - .../test_ctypes}/test_bitfields.py | 2 +- - .../test => test/test_ctypes}/test_buffers.py | 2 +- - .../test => test/test_ctypes}/test_bytes.py | 0 - .../test_ctypes}/test_byteswap.py | 0 - .../test_ctypes}/test_callbacks.py | 2 +- - .../test => test/test_ctypes}/test_cast.py | 2 +- - .../test => test/test_ctypes}/test_cfuncs.py | 2 +- - .../test_ctypes}/test_checkretval.py | 2 +- - .../test => test/test_ctypes}/test_delattr.py | 0 - .../test => test/test_ctypes}/test_errno.py | 0 - .../test => test/test_ctypes}/test_find.py | 0 - .../test_ctypes}/test_frombuffer.py | 0 - .../test => test/test_ctypes}/test_funcptr.py | 0 - .../test_ctypes}/test_functions.py | 2 +- - .../test_ctypes}/test_incomplete.py | 0 - .../test => test/test_ctypes}/test_init.py | 0 - .../test_ctypes}/test_internals.py | 0 - .../test_ctypes}/test_keeprefs.py | 0 - .../test => test/test_ctypes}/test_libc.py | 0 - .../test => test/test_ctypes}/test_loading.py | 0 - .../test_ctypes}/test_macholib.py | 0 - .../test_ctypes}/test_memfunctions.py | 2 +- - .../test => test/test_ctypes}/test_numbers.py | 0 - .../test => test/test_ctypes}/test_objects.py | 8 +- - .../test_ctypes}/test_parameters.py | 2 +- - .../test => test/test_ctypes}/test_pep3118.py | 0 - .../test_ctypes}/test_pickling.py | 0 - .../test_ctypes}/test_pointers.py | 0 - .../test_ctypes}/test_prototypes.py | 2 +- - .../test_ctypes}/test_python_api.py | 0 - .../test_ctypes}/test_random_things.py | 0 - .../test_ctypes}/test_refcounts.py | 0 - .../test => test/test_ctypes}/test_repr.py | 0 - .../test_ctypes}/test_returnfuncptrs.py | 0 - .../test_ctypes}/test_simplesubclasses.py | 0 - .../test => test/test_ctypes}/test_sizes.py | 0 - .../test => test/test_ctypes}/test_slicing.py | 2 +- - .../test_ctypes}/test_stringptr.py | 0 - .../test => test/test_ctypes}/test_strings.py | 2 +- - .../test_ctypes}/test_struct_fields.py | 0 - .../test_ctypes}/test_structures.py | 2 +- - .../test_ctypes}/test_unaligned_structures.py | 0 - .../test => test/test_ctypes}/test_unicode.py | 2 +- - .../test => test/test_ctypes}/test_values.py | 0 - .../test_ctypes}/test_varsize_struct.py | 0 - .../test => test/test_ctypes}/test_win32.py | 0 - .../test_ctypes}/test_wintypes.py | 0 - Makefile.pre.in | 4 +- - ...2-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst | 2 + - PCbuild/lib.pyproj | 109 +++++++++--------- - Tools/wasm/wasm_assets.py | 1 - - 60 files changed, 83 insertions(+), 93 deletions(-) - delete mode 100644 Lib/ctypes/test/__main__.py - delete mode 100644 Lib/test/test_ctypes.py - rename Lib/{ctypes/test => test/test_ctypes}/__init__.py (100%) - create mode 100644 Lib/test/test_ctypes/__main__.py - rename Lib/{ctypes/test => test/test_ctypes}/test_anon.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_array_in_pointer.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_arrays.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_as_parameter.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_bitfields.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_buffers.py (98%) - rename Lib/{ctypes/test => test/test_ctypes}/test_bytes.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_byteswap.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_callbacks.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_cast.py (98%) - rename Lib/{ctypes/test => test/test_ctypes}/test_cfuncs.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_checkretval.py (95%) - rename Lib/{ctypes/test => test/test_ctypes}/test_delattr.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_errno.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_find.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_frombuffer.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_funcptr.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_functions.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_incomplete.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_init.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_internals.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_keeprefs.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_libc.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_loading.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_macholib.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_memfunctions.py (98%) - rename Lib/{ctypes/test => test/test_ctypes}/test_numbers.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_objects.py (87%) - rename Lib/{ctypes/test => test/test_ctypes}/test_parameters.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_pep3118.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_pickling.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_pointers.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_prototypes.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_python_api.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_random_things.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_refcounts.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_repr.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_returnfuncptrs.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_simplesubclasses.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_sizes.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_slicing.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_stringptr.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_strings.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_struct_fields.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_structures.py (99%) - rename Lib/{ctypes/test => test/test_ctypes}/test_unaligned_structures.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_unicode.py (97%) - rename Lib/{ctypes/test => test/test_ctypes}/test_values.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_varsize_struct.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_win32.py (100%) - rename Lib/{ctypes/test => test/test_ctypes}/test_wintypes.py (100%) - create mode 100644 Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst - -diff --git a/Lib/ctypes/test/__main__.py b/Lib/ctypes/test/__main__.py -deleted file mode 100644 -index 362a9ec8cf..0000000000 ---- a/Lib/ctypes/test/__main__.py -+++ /dev/null -@@ -1,4 +0,0 @@ --from ctypes.test import load_tests --import unittest -- --unittest.main() -diff --git a/Lib/test/leakers/test_ctypes.py b/Lib/test/leakers/test_ctypes.py -index 7d7e9ff3a1..ec09ac3699 100644 ---- a/Lib/test/leakers/test_ctypes.py -+++ b/Lib/test/leakers/test_ctypes.py -@@ -1,5 +1,5 @@ - --# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test(). -+# Taken from Lib/test/test_ctypes/test_keeprefs.py, PointerToStructure.test(). - - from ctypes import Structure, c_int, POINTER - import gc -diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py -deleted file mode 100644 -index b0a12c9734..0000000000 ---- a/Lib/test/test_ctypes.py -+++ /dev/null -@@ -1,10 +0,0 @@ --import unittest --from test.support.import_helper import import_module -- -- --ctypes_test = import_module('ctypes.test') -- --load_tests = ctypes_test.load_tests -- --if __name__ == "__main__": -- unittest.main() -diff --git a/Lib/ctypes/test/__init__.py b/Lib/test/test_ctypes/__init__.py -similarity index 100% -rename from Lib/ctypes/test/__init__.py -rename to Lib/test/test_ctypes/__init__.py -diff --git a/Lib/test/test_ctypes/__main__.py b/Lib/test/test_ctypes/__main__.py -new file mode 100644 -index 0000000000..3003d4db89 ---- /dev/null -+++ b/Lib/test/test_ctypes/__main__.py -@@ -0,0 +1,4 @@ -+from test.test_ctypes import load_tests -+import unittest -+ -+unittest.main() -diff --git a/Lib/ctypes/test/test_anon.py b/Lib/test/test_ctypes/test_anon.py -similarity index 100% -rename from Lib/ctypes/test/test_anon.py -rename to Lib/test/test_ctypes/test_anon.py -diff --git a/Lib/ctypes/test/test_array_in_pointer.py b/Lib/test/test_ctypes/test_array_in_pointer.py -similarity index 100% -rename from Lib/ctypes/test/test_array_in_pointer.py -rename to Lib/test/test_ctypes/test_array_in_pointer.py -diff --git a/Lib/ctypes/test/test_arrays.py b/Lib/test/test_ctypes/test_arrays.py -similarity index 99% -rename from Lib/ctypes/test/test_arrays.py -rename to Lib/test/test_ctypes/test_arrays.py -index 14603b7049..415a5785a9 100644 ---- a/Lib/ctypes/test/test_arrays.py -+++ b/Lib/test/test_ctypes/test_arrays.py -@@ -3,7 +3,7 @@ - import sys - from ctypes import * - --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - - formats = "bBhHiIlLqQfd" - -diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/test/test_ctypes/test_as_parameter.py -similarity index 99% -rename from Lib/ctypes/test/test_as_parameter.py -rename to Lib/test/test_ctypes/test_as_parameter.py -index f9d27cb89d..b35defb158 100644 ---- a/Lib/ctypes/test/test_as_parameter.py -+++ b/Lib/test/test_ctypes/test_as_parameter.py -@@ -1,6 +1,6 @@ - import unittest - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - import _ctypes_test - - dll = CDLL(_ctypes_test.__file__) -diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/test/test_ctypes/test_bitfields.py -similarity index 99% -rename from Lib/ctypes/test/test_bitfields.py -rename to Lib/test/test_ctypes/test_bitfields.py -index 66acd62e68..dad71a0ba7 100644 ---- a/Lib/ctypes/test/test_bitfields.py -+++ b/Lib/test/test_ctypes/test_bitfields.py -@@ -1,5 +1,5 @@ - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - from test import support - import unittest - import os -diff --git a/Lib/ctypes/test/test_buffers.py b/Lib/test/test_ctypes/test_buffers.py -similarity index 98% -rename from Lib/ctypes/test/test_buffers.py -rename to Lib/test/test_ctypes/test_buffers.py -index 15782be757..a9be2023aa 100644 ---- a/Lib/ctypes/test/test_buffers.py -+++ b/Lib/test/test_ctypes/test_buffers.py -@@ -1,5 +1,5 @@ - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - import unittest - - class StringBufferTestCase(unittest.TestCase): -diff --git a/Lib/ctypes/test/test_bytes.py b/Lib/test/test_ctypes/test_bytes.py -similarity index 100% -rename from Lib/ctypes/test/test_bytes.py -rename to Lib/test/test_ctypes/test_bytes.py -diff --git a/Lib/ctypes/test/test_byteswap.py b/Lib/test/test_ctypes/test_byteswap.py -similarity index 100% -rename from Lib/ctypes/test/test_byteswap.py -rename to Lib/test/test_ctypes/test_byteswap.py -diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/test/test_ctypes/test_callbacks.py -similarity index 99% -rename from Lib/ctypes/test/test_callbacks.py -rename to Lib/test/test_ctypes/test_callbacks.py -index 1099cf9a69..2758720d4a 100644 ---- a/Lib/ctypes/test/test_callbacks.py -+++ b/Lib/test/test_ctypes/test_callbacks.py -@@ -3,7 +3,7 @@ - from test import support - - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - from _ctypes import CTYPES_MAX_ARGCOUNT - import _ctypes_test - -diff --git a/Lib/ctypes/test/test_cast.py b/Lib/test/test_ctypes/test_cast.py -similarity index 98% -rename from Lib/ctypes/test/test_cast.py -rename to Lib/test/test_ctypes/test_cast.py -index 6878f97328..7ee23b16f1 100644 ---- a/Lib/ctypes/test/test_cast.py -+++ b/Lib/test/test_ctypes/test_cast.py -@@ -1,5 +1,5 @@ - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - import unittest - import sys - -diff --git a/Lib/ctypes/test/test_cfuncs.py b/Lib/test/test_ctypes/test_cfuncs.py -similarity index 99% -rename from Lib/ctypes/test/test_cfuncs.py -rename to Lib/test/test_ctypes/test_cfuncs.py -index ac2240fa19..0a9394bf31 100644 ---- a/Lib/ctypes/test/test_cfuncs.py -+++ b/Lib/test/test_ctypes/test_cfuncs.py -@@ -3,7 +3,7 @@ - - import unittest - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - - import _ctypes_test - -diff --git a/Lib/ctypes/test/test_checkretval.py b/Lib/test/test_ctypes/test_checkretval.py -similarity index 95% -rename from Lib/ctypes/test/test_checkretval.py -rename to Lib/test/test_ctypes/test_checkretval.py -index e9567dc391..1492099f4b 100644 ---- a/Lib/ctypes/test/test_checkretval.py -+++ b/Lib/test/test_ctypes/test_checkretval.py -@@ -1,7 +1,7 @@ - import unittest - - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - - class CHECKED(c_int): - def _check_retval_(value): -diff --git a/Lib/ctypes/test/test_delattr.py b/Lib/test/test_ctypes/test_delattr.py -similarity index 100% -rename from Lib/ctypes/test/test_delattr.py -rename to Lib/test/test_ctypes/test_delattr.py -diff --git a/Lib/ctypes/test/test_errno.py b/Lib/test/test_ctypes/test_errno.py -similarity index 100% -rename from Lib/ctypes/test/test_errno.py -rename to Lib/test/test_ctypes/test_errno.py -diff --git a/Lib/ctypes/test/test_find.py b/Lib/test/test_ctypes/test_find.py -similarity index 100% -rename from Lib/ctypes/test/test_find.py -rename to Lib/test/test_ctypes/test_find.py -diff --git a/Lib/ctypes/test/test_frombuffer.py b/Lib/test/test_ctypes/test_frombuffer.py -similarity index 100% -rename from Lib/ctypes/test/test_frombuffer.py -rename to Lib/test/test_ctypes/test_frombuffer.py -diff --git a/Lib/ctypes/test/test_funcptr.py b/Lib/test/test_ctypes/test_funcptr.py -similarity index 100% -rename from Lib/ctypes/test/test_funcptr.py -rename to Lib/test/test_ctypes/test_funcptr.py -diff --git a/Lib/ctypes/test/test_functions.py b/Lib/test/test_ctypes/test_functions.py -similarity index 99% -rename from Lib/ctypes/test/test_functions.py -rename to Lib/test/test_ctypes/test_functions.py -index f9e92e1cc6..4a784c8d79 100644 ---- a/Lib/ctypes/test/test_functions.py -+++ b/Lib/test/test_ctypes/test_functions.py -@@ -6,7 +6,7 @@ - """ - - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - import sys, unittest - - try: -diff --git a/Lib/ctypes/test/test_incomplete.py b/Lib/test/test_ctypes/test_incomplete.py -similarity index 100% -rename from Lib/ctypes/test/test_incomplete.py -rename to Lib/test/test_ctypes/test_incomplete.py -diff --git a/Lib/ctypes/test/test_init.py b/Lib/test/test_ctypes/test_init.py -similarity index 100% -rename from Lib/ctypes/test/test_init.py -rename to Lib/test/test_ctypes/test_init.py -diff --git a/Lib/ctypes/test/test_internals.py b/Lib/test/test_ctypes/test_internals.py -similarity index 100% -rename from Lib/ctypes/test/test_internals.py -rename to Lib/test/test_ctypes/test_internals.py -diff --git a/Lib/ctypes/test/test_keeprefs.py b/Lib/test/test_ctypes/test_keeprefs.py -similarity index 100% -rename from Lib/ctypes/test/test_keeprefs.py -rename to Lib/test/test_ctypes/test_keeprefs.py -diff --git a/Lib/ctypes/test/test_libc.py b/Lib/test/test_ctypes/test_libc.py -similarity index 100% -rename from Lib/ctypes/test/test_libc.py -rename to Lib/test/test_ctypes/test_libc.py -diff --git a/Lib/ctypes/test/test_loading.py b/Lib/test/test_ctypes/test_loading.py -similarity index 100% -rename from Lib/ctypes/test/test_loading.py -rename to Lib/test/test_ctypes/test_loading.py -diff --git a/Lib/ctypes/test/test_macholib.py b/Lib/test/test_ctypes/test_macholib.py -similarity index 100% -rename from Lib/ctypes/test/test_macholib.py -rename to Lib/test/test_ctypes/test_macholib.py -diff --git a/Lib/ctypes/test/test_memfunctions.py b/Lib/test/test_ctypes/test_memfunctions.py -similarity index 98% -rename from Lib/ctypes/test/test_memfunctions.py -rename to Lib/test/test_ctypes/test_memfunctions.py -index e784b9a706..d5c9735211 100644 ---- a/Lib/ctypes/test/test_memfunctions.py -+++ b/Lib/test/test_ctypes/test_memfunctions.py -@@ -2,7 +2,7 @@ - from test import support - import unittest - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - - class MemFunctionsTest(unittest.TestCase): - @unittest.skip('test disabled') -diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/test/test_ctypes/test_numbers.py -similarity index 100% -rename from Lib/ctypes/test/test_numbers.py -rename to Lib/test/test_ctypes/test_numbers.py -diff --git a/Lib/ctypes/test/test_objects.py b/Lib/test/test_ctypes/test_objects.py -similarity index 87% -rename from Lib/ctypes/test/test_objects.py -rename to Lib/test/test_ctypes/test_objects.py -index 19e3dc1f2d..44a3c61ad7 100644 ---- a/Lib/ctypes/test/test_objects.py -+++ b/Lib/test/test_ctypes/test_objects.py -@@ -42,7 +42,7 @@ - of 'x' ('_b_base_' is either None, or the root object owning the memory block): - - >>> print(x.array._b_base_) # doctest: +ELLIPSIS -- -+ - >>> - - >>> x.array[0] = b'spam spam spam' -@@ -56,12 +56,12 @@ - - import unittest, doctest - --import ctypes.test.test_objects -+import test.test_ctypes.test_objects - - class TestCase(unittest.TestCase): - def test(self): -- failures, tests = doctest.testmod(ctypes.test.test_objects) -+ failures, tests = doctest.testmod(test.test_ctypes.test_objects) - self.assertFalse(failures, 'doctests failed, see output above') - - if __name__ == '__main__': -- doctest.testmod(ctypes.test.test_objects) -+ doctest.testmod(test.test_ctypes.test_objects) -diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/test/test_ctypes/test_parameters.py -similarity index 99% -rename from Lib/ctypes/test/test_parameters.py -rename to Lib/test/test_ctypes/test_parameters.py -index 38af7ac13d..2f755a6d09 100644 ---- a/Lib/ctypes/test/test_parameters.py -+++ b/Lib/test/test_ctypes/test_parameters.py -@@ -1,5 +1,5 @@ - import unittest --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - import test.support - - class SimpleTypesTestCase(unittest.TestCase): -diff --git a/Lib/ctypes/test/test_pep3118.py b/Lib/test/test_ctypes/test_pep3118.py -similarity index 100% -rename from Lib/ctypes/test/test_pep3118.py -rename to Lib/test/test_ctypes/test_pep3118.py -diff --git a/Lib/ctypes/test/test_pickling.py b/Lib/test/test_ctypes/test_pickling.py -similarity index 100% -rename from Lib/ctypes/test/test_pickling.py -rename to Lib/test/test_ctypes/test_pickling.py -diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/test/test_ctypes/test_pointers.py -similarity index 100% -rename from Lib/ctypes/test/test_pointers.py -rename to Lib/test/test_ctypes/test_pointers.py -diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/test/test_ctypes/test_prototypes.py -similarity index 99% -rename from Lib/ctypes/test/test_prototypes.py -rename to Lib/test/test_ctypes/test_prototypes.py -index cd0c649de3..bf27561487 100644 ---- a/Lib/ctypes/test/test_prototypes.py -+++ b/Lib/test/test_ctypes/test_prototypes.py -@@ -1,5 +1,5 @@ - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - import unittest - - # IMPORTANT INFO: -diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/test/test_ctypes/test_python_api.py -similarity index 100% -rename from Lib/ctypes/test/test_python_api.py -rename to Lib/test/test_ctypes/test_python_api.py -diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/test/test_ctypes/test_random_things.py -similarity index 100% -rename from Lib/ctypes/test/test_random_things.py -rename to Lib/test/test_ctypes/test_random_things.py -diff --git a/Lib/ctypes/test/test_refcounts.py b/Lib/test/test_ctypes/test_refcounts.py -similarity index 100% -rename from Lib/ctypes/test/test_refcounts.py -rename to Lib/test/test_ctypes/test_refcounts.py -diff --git a/Lib/ctypes/test/test_repr.py b/Lib/test/test_ctypes/test_repr.py -similarity index 100% -rename from Lib/ctypes/test/test_repr.py -rename to Lib/test/test_ctypes/test_repr.py -diff --git a/Lib/ctypes/test/test_returnfuncptrs.py b/Lib/test/test_ctypes/test_returnfuncptrs.py -similarity index 100% -rename from Lib/ctypes/test/test_returnfuncptrs.py -rename to Lib/test/test_ctypes/test_returnfuncptrs.py -diff --git a/Lib/ctypes/test/test_simplesubclasses.py b/Lib/test/test_ctypes/test_simplesubclasses.py -similarity index 100% -rename from Lib/ctypes/test/test_simplesubclasses.py -rename to Lib/test/test_ctypes/test_simplesubclasses.py -diff --git a/Lib/ctypes/test/test_sizes.py b/Lib/test/test_ctypes/test_sizes.py -similarity index 100% -rename from Lib/ctypes/test/test_sizes.py -rename to Lib/test/test_ctypes/test_sizes.py -diff --git a/Lib/ctypes/test/test_slicing.py b/Lib/test/test_ctypes/test_slicing.py -similarity index 99% -rename from Lib/ctypes/test/test_slicing.py -rename to Lib/test/test_ctypes/test_slicing.py -index a3932f1767..b3e68f9a82 100644 ---- a/Lib/ctypes/test/test_slicing.py -+++ b/Lib/test/test_ctypes/test_slicing.py -@@ -1,6 +1,6 @@ - import unittest - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - - import _ctypes_test - -diff --git a/Lib/ctypes/test/test_stringptr.py b/Lib/test/test_ctypes/test_stringptr.py -similarity index 100% -rename from Lib/ctypes/test/test_stringptr.py -rename to Lib/test/test_ctypes/test_stringptr.py -diff --git a/Lib/ctypes/test/test_strings.py b/Lib/test/test_ctypes/test_strings.py -similarity index 99% -rename from Lib/ctypes/test/test_strings.py -rename to Lib/test/test_ctypes/test_strings.py -index 12e208828a..a9003be3f5 100644 ---- a/Lib/ctypes/test/test_strings.py -+++ b/Lib/test/test_ctypes/test_strings.py -@@ -1,6 +1,6 @@ - import unittest - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - - class StringArrayTestCase(unittest.TestCase): - def test(self): -diff --git a/Lib/ctypes/test/test_struct_fields.py b/Lib/test/test_ctypes/test_struct_fields.py -similarity index 100% -rename from Lib/ctypes/test/test_struct_fields.py -rename to Lib/test/test_ctypes/test_struct_fields.py -diff --git a/Lib/ctypes/test/test_structures.py b/Lib/test/test_ctypes/test_structures.py -similarity index 99% -rename from Lib/ctypes/test/test_structures.py -rename to Lib/test/test_ctypes/test_structures.py -index 97ad2b8ed8..13c0470ba2 100644 ---- a/Lib/ctypes/test/test_structures.py -+++ b/Lib/test/test_ctypes/test_structures.py -@@ -2,7 +2,7 @@ - import sys - import unittest - from ctypes import * --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - from struct import calcsize - import _ctypes_test - from test import support -diff --git a/Lib/ctypes/test/test_unaligned_structures.py b/Lib/test/test_ctypes/test_unaligned_structures.py -similarity index 100% -rename from Lib/ctypes/test/test_unaligned_structures.py -rename to Lib/test/test_ctypes/test_unaligned_structures.py -diff --git a/Lib/ctypes/test/test_unicode.py b/Lib/test/test_ctypes/test_unicode.py -similarity index 97% -rename from Lib/ctypes/test/test_unicode.py -rename to Lib/test/test_ctypes/test_unicode.py -index 60c75424b7..319cb3b1dc 100644 ---- a/Lib/ctypes/test/test_unicode.py -+++ b/Lib/test/test_ctypes/test_unicode.py -@@ -1,6 +1,6 @@ - import unittest - import ctypes --from ctypes.test import need_symbol -+from test.test_ctypes import need_symbol - - import _ctypes_test - -diff --git a/Lib/ctypes/test/test_values.py b/Lib/test/test_ctypes/test_values.py -similarity index 100% -rename from Lib/ctypes/test/test_values.py -rename to Lib/test/test_ctypes/test_values.py -diff --git a/Lib/ctypes/test/test_varsize_struct.py b/Lib/test/test_ctypes/test_varsize_struct.py -similarity index 100% -rename from Lib/ctypes/test/test_varsize_struct.py -rename to Lib/test/test_ctypes/test_varsize_struct.py -diff --git a/Lib/ctypes/test/test_win32.py b/Lib/test/test_ctypes/test_win32.py -similarity index 100% -rename from Lib/ctypes/test/test_win32.py -rename to Lib/test/test_ctypes/test_win32.py -diff --git a/Lib/ctypes/test/test_wintypes.py b/Lib/test/test_ctypes/test_wintypes.py -similarity index 100% -rename from Lib/ctypes/test/test_wintypes.py -rename to Lib/test/test_ctypes/test_wintypes.py -diff --git a/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst b/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst -new file mode 100644 -index 0000000000..121b64b133 ---- /dev/null -+++ b/Misc/NEWS.d/next/Tests/2022-06-20-23-04-52.gh-issue-93839.OE3Ybk.rst -@@ -0,0 +1,2 @@ -+Move ``Lib/ctypes/test/`` to ``Lib/test/test_ctypes/``. Patch by Victor -+Stinner. -diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj -index 43c570f1da..692b083349 100644 ---- a/PCbuild/lib.pyproj -+++ b/PCbuild/lib.pyproj -@@ -83,59 +83,6 @@ - - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -@@ -944,7 +891,59 @@ - - - -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -1725,7 +1724,6 @@ - - - -- - - - -@@ -1769,6 +1767,7 @@ - - - -+ - - - -diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py -index b7e83517ca..d0a0570840 100755 ---- a/Tools/wasm/wasm_assets.py -+++ b/Tools/wasm/wasm_assets.py -@@ -111,7 +111,6 @@ - - # regression test sub directories - OMIT_SUBDIRS = ( -- "ctypes/test/", - "tkinter/test/", - "unittest/test/", - ) --- -2.29.2.windows.2 - diff --git a/recipes/recipes_emscripten/python/patches/0006-gh-93839-Move-Lib-unttest-test-to-Lib-test-test_unit.patch b/recipes/recipes_emscripten/python/patches/0006-gh-93839-Move-Lib-unttest-test-to-Lib-test-test_unit.patch deleted file mode 100644 index 9e8d8c47c..000000000 --- a/recipes/recipes_emscripten/python/patches/0006-gh-93839-Move-Lib-unttest-test-to-Lib-test-test_unit.patch +++ /dev/null @@ -1,724 +0,0 @@ -From c735d545343c3ab002c62596b2fb2cfa4488b0af Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Tue, 21 Jun 2022 10:27:59 +0200 -Subject: [PATCH 6/9] gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ - (#94043) - -* Move Lib/unittest/test/ to Lib/test/test_unittest/ -* Remove Lib/test/test_unittest.py -* Replace unittest.test with test.test_unittest -* Remove unittest.load_tests() -* Rewrite unittest __init__.py and __main__.py -* Update build system, CODEOWNERS, and wasm_assets.py ---- - .github/CODEOWNERS | 2 +- - Lib/test/test_unittest.py | 16 ----- - Lib/test/test_unittest/__init__.py | 6 ++ - Lib/test/test_unittest/__main__.py | 4 ++ - .../test_unittest}/_test_warnings.py | 0 - .../test => test/test_unittest}/dummy.py | 0 - .../test => test/test_unittest}/support.py | 0 - .../test_unittest}/test_assertions.py | 0 - .../test_unittest}/test_async_case.py | 0 - .../test => test/test_unittest}/test_break.py | 0 - .../test => test/test_unittest}/test_case.py | 2 +- - .../test_unittest}/test_discovery.py | 6 +- - .../test_unittest}/test_functiontestcase.py | 2 +- - .../test_unittest}/test_loader.py | 6 +- - .../test_unittest}/test_program.py | 16 ++--- - .../test_unittest}/test_result.py | 0 - .../test_unittest}/test_runner.py | 2 +- - .../test_unittest}/test_setups.py | 0 - .../test_unittest}/test_skipping.py | 2 +- - .../test => test/test_unittest}/test_suite.py | 2 +- - .../test_unittest}/testmock/__init__.py | 2 +- - .../test_unittest}/testmock/__main__.py | 2 +- - .../test_unittest}/testmock/support.py | 0 - .../test_unittest}/testmock/testasync.py | 0 - .../test_unittest}/testmock/testcallable.py | 2 +- - .../test_unittest}/testmock/testhelpers.py | 0 - .../testmock/testmagicmethods.py | 0 - .../test_unittest}/testmock/testmock.py | 2 +- - .../test_unittest}/testmock/testpatch.py | 22 +++---- - .../test_unittest}/testmock/testsealable.py | 0 - .../test_unittest}/testmock/testsentinel.py | 0 - .../test_unittest}/testmock/testwith.py | 2 +- - Lib/unittest/__init__.py | 10 ---- - Lib/unittest/test/__init__.py | 25 -------- - Lib/unittest/test/__main__.py | 18 ------ - Makefile.pre.in | 4 +- - PCbuild/lib.pyproj | 58 +++++++++---------- - Tools/wasm/wasm_assets.py | 1 - - 38 files changed, 77 insertions(+), 137 deletions(-) - delete mode 100644 Lib/test/test_unittest.py - create mode 100644 Lib/test/test_unittest/__init__.py - create mode 100644 Lib/test/test_unittest/__main__.py - rename Lib/{unittest/test => test/test_unittest}/_test_warnings.py (100%) - rename Lib/{unittest/test => test/test_unittest}/dummy.py (100%) - rename Lib/{unittest/test => test/test_unittest}/support.py (100%) - rename Lib/{unittest/test => test/test_unittest}/test_assertions.py (100%) - rename Lib/{unittest/test => test/test_unittest}/test_async_case.py (100%) - rename Lib/{unittest/test => test/test_unittest}/test_break.py (100%) - rename Lib/{unittest/test => test/test_unittest}/test_case.py (99%) - rename Lib/{unittest/test => test/test_unittest}/test_discovery.py (99%) - rename Lib/{unittest/test => test/test_unittest}/test_functiontestcase.py (99%) - rename Lib/{unittest/test => test/test_unittest}/test_loader.py (99%) - rename Lib/{unittest/test => test/test_unittest}/test_program.py (96%) - rename Lib/{unittest/test => test/test_unittest}/test_result.py (100%) - rename Lib/{unittest/test => test/test_unittest}/test_runner.py (99%) - rename Lib/{unittest/test => test/test_unittest}/test_setups.py (100%) - rename Lib/{unittest/test => test/test_unittest}/test_skipping.py (99%) - rename Lib/{unittest/test => test/test_unittest}/test_suite.py (99%) - rename Lib/{unittest/test => test/test_unittest}/testmock/__init__.py (86%) - rename Lib/{unittest/test => test/test_unittest}/testmock/__main__.py (86%) - rename Lib/{unittest/test => test/test_unittest}/testmock/support.py (100%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testasync.py (100%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testcallable.py (98%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testhelpers.py (100%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testmagicmethods.py (100%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testmock.py (99%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testpatch.py (98%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testsealable.py (100%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testsentinel.py (100%) - rename Lib/{unittest/test => test/test_unittest}/testmock/testwith.py (99%) - delete mode 100644 Lib/unittest/test/__init__.py - delete mode 100644 Lib/unittest/test/__main__.py - -diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py -deleted file mode 100644 -index 1079c7df2e..0000000000 ---- a/Lib/test/test_unittest.py -+++ /dev/null -@@ -1,16 +0,0 @@ --import unittest.test -- --from test import support -- -- --def load_tests(*_): -- # used by unittest -- return unittest.test.suite() -- -- --def tearDownModule(): -- support.reap_children() -- -- --if __name__ == "__main__": -- unittest.main() -diff --git a/Lib/test/test_unittest/__init__.py b/Lib/test/test_unittest/__init__.py -new file mode 100644 -index 0000000000..bc502ef32d ---- /dev/null -+++ b/Lib/test/test_unittest/__init__.py -@@ -0,0 +1,6 @@ -+import os.path -+from test.support import load_package_tests -+ -+ -+def load_tests(*args): -+ return load_package_tests(os.path.dirname(__file__), *args) -diff --git a/Lib/test/test_unittest/__main__.py b/Lib/test/test_unittest/__main__.py -new file mode 100644 -index 0000000000..40a23a297e ---- /dev/null -+++ b/Lib/test/test_unittest/__main__.py -@@ -0,0 +1,4 @@ -+from . import load_tests -+import unittest -+ -+unittest.main() -diff --git a/Lib/unittest/test/_test_warnings.py b/Lib/test/test_unittest/_test_warnings.py -similarity index 100% -rename from Lib/unittest/test/_test_warnings.py -rename to Lib/test/test_unittest/_test_warnings.py -diff --git a/Lib/unittest/test/dummy.py b/Lib/test/test_unittest/dummy.py -similarity index 100% -rename from Lib/unittest/test/dummy.py -rename to Lib/test/test_unittest/dummy.py -diff --git a/Lib/unittest/test/support.py b/Lib/test/test_unittest/support.py -similarity index 100% -rename from Lib/unittest/test/support.py -rename to Lib/test/test_unittest/support.py -diff --git a/Lib/unittest/test/test_assertions.py b/Lib/test/test_unittest/test_assertions.py -similarity index 100% -rename from Lib/unittest/test/test_assertions.py -rename to Lib/test/test_unittest/test_assertions.py -diff --git a/Lib/unittest/test/test_async_case.py b/Lib/test/test_unittest/test_async_case.py -similarity index 100% -rename from Lib/unittest/test/test_async_case.py -rename to Lib/test/test_unittest/test_async_case.py -diff --git a/Lib/unittest/test/test_break.py b/Lib/test/test_unittest/test_break.py -similarity index 100% -rename from Lib/unittest/test/test_break.py -rename to Lib/test/test_unittest/test_break.py -diff --git a/Lib/unittest/test/test_case.py b/Lib/test/test_unittest/test_case.py -similarity index 99% -rename from Lib/unittest/test/test_case.py -rename to Lib/test/test_unittest/test_case.py -index 374a255255..e000fe4f07 100644 ---- a/Lib/unittest/test/test_case.py -+++ b/Lib/test/test_unittest/test_case.py -@@ -15,7 +15,7 @@ - - import unittest - --from unittest.test.support import ( -+from test.test_unittest.support import ( - TestEquality, TestHashing, LoggingResult, LegacyLoggingResult, - ResultWithNoStartTestRunStopTestRun - ) -diff --git a/Lib/unittest/test/test_discovery.py b/Lib/test/test_unittest/test_discovery.py -similarity index 99% -rename from Lib/unittest/test/test_discovery.py -rename to Lib/test/test_unittest/test_discovery.py -index 3b58786ec1..946fa1258e 100644 ---- a/Lib/unittest/test/test_discovery.py -+++ b/Lib/test/test_unittest/test_discovery.py -@@ -10,7 +10,7 @@ - - import unittest - import unittest.mock --import unittest.test -+import test.test_unittest - - - class TestableTestProgram(unittest.TestProgram): -@@ -789,7 +789,7 @@ def test_discovery_from_dotted_path(self): - loader = unittest.TestLoader() - - tests = [self] -- expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) -+ expectedPath = os.path.abspath(os.path.dirname(test.test_unittest.__file__)) - - self.wasRun = False - def _find_tests(start_dir, pattern): -@@ -797,7 +797,7 @@ def _find_tests(start_dir, pattern): - self.assertEqual(start_dir, expectedPath) - return tests - loader._find_tests = _find_tests -- suite = loader.discover('unittest.test') -+ suite = loader.discover('test.test_unittest') - self.assertTrue(self.wasRun) - self.assertEqual(suite._tests, tests) - -diff --git a/Lib/unittest/test/test_functiontestcase.py b/Lib/test/test_unittest/test_functiontestcase.py -similarity index 99% -rename from Lib/unittest/test/test_functiontestcase.py -rename to Lib/test/test_unittest/test_functiontestcase.py -index 4971729880..2ebed9564a 100644 ---- a/Lib/unittest/test/test_functiontestcase.py -+++ b/Lib/test/test_unittest/test_functiontestcase.py -@@ -1,6 +1,6 @@ - import unittest - --from unittest.test.support import LoggingResult -+from test.test_unittest.support import LoggingResult - - - class Test_FunctionTestCase(unittest.TestCase): -diff --git a/Lib/unittest/test/test_loader.py b/Lib/test/test_unittest/test_loader.py -similarity index 99% -rename from Lib/unittest/test/test_loader.py -rename to Lib/test/test_unittest/test_loader.py -index de2268cda9..c06ebb658d 100644 ---- a/Lib/unittest/test/test_loader.py -+++ b/Lib/test/test_unittest/test_loader.py -@@ -716,7 +716,7 @@ def test_loadTestsFromName__module_not_loaded(self): - # We're going to try to load this module as a side-effect, so it - # better not be loaded before we try. - # -- module_name = 'unittest.test.dummy' -+ module_name = 'test.test_unittest.dummy' - sys.modules.pop(module_name, None) - - loader = unittest.TestLoader() -@@ -844,7 +844,7 @@ def test_loadTestsFromNames__unknown_attr_name(self): - loader = unittest.TestLoader() - - suite = loader.loadTestsFromNames( -- ['unittest.loader.sdasfasfasdf', 'unittest.test.dummy']) -+ ['unittest.loader.sdasfasfasdf', 'test.test_unittest.dummy']) - error, test = self.check_deferred_error(loader, list(suite)[0]) - expected = "module 'unittest.loader' has no attribute 'sdasfasfasdf'" - self.assertIn( -@@ -1141,7 +1141,7 @@ def test_loadTestsFromNames__module_not_loaded(self): - # We're going to try to load this module as a side-effect, so it - # better not be loaded before we try. - # -- module_name = 'unittest.test.dummy' -+ module_name = 'test.test_unittest.dummy' - sys.modules.pop(module_name, None) - - loader = unittest.TestLoader() -diff --git a/Lib/unittest/test/test_program.py b/Lib/test/test_unittest/test_program.py -similarity index 96% -rename from Lib/unittest/test/test_program.py -rename to Lib/test/test_unittest/test_program.py -index 26a8550af8..169fc4ed94 100644 ---- a/Lib/unittest/test/test_program.py -+++ b/Lib/test/test_unittest/test_program.py -@@ -5,8 +5,8 @@ - import subprocess - from test import support - import unittest --import unittest.test --from unittest.test.test_result import BufferedWriter -+import test.test_unittest -+from test.test_unittest.test_result import BufferedWriter - - - class Test_TestProgram(unittest.TestCase): -@@ -15,7 +15,7 @@ def test_discovery_from_dotted_path(self): - loader = unittest.TestLoader() - - tests = [self] -- expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) -+ expectedPath = os.path.abspath(os.path.dirname(test.test_unittest.__file__)) - - self.wasRun = False - def _find_tests(start_dir, pattern): -@@ -23,7 +23,7 @@ def _find_tests(start_dir, pattern): - self.assertEqual(start_dir, expectedPath) - return tests - loader._find_tests = _find_tests -- suite = loader.discover('unittest.test') -+ suite = loader.discover('test.test_unittest') - self.assertTrue(self.wasRun) - self.assertEqual(suite._tests, tests) - -@@ -93,10 +93,10 @@ def run(self, test): - sys.argv = ['faketest'] - runner = FakeRunner() - program = unittest.TestProgram(testRunner=runner, exit=False, -- defaultTest='unittest.test', -+ defaultTest='test.test_unittest', - testLoader=self.FooBarLoader()) - sys.argv = old_argv -- self.assertEqual(('unittest.test',), program.testNames) -+ self.assertEqual(('test.test_unittest',), program.testNames) - - def test_defaultTest_with_iterable(self): - class FakeRunner(object): -@@ -109,10 +109,10 @@ def run(self, test): - runner = FakeRunner() - program = unittest.TestProgram( - testRunner=runner, exit=False, -- defaultTest=['unittest.test', 'unittest.test2'], -+ defaultTest=['test.test_unittest', 'test.test_unittest2'], - testLoader=self.FooBarLoader()) - sys.argv = old_argv -- self.assertEqual(['unittest.test', 'unittest.test2'], -+ self.assertEqual(['test.test_unittest', 'test.test_unittest2'], - program.testNames) - - def test_NonExit(self): -diff --git a/Lib/unittest/test/test_result.py b/Lib/test/test_unittest/test_result.py -similarity index 100% -rename from Lib/unittest/test/test_result.py -rename to Lib/test/test_unittest/test_result.py -diff --git a/Lib/unittest/test/test_runner.py b/Lib/test/test_unittest/test_runner.py -similarity index 99% -rename from Lib/unittest/test/test_runner.py -rename to Lib/test/test_unittest/test_runner.py -index d3488b40e8..9e3a0a9ca0 100644 ---- a/Lib/unittest/test/test_runner.py -+++ b/Lib/test/test_unittest/test_runner.py -@@ -8,7 +8,7 @@ - import unittest - from unittest.case import _Outcome - --from unittest.test.support import (LoggingResult, -+from test.test_unittest.support import (LoggingResult, - ResultWithNoStartTestRunStopTestRun) - - -diff --git a/Lib/unittest/test/test_setups.py b/Lib/test/test_unittest/test_setups.py -similarity index 100% -rename from Lib/unittest/test/test_setups.py -rename to Lib/test/test_unittest/test_setups.py -diff --git a/Lib/unittest/test/test_skipping.py b/Lib/test/test_unittest/test_skipping.py -similarity index 99% -rename from Lib/unittest/test/test_skipping.py -rename to Lib/test/test_unittest/test_skipping.py -index 64ceeae37e..f146dcac18 100644 ---- a/Lib/unittest/test/test_skipping.py -+++ b/Lib/test/test_unittest/test_skipping.py -@@ -1,6 +1,6 @@ - import unittest - --from unittest.test.support import LoggingResult -+from test.test_unittest.support import LoggingResult - - - class Test_TestSkipping(unittest.TestCase): -diff --git a/Lib/unittest/test/test_suite.py b/Lib/test/test_unittest/test_suite.py -similarity index 99% -rename from Lib/unittest/test/test_suite.py -rename to Lib/test/test_unittest/test_suite.py -index 0551a16996..ca52ee9d9c 100644 ---- a/Lib/unittest/test/test_suite.py -+++ b/Lib/test/test_unittest/test_suite.py -@@ -3,7 +3,7 @@ - import gc - import sys - import weakref --from unittest.test.support import LoggingResult, TestEquality -+from test.test_unittest.support import LoggingResult, TestEquality - - - ### Support code for Test_TestSuite -diff --git a/Lib/unittest/test/testmock/__init__.py b/Lib/test/test_unittest/testmock/__init__.py -similarity index 86% -rename from Lib/unittest/test/testmock/__init__.py -rename to Lib/test/test_unittest/testmock/__init__.py -index 87d7ae994d..6ee60b2376 100644 ---- a/Lib/unittest/test/testmock/__init__.py -+++ b/Lib/test/test_unittest/testmock/__init__.py -@@ -10,7 +10,7 @@ def load_tests(*args): - suite = unittest.TestSuite() - for fn in os.listdir(here): - if fn.startswith("test") and fn.endswith(".py"): -- modname = "unittest.test.testmock." + fn[:-3] -+ modname = "test.test_unittest.testmock." + fn[:-3] - __import__(modname) - module = sys.modules[modname] - suite.addTest(loader.loadTestsFromModule(module)) -diff --git a/Lib/unittest/test/testmock/__main__.py b/Lib/test/test_unittest/testmock/__main__.py -similarity index 86% -rename from Lib/unittest/test/testmock/__main__.py -rename to Lib/test/test_unittest/testmock/__main__.py -index 45c633a4ee..1e3068b0dd 100644 ---- a/Lib/unittest/test/testmock/__main__.py -+++ b/Lib/test/test_unittest/testmock/__main__.py -@@ -6,7 +6,7 @@ def load_tests(loader, standard_tests, pattern): - # top level directory cached on loader instance - this_dir = os.path.dirname(__file__) - pattern = pattern or "test*.py" -- # We are inside unittest.test.testmock, so the top-level is three notches up -+ # We are inside test.test_unittest.testmock, so the top-level is three notches up - top_level_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_dir))) - package_tests = loader.discover(start_dir=this_dir, pattern=pattern, - top_level_dir=top_level_dir) -diff --git a/Lib/unittest/test/testmock/support.py b/Lib/test/test_unittest/testmock/support.py -similarity index 100% -rename from Lib/unittest/test/testmock/support.py -rename to Lib/test/test_unittest/testmock/support.py -diff --git a/Lib/unittest/test/testmock/testasync.py b/Lib/test/test_unittest/testmock/testasync.py -similarity index 100% -rename from Lib/unittest/test/testmock/testasync.py -rename to Lib/test/test_unittest/testmock/testasync.py -diff --git a/Lib/unittest/test/testmock/testcallable.py b/Lib/test/test_unittest/testmock/testcallable.py -similarity index 98% -rename from Lib/unittest/test/testmock/testcallable.py -rename to Lib/test/test_unittest/testmock/testcallable.py -index 5eadc00704..ca88511f63 100644 ---- a/Lib/unittest/test/testmock/testcallable.py -+++ b/Lib/test/test_unittest/testmock/testcallable.py -@@ -3,7 +3,7 @@ - # http://www.voidspace.org.uk/python/mock/ - - import unittest --from unittest.test.testmock.support import is_instance, X, SomeClass -+from test.test_unittest.testmock.support import is_instance, X, SomeClass - - from unittest.mock import ( - Mock, MagicMock, NonCallableMagicMock, -diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/test/test_unittest/testmock/testhelpers.py -similarity index 100% -rename from Lib/unittest/test/testmock/testhelpers.py -rename to Lib/test/test_unittest/testmock/testhelpers.py -diff --git a/Lib/unittest/test/testmock/testmagicmethods.py b/Lib/test/test_unittest/testmock/testmagicmethods.py -similarity index 100% -rename from Lib/unittest/test/testmock/testmagicmethods.py -rename to Lib/test/test_unittest/testmock/testmagicmethods.py -diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/test/test_unittest/testmock/testmock.py -similarity index 99% -rename from Lib/unittest/test/testmock/testmock.py -rename to Lib/test/test_unittest/testmock/testmock.py -index c99098dc4e..8a92490137 100644 ---- a/Lib/unittest/test/testmock/testmock.py -+++ b/Lib/test/test_unittest/testmock/testmock.py -@@ -5,7 +5,7 @@ - - from test.support import ALWAYS_EQ - import unittest --from unittest.test.testmock.support import is_instance -+from test.test_unittest.testmock.support import is_instance - from unittest import mock - from unittest.mock import ( - call, DEFAULT, patch, sentinel, -diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/test/test_unittest/testmock/testpatch.py -similarity index 98% -rename from Lib/unittest/test/testmock/testpatch.py -rename to Lib/test/test_unittest/testmock/testpatch.py -index 8ab63a1317..93ec0ca4be 100644 ---- a/Lib/unittest/test/testmock/testpatch.py -+++ b/Lib/test/test_unittest/testmock/testpatch.py -@@ -7,8 +7,8 @@ - from collections import OrderedDict - - import unittest --from unittest.test.testmock import support --from unittest.test.testmock.support import SomeClass, is_instance -+from test.test_unittest.testmock import support -+from test.test_unittest.testmock.support import SomeClass, is_instance - - from test.test_importlib.util import uncache - from unittest.mock import ( -@@ -669,7 +669,7 @@ def test_patch_dict_decorator_resolution(self): - # the new dictionary during function call - original = support.target.copy() - -- @patch.dict('unittest.test.testmock.support.target', {'bar': 'BAR'}) -+ @patch.dict('test.test_unittest.testmock.support.target', {'bar': 'BAR'}) - def test(): - self.assertEqual(support.target, {'foo': 'BAZ', 'bar': 'BAR'}) - -@@ -1614,7 +1614,7 @@ def test_patch_with_spec_mock_repr(self): - - - def test_patch_nested_autospec_repr(self): -- with patch('unittest.test.testmock.support', autospec=True) as m: -+ with patch('test.test_unittest.testmock.support', autospec=True) as m: - self.assertIn(" name='support.SomeClass.wibble()'", - repr(m.SomeClass.wibble())) - self.assertIn(" name='support.SomeClass().wibble()'", -@@ -1882,7 +1882,7 @@ def foo(x=0): - - with patch.object(foo, '__module__', "testpatch2"): - self.assertEqual(foo.__module__, "testpatch2") -- self.assertEqual(foo.__module__, 'unittest.test.testmock.testpatch') -+ self.assertEqual(foo.__module__, 'test.test_unittest.testmock.testpatch') - - with patch.object(foo, '__annotations__', dict([('s', 1, )])): - self.assertEqual(foo.__annotations__, dict([('s', 1, )])) -@@ -1917,16 +1917,16 @@ def test_dotted_but_module_not_loaded(self): - # This exercises the AttributeError branch of _dot_lookup. - - # make sure it's there -- import unittest.test.testmock.support -+ import test.test_unittest.testmock.support - # now make sure it's not: - with patch.dict('sys.modules'): -- del sys.modules['unittest.test.testmock.support'] -- del sys.modules['unittest.test.testmock'] -- del sys.modules['unittest.test'] -+ del sys.modules['test.test_unittest.testmock.support'] -+ del sys.modules['test.test_unittest.testmock'] -+ del sys.modules['test.test_unittest'] - del sys.modules['unittest'] - - # now make sure we can patch based on a dotted path: -- @patch('unittest.test.testmock.support.X') -+ @patch('test.test_unittest.testmock.support.X') - def test(mock): - pass - test() -@@ -1943,7 +1943,7 @@ class Foo: - - - def test_cant_set_kwargs_when_passing_a_mock(self): -- @patch('unittest.test.testmock.support.X', new=object(), x=1) -+ @patch('test.test_unittest.testmock.support.X', new=object(), x=1) - def test(): pass - with self.assertRaises(TypeError): - test() -diff --git a/Lib/unittest/test/testmock/testsealable.py b/Lib/test/test_unittest/testmock/testsealable.py -similarity index 100% -rename from Lib/unittest/test/testmock/testsealable.py -rename to Lib/test/test_unittest/testmock/testsealable.py -diff --git a/Lib/unittest/test/testmock/testsentinel.py b/Lib/test/test_unittest/testmock/testsentinel.py -similarity index 100% -rename from Lib/unittest/test/testmock/testsentinel.py -rename to Lib/test/test_unittest/testmock/testsentinel.py -diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/test/test_unittest/testmock/testwith.py -similarity index 99% -rename from Lib/unittest/test/testmock/testwith.py -rename to Lib/test/test_unittest/testmock/testwith.py -index c74d49a63c..8dc8eb1137 100644 ---- a/Lib/unittest/test/testmock/testwith.py -+++ b/Lib/test/test_unittest/testmock/testwith.py -@@ -1,7 +1,7 @@ - import unittest - from warnings import catch_warnings - --from unittest.test.testmock.support import is_instance -+from test.test_unittest.testmock.support import is_instance - from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call - - -diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py -index 005d23f6d0..b8de8c95d6 100644 ---- a/Lib/unittest/__init__.py -+++ b/Lib/unittest/__init__.py -@@ -73,16 +73,6 @@ def testMultiply(self): - _TextTestResult = TextTestResult - - --# There are no tests here, so don't try to run anything discovered from --# introspecting the symbols (e.g. FunctionTestCase). Instead, all our --# tests come from within unittest.test. --def load_tests(loader, tests, pattern): -- import os.path -- # top level directory cached on loader instance -- this_dir = os.path.dirname(__file__) -- return loader.discover(start_dir=this_dir, pattern=pattern) -- -- - # Lazy import of IsolatedAsyncioTestCase from .async_case - # It imports asyncio, which is relatively heavy, but most tests - # do not need it. -diff --git a/Lib/unittest/test/__init__.py b/Lib/unittest/test/__init__.py -deleted file mode 100644 -index 143f4ab5a3..0000000000 ---- a/Lib/unittest/test/__init__.py -+++ /dev/null -@@ -1,25 +0,0 @@ --import os --import sys --import unittest -- -- --here = os.path.dirname(__file__) --loader = unittest.defaultTestLoader -- --def suite(): -- suite = unittest.TestSuite() -- for fn in os.listdir(here): -- if fn.startswith("test") and fn.endswith(".py"): -- modname = "unittest.test." + fn[:-3] -- try: -- __import__(modname) -- except unittest.SkipTest: -- continue -- module = sys.modules[modname] -- suite.addTest(loader.loadTestsFromModule(module)) -- suite.addTest(loader.loadTestsFromName('unittest.test.testmock')) -- return suite -- -- --if __name__ == "__main__": -- unittest.main(defaultTest="suite") -diff --git a/Lib/unittest/test/__main__.py b/Lib/unittest/test/__main__.py -deleted file mode 100644 -index 44d0591e84..0000000000 ---- a/Lib/unittest/test/__main__.py -+++ /dev/null -@@ -1,18 +0,0 @@ --import os --import unittest -- -- --def load_tests(loader, standard_tests, pattern): -- # top level directory cached on loader instance -- this_dir = os.path.dirname(__file__) -- pattern = pattern or "test_*.py" -- # We are inside unittest.test, so the top-level is two notches up -- top_level_dir = os.path.dirname(os.path.dirname(this_dir)) -- package_tests = loader.discover(start_dir=this_dir, pattern=pattern, -- top_level_dir=top_level_dir) -- standard_tests.addTests(package_tests) -- return standard_tests -- -- --if __name__ == '__main__': -- unittest.main() -diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj -index 692b083349..f3f44d1d8f 100644 ---- a/PCbuild/lib.pyproj -+++ b/PCbuild/lib.pyproj -@@ -1491,33 +1491,33 @@ - - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -1804,6 +1804,8 @@ - - - -+ -+ - - - -@@ -1813,8 +1815,6 @@ - - - -- -- - - - -diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py -index d0a0570840..67afde60f0 100755 ---- a/Tools/wasm/wasm_assets.py -+++ b/Tools/wasm/wasm_assets.py -@@ -112,7 +112,6 @@ - # regression test sub directories - OMIT_SUBDIRS = ( - "tkinter/test/", -- "unittest/test/", - ) - - def get_builddir(args: argparse.Namespace) -> pathlib.Path: --- -2.29.2.windows.2 - diff --git a/recipes/recipes_emscripten/python/patches/0007-gh-93839-Use-load_package_tests-for-testmock-GH-9405.patch b/recipes/recipes_emscripten/python/patches/0007-gh-93839-Use-load_package_tests-for-testmock-GH-9405.patch deleted file mode 100644 index 33531df3b..000000000 --- a/recipes/recipes_emscripten/python/patches/0007-gh-93839-Use-load_package_tests-for-testmock-GH-9405.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 50ebd72fb0e69c78f95cea3d4a47589beb91ac37 Mon Sep 17 00:00:00 2001 -From: Christian Heimes -Date: Tue, 21 Jun 2022 14:51:39 +0200 -Subject: [PATCH 7/9] gh-93839: Use load_package_tests() for testmock (GH-94055) - -Fixes failing tests on WebAssembly platforms. - -Automerge-Triggered-By: GH:tiran ---- - Lib/test/test_unittest/testmock/__init__.py | 17 +++-------------- - 1 file changed, 3 insertions(+), 14 deletions(-) - -diff --git a/Lib/test/test_unittest/testmock/__init__.py b/Lib/test/test_unittest/testmock/__init__.py -index 6ee60b2376..bc502ef32d 100644 ---- a/Lib/test/test_unittest/testmock/__init__.py -+++ b/Lib/test/test_unittest/testmock/__init__.py -@@ -1,17 +1,6 @@ --import os --import sys --import unittest -+import os.path -+from test.support import load_package_tests - - --here = os.path.dirname(__file__) --loader = unittest.defaultTestLoader -- - def load_tests(*args): -- suite = unittest.TestSuite() -- for fn in os.listdir(here): -- if fn.startswith("test") and fn.endswith(".py"): -- modname = "test.test_unittest.testmock." + fn[:-3] -- __import__(modname) -- module = sys.modules[modname] -- suite.addTest(loader.loadTestsFromModule(module)) -- return suite -+ return load_package_tests(os.path.dirname(__file__), *args) --- -2.29.2.windows.2 - diff --git a/recipes/recipes_emscripten/python/patches/0008-Move-test-directories.patch b/recipes/recipes_emscripten/python/patches/0008-Move-test-directories.patch deleted file mode 100644 index 7ca56f31b..000000000 --- a/recipes/recipes_emscripten/python/patches/0008-Move-test-directories.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4c71c808cc65ed6003b1e29d583c71586ebb36e1 Mon Sep 17 00:00:00 2001 -From: ryanking13 -Date: Wed, 25 Jan 2023 15:54:16 +0900 -Subject: [PATCH 8/9] Move test directories - ---- - Makefile.pre.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index b356f6293e..68c55a356a 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1932,8 +1932,7 @@ LIBSUBDIRS= asyncio \ - xmlrpc \ - zoneinfo \ - __phello__ --TESTSUBDIRS= ctypes/test \ -- distutils/tests \ -+TESTSUBDIRS= distutils/tests \ - idlelib/idle_test \ - lib2to3/tests \ - lib2to3/tests/data \ -@@ -2009,7 +2008,8 @@ TESTSUBDIRS= ctypes/test \ - test/ziptestdata \ - tkinter/test tkinter/test/test_tkinter \ - tkinter/test/test_ttk \ -- unittest/test unittest/test/testmock -+ test/test_ctypes \ -+ test/test_unittest test/test_unittest/testmock - - TEST_MODULES=@TEST_MODULES@ - libinstall: all $(srcdir)/Modules/xxmodule.c --- -2.29.2.windows.2 - diff --git a/recipes/recipes_emscripten/python/recipe.yaml b/recipes/recipes_emscripten/python/recipe.yaml index 3d5734b42..03c90180c 100644 --- a/recipes/recipes_emscripten/python/recipe.yaml +++ b/recipes/recipes_emscripten/python/recipe.yaml @@ -1,31 +1,62 @@ + context: - version: 3.11.3 + version: "3.13.1" name: python + ver2: "3.13" + ver2nd: ${{ version | version_to_buildstring}} + build_number: 1 + abi_tag: "cp${{ ver2nd }}" + package: - name: ${{name}} + name: python version: ${{ version }} source: - url: https://www.python.org/ftp/python/${{ version }}/Python-${{ version }}.tar.xz - sha256: 8a5db99c961a7ecf27c75956189c9602c968751f11dbeae2b900dbff1c085b5e - + sha256: 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 + patches: + - patches/0005-Fix-LONG_BIT-constant-to-be-always-32bit.patch build: - number: 25 - string: h_hash_25_cpython + number: ${{ build_number }} + string: h_${{ hash }}_${{build_number}}_${{ abi_tag }} requirements: build: - ${{ compiler("cxx") }} - ${{ compiler("c") }} - make + - autoconf + - nodejs + - ccache + - f2c + - pkg-config + - swig + - make + - cmake + - pkg-config + - texinfo + - autoconf + - automake + - libtool + - patch # only needed on MacOS + - sed # only needed on MacOS + - wget + - python=3.13 + run: + - python_abi ${{ ver2 }}.* *_${{ abi_tag }} + run_exports: + weak: + - python_abi ${{ ver2 }}.* *_${{ abi_tag }} + + tests: - script: - - test -f $PREFIX/include/python3.11/Python.h - - test -f $PREFIX/lib/python3.11/enum.py - - test -f $PREFIX/lib/python3.11/ast.py - - test -f $PREFIX/lib/libpython3.11.a - - test -f $PREFIX/bin/python3.11 + - test -f $PREFIX/include/python${{ver2}}/Python.h + - test -f $PREFIX/lib/python${{ver2}}/enum.py + - test -f $PREFIX/lib/python${{ver2}}/ast.py + - test -f $PREFIX/lib/libpython${{ver2}}.a + - test -f $PREFIX/bin/python${{ver2}} about: license: Python-2.0 diff --git a/recipes/recipes_emscripten/python_abi/recipe.yaml b/recipes/recipes_emscripten/python_abi/recipe.yaml index 39dfb424e..df2515779 100644 --- a/recipes/recipes_emscripten/python_abi/recipe.yaml +++ b/recipes/recipes_emscripten/python_abi/recipe.yaml @@ -1,14 +1,21 @@ context: name: python_abi - version: "3.11" + version: "3.13.1" # keep sync with python + ver2nd: ${{ version | version_to_buildstring}} + python_abi_tag: "cp${{ ver2nd }}" + build_num: 0 package: name: ${{ name|lower }} version: ${{ version }} build: - number: - string: "0_cp311" + number: ${{ build_num }} + string: ${{ build_num }}_${{ python_abi_tag }} + +requirements: + run_constraints: + python ${{ version }}.* *_${{ python_abi_tag }} about: license: BSD-3-Clause diff --git a/recipes/recipes_emscripten/sqlite/build.sh b/recipes/recipes_emscripten/sqlite/build.sh index e0210feed..140683ad5 100644 --- a/recipes/recipes_emscripten/sqlite/build.sh +++ b/recipes/recipes_emscripten/sqlite/build.sh @@ -1,82 +1,30 @@ #!/bin/bash # Prevent running ldconfig when cross-compiling. -if [[ "${BUILD}" != "${HOST}" ]]; then - echo "#!/usr/bin/env bash" > ldconfig - chmod +x ldconfig - export PATH=${PWD}:$PATH -fi +echo "#!/usr/bin/env bash" > ldconfig +chmod +x ldconfig +export PATH=${PWD}:$PATH -if [[ "$target_platform" != emscripten-* ]]; then +echo "HOST" $HOST +echo "BUILD" $BUILD - # Get an updated config.sub and config.guess - cp $BUILD_PREFIX/share/libtool/build-aux/config.* . +emconfigure ./configure --prefix=${PREFIX} \ + --build=${BUILD} \ + --host=none \ + --enable-threadsafe \ + --enable-shared=no \ + --disable-tcl \ + CFLAGS="${CFLAGS} -I${PREFIX}/include -fPIC" \ + LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \ + CPPFLAGS="-DSQLITE_OMIT_POPEN"; \ - export CPPFLAGS="${CPPFLAGS} -DSQLITE_ENABLE_COLUMN_METADATA=1 \ - -DSQLITE_ENABLE_UNLOCK_NOTIFY \ - -DSQLITE_ENABLE_DBSTAT_VTAB=1 \ - -DSQLITE_ENABLE_FTS3_TOKENIZER=1 \ - -DSQLITE_SECURE_DELETE \ - -DSQLITE_MAX_VARIABLE_NUMBER=250000 \ - -DSQLITE_MAX_EXPR_DEPTH=10000 \ - -DSQLITE_ENABLE_GEOPOLY \ - -DSQLITE_ENABLE_JSON1 \ - -DSQLITE_ENABLE_FTS5 \ - -DSQLITE_ENABLE_RTREE=1" - if [[ $target_platform =~ linux.* ]]; then - export CFLAGS="${CFLAGS} -DHAVE_PREAD64 -DHAVE_PWRITE64 " - fi +emmake make -j${CPU_COUNT} ${VERBOSE_AT} +emmake make install - if [[ "$target_platform" == "linux-ppc64le" ]]; then - export PPC64LE="--build=ppc64le-linux" - fi +# # We can remove this when we start using the new conda-build. +# find $PREFIX -name '*.la' -delete - - - ./configure --prefix=${PREFIX} \ - --build=${BUILD} \ - --host=${HOST} \ - --enable-threadsafe \ - --enable-shared=yes \ - --enable-readline \ - --disable-editline \ - --disable-static \ - --disable-tcl \ - CFLAGS="${CFLAGS} -I${PREFIX}/include" \ - LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \ - ${PPC64LE} - - make -j${CPU_COUNT} ${VERBOSE_AT} - make check - make install - - # We can remove this when we start using the new conda-build. - find $PREFIX -name '*.la' -delete - - -else - # emconfigure ./configure CFLAGS="$(PYTHON_CFLAGS)" CPPFLAGS="-DSQLITE_OMIT_POPEN"; \ - - emconfigure ./configure --prefix=${PREFIX} \ - --build=${BUILD} \ - --host=${HOST} \ - --enable-threadsafe \ - --enable-shared=no \ - --disable-tcl \ - CFLAGS="${CFLAGS} -I${PREFIX}/include -fPIC" \ - LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \ - CPPFLAGS="-DSQLITE_OMIT_POPEN"; \ - - - emmake make -j${CPU_COUNT} ${VERBOSE_AT} - emmake make install - - # # We can remove this when we start using the new conda-build. - # find $PREFIX -name '*.la' -delete - - -fi \ No newline at end of file diff --git a/recipes/recipes_emscripten/sqlite/patches/LICENSE b/recipes/recipes_emscripten/sqlite/patches/LICENSE deleted file mode 100644 index a612ad981..000000000 --- a/recipes/recipes_emscripten/sqlite/patches/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/recipes/recipes_emscripten/sqlite/patches/expose_symbols.patch b/recipes/recipes_emscripten/sqlite/patches/expose_symbols.patch deleted file mode 100644 index 9adac52af..000000000 --- a/recipes/recipes_emscripten/sqlite/patches/expose_symbols.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git sqlite3.c sqlite3.c -index 123c65e..7b22843 100644 ---- sqlite3.c -+++ sqlite3.c -@@ -258,6 +258,8 @@ - extern "C" { - #endif - -+// Always dll export, providing only a shared lib for sqlite. -+#define SQLITE_API __declspec( dllexport ) - - /* - ** Provide the ability to override linkage features of the interface. -diff --git sqlite3.h sqlite3.h -index 37d1024..abeca23 100644 ---- sqlite3.h -+++ sqlite3.h -@@ -41,6 +41,10 @@ - extern "C" { - #endif - -+#ifndef SQLITE_EXPORTS -+// Always dll import, providing only a shared lib for sqlite. -+#define SQLITE_API __declspec( dllimport ) -+#endif - - /* - ** Provide the ability to override linkage features of the interface. diff --git a/recipes/recipes_emscripten/sqlite/recipe.yaml b/recipes/recipes_emscripten/sqlite/recipe.yaml index a4477b7e2..1b742b6d6 100644 --- a/recipes/recipes_emscripten/sqlite/recipe.yaml +++ b/recipes/recipes_emscripten/sqlite/recipe.yaml @@ -1,5 +1,5 @@ context: - version: 3.37.2 + version: 3.47.2 package: name: sqlite @@ -7,12 +7,12 @@ package: source: - url: https://www.sqlite.org/2022/sqlite-autoconf-3370200.tar.gz - sha256: 4089a8d9b467537b3f246f217b84cd76e00b1d1a971fe5aca1e30e230e46b2d8 + url: https://www.sqlite.org/2024/sqlite-autoconf-3470200.tar.gz + sha256: f1b2ee412c28d7472bc95ba996368d6f0cdcf00362affdadb27ed286c179540b build: - number: 3 + number: 0 # run_exports: # # sometimes adds new symbols. Default behavior is OK. # # https://abi-laboratory.pro/tracker/timeline/sqlite/ diff --git a/recipes/recipes_emscripten/xeus-python/recipe.yaml b/recipes/recipes_emscripten/xeus-python/recipe.yaml index 7e66db54b..7ab297173 100644 --- a/recipes/recipes_emscripten/xeus-python/recipe.yaml +++ b/recipes/recipes_emscripten/xeus-python/recipe.yaml @@ -8,7 +8,7 @@ package: source: url: https://github.com/jupyter-xeus/xeus-python/archive/refs/tags/${{ version }}.tar.gz sha256: bb8858c9fa9f746b8dbd91aecc74fd5abd1b259a83fdd6d26315e4d793672393 - + # path: /Users/thorstenbeier/src/xeus-python build: number: 0 @@ -19,6 +19,7 @@ requirements: - cmake - ninja host: + - python - libpython - nlohmann_json - xeus diff --git a/recipes/recipes_emscripten/zlib/recipe.yaml b/recipes/recipes_emscripten/zlib/recipe.yaml index cdbfc2787..d45c42457 100644 --- a/recipes/recipes_emscripten/zlib/recipe.yaml +++ b/recipes/recipes_emscripten/zlib/recipe.yaml @@ -19,6 +19,7 @@ requirements: - ${{ compiler("c") }} - cmake - ninja + about: summary: Massively spiffy yet delicately unobtrusive compression library license_family: Other From e443040a3b8123a052b8e004bb2fde2275ce9edd Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 8 Jan 2025 09:37:02 +0100 Subject: [PATCH 14/20] cleanup --- emci/find_recipes_with_changes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emci/find_recipes_with_changes.py b/emci/find_recipes_with_changes.py index 28df09705..1481e0d10 100644 --- a/emci/find_recipes_with_changes.py +++ b/emci/find_recipes_with_changes.py @@ -8,8 +8,8 @@ def find_recipes_with_changes(old, new): recipes_with_changes = {k: set() for k in RECIPES_SUBDIR_MAPPING.keys()} # print("recipes_with_changes", recipes_with_changes) for subdir in RECIPES_SUBDIR_MAPPING.keys(): - # if subdir == "recipes": - # continue + if subdir == "recipes": + continue for file_with_change in files_with_changes: if file_with_change.startswith(f"recipes/{subdir}/"): # print(file_with_change) From 34d11c0efac087a480ef457880f71995a9d5a95b Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 8 Jan 2025 09:45:07 +0100 Subject: [PATCH 15/20] cleanup --- recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml index 27fb71f88..54de7a679 100644 --- a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml +++ b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml @@ -7,18 +7,19 @@ package: version: ${{ version }} build: - number: 0 + number: 1 requirements: run: - coreutils - crossenv >=1.2 - - emscripten_emscripten-wasm32 + - ${{ compiler('cxx') }} + - ${{ compiler('c') }} - rsync - sed - python - - setuptools #<60.0 + - setuptools - pip about: From f0697cba6de11ffecb58a7bc330051a47a38b83b Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 8 Jan 2025 09:48:12 +0100 Subject: [PATCH 16/20] cleanup --- conda_build_config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/conda_build_config.yaml b/conda_build_config.yaml index 1cdf19b33..2abb2b3af 100644 --- a/conda_build_config.yaml +++ b/conda_build_config.yaml @@ -212,12 +212,10 @@ pin_run_as_build: max_pin: x.x zeromq: max_pin: x.x - python: # Pinning packages - # blas libblas: - 3.8 *netlib From 4ca2dec4db2c187044cff4ad434a023bddf8f4f4 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 8 Jan 2025 09:54:33 +0100 Subject: [PATCH 17/20] cleanup --- conda_build_config.yaml | 1 - emci/find_recipes_with_changes.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/conda_build_config.yaml b/conda_build_config.yaml index 2abb2b3af..4e087282f 100644 --- a/conda_build_config.yaml +++ b/conda_build_config.yaml @@ -213,7 +213,6 @@ pin_run_as_build: zeromq: max_pin: x.x - # Pinning packages # blas diff --git a/emci/find_recipes_with_changes.py b/emci/find_recipes_with_changes.py index 1481e0d10..73b2fef2f 100644 --- a/emci/find_recipes_with_changes.py +++ b/emci/find_recipes_with_changes.py @@ -8,8 +8,6 @@ def find_recipes_with_changes(old, new): recipes_with_changes = {k: set() for k in RECIPES_SUBDIR_MAPPING.keys()} # print("recipes_with_changes", recipes_with_changes) for subdir in RECIPES_SUBDIR_MAPPING.keys(): - if subdir == "recipes": - continue for file_with_change in files_with_changes: if file_with_change.startswith(f"recipes/{subdir}/"): # print(file_with_change) From 4df3116177410166122b962402357c73ba0429ce Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 8 Jan 2025 09:55:59 +0100 Subject: [PATCH 18/20] cleanup --- recipes/recipes_emscripten/cffi/build.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/recipes/recipes_emscripten/cffi/build.sh b/recipes/recipes_emscripten/cffi/build.sh index cf545cb47..977f38bd6 100644 --- a/recipes/recipes_emscripten/cffi/build.sh +++ b/recipes/recipes_emscripten/cffi/build.sh @@ -1,16 +1,5 @@ #!/bin/bash - - - - -# side module -# export EM_FORGE_SIDE_MODULE_LDFLAGS="${LDFLAGS_BASE} -s SIDE_MODULE=1" -# export EM_FORGE_SIDE_MODULE_CFLAGS="${EM_FORGE_CFLAGS_BASE} -I${PREFIX}/include" - -# # wasm bigint -# export LDFLAGS="$LDFLAGS -sWASM_BIGINT" - echo "EM_FORGE_SIDE_MODULE_LDFLAGS" $EM_FORGE_SIDE_MODULE_LDFLAGS echo "EM_FORGE_SIDE_MODULE_CFLAGS" $EM_FORGE_SIDE_MODULE_CFLAGS From 2f7f67b0e6d78cf99c6bcfd2793c3e2f7153bc55 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 8 Jan 2025 15:16:17 +0100 Subject: [PATCH 19/20] wip --- .../activate-cross-python.sh | 19 +++++++++++++++++++ .../recipe.yaml | 9 ++++++--- .../emscripten_emscripten-wasm32/recipe.yaml | 2 +- recipes/recipes_emscripten/cffi/build.sh | 4 ---- recipes/recipes_emscripten/cffi/recipe.yaml | 2 -- recipes/recipes_emscripten/contourpy/build.sh | 8 +++++++- .../contourpy/emscripten.meson.cross | 1 + .../recipes_emscripten/contourpy/recipe.yaml | 3 ++- .../recipes_emscripten/kiwisolver/build.sh | 2 +- recipes/recipes_emscripten/libpng/build.sh | 1 + .../matplotlib/build-base.sh | 2 +- .../recipes_emscripten/matplotlib/recipe.yaml | 2 +- recipes/recipes_emscripten/pillow/recipe.yaml | 6 +----- recipes/recipes_emscripten/pillow/setup.py | 10 ++++++---- recipes/recipes_emscripten/regex/recipe.yaml | 1 + 15 files changed, 48 insertions(+), 24 deletions(-) diff --git a/recipes/recipes/cross-python_emscripten-wasm32/activate-cross-python.sh b/recipes/recipes/cross-python_emscripten-wasm32/activate-cross-python.sh index ed791a6b9..155295366 100644 --- a/recipes/recipes/cross-python_emscripten-wasm32/activate-cross-python.sh +++ b/recipes/recipes/cross-python_emscripten-wasm32/activate-cross-python.sh @@ -1,4 +1,17 @@ #!/bin/bash + +# echo "ACTIVATE CROSS PYTHON in $BUILD_PREFIX" $BUILD_PREFIX $$BUILD_PREFIX +# echo $BUILD_PREFIX + +# if [ -z ${BUILD_PREFIX+x} ]; then echo "BUILD_PREFIX is unset"; else echo "BUILD_PREFIX is set to '$BUILD_PREFIX'"; fi + + +# $BUILD_PREFIX/bin/python3 -c "import sys;print(sys.executable)" +# python + +# # probe if cross-env is already installed +# $BUILD_PREFIX/bin/python3 -m crossenv + OLD_PYTHON=$PYTHON unset PYTHON MYPYTHON=$BUILD_PREFIX/bin/python @@ -11,6 +24,11 @@ mkdir -p $PREFIX/bin cp $BUILD_PREFIX/bin/python3 $PREFIX/bin +# echo "probe" +# # probe if cross-env is already installed +# $BUILD_PREFIX/bin/python3 -m crossenv + +# echo "probe done" @@ -21,6 +39,7 @@ source $CONDA_PREFIX/etc/conda/activate.d/emscripten_emscripten-wasm32_activate. if [[ "${CONDA_BUILD:-0}" == "1" && "${CONDA_BUILD_STATE}" != "TEST" ]]; then echo "Setting up cross-python" PY_VER=$($BUILD_PREFIX/bin/python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))") + echo "PY_VER=$PY_VER" if [ -d "$PREFIX/lib_pypy" ]; then sysconfigdata_fn=$(find "$PREFIX/lib_pypy/" -name "_sysconfigdata_*.py" -type f) elif [ -d "$PREFIX/lib/pypy$PY_VER" ]; then diff --git a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml index 54de7a679..2e374004a 100644 --- a/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml +++ b/recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml @@ -14,13 +14,16 @@ requirements: run: - coreutils - crossenv >=1.2 - - ${{ compiler('cxx') }} - - ${{ compiler('c') }} + - emscripten_emscripten-wasm32 - rsync - sed - - python + - python =3.13 - setuptools - pip + + run_exports: + strong: + - emscripten-abi >=3.1.73,<3.1.74.0a0 about: summary: cross-python diff --git a/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml b/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml index cfd4acd09..0626a79e4 100644 --- a/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml +++ b/recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml @@ -3,7 +3,7 @@ context: version: 3.1.73 build: - number: 3 + number: 4 outputs: diff --git a/recipes/recipes_emscripten/cffi/build.sh b/recipes/recipes_emscripten/cffi/build.sh index 977f38bd6..1928be596 100644 --- a/recipes/recipes_emscripten/cffi/build.sh +++ b/recipes/recipes_emscripten/cffi/build.sh @@ -1,9 +1,5 @@ #!/bin/bash -echo "EM_FORGE_SIDE_MODULE_LDFLAGS" $EM_FORGE_SIDE_MODULE_LDFLAGS -echo "EM_FORGE_SIDE_MODULE_CFLAGS" $EM_FORGE_SIDE_MODULE_CFLAGS - - LDFLAGS="$LDFLAGS $EM_FORGE_SIDE_MODULE_LDFLAGS" CFLAGS="$CFLAGS $EM_FORGE_SIDE_MODULE_CFLAGS" diff --git a/recipes/recipes_emscripten/cffi/recipe.yaml b/recipes/recipes_emscripten/cffi/recipe.yaml index 7ce0ba6f4..2c71c8df8 100644 --- a/recipes/recipes_emscripten/cffi/recipe.yaml +++ b/recipes/recipes_emscripten/cffi/recipe.yaml @@ -8,8 +8,6 @@ package: source: - url: https://pypi.io/packages/source/c/cffi/cffi-${{ version }}.tar.gz sha256: 1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824 - # patches: - # - patches/libffi-config.patch - path: setup.py build: diff --git a/recipes/recipes_emscripten/contourpy/build.sh b/recipes/recipes_emscripten/contourpy/build.sh index 2523ecd98..d87944db2 100644 --- a/recipes/recipes_emscripten/contourpy/build.sh +++ b/recipes/recipes_emscripten/contourpy/build.sh @@ -1,5 +1,11 @@ cp $RECIPE_DIR/emscripten.meson.cross $SRC_DIR -echo "python = '${PYTHON}'" >> $SRC_DIR/emscripten.meson.cross +# write out the cross file +sed "s|@(PYTHON)|${PYTHON}|g" $SRC_DIR/emscripten.meson.cross > $SRC_DIR/emscripten.meson.new +mv $SRC_DIR/emscripten.meson.new $SRC_DIR/emscripten.meson.cross + +cat $SRC_DIR/emscripten.meson.cross + +export PYBIND11_INCLUDE_DIR=$PREFIX/include ${PYTHON} -m pip install . -vvv --no-deps --no-build-isolation \ -Csetup-args="--cross-file=$SRC_DIR/emscripten.meson.cross" diff --git a/recipes/recipes_emscripten/contourpy/emscripten.meson.cross b/recipes/recipes_emscripten/contourpy/emscripten.meson.cross index 28bd46155..186703176 100644 --- a/recipes/recipes_emscripten/contourpy/emscripten.meson.cross +++ b/recipes/recipes_emscripten/contourpy/emscripten.meson.cross @@ -14,3 +14,4 @@ endian = 'little' [binaries] exe_wrapper = 'node' pkgconfig = 'pkg-config' +python = '@(PYTHON)' \ No newline at end of file diff --git a/recipes/recipes_emscripten/contourpy/recipe.yaml b/recipes/recipes_emscripten/contourpy/recipe.yaml index 0286e5904..4ccb39021 100644 --- a/recipes/recipes_emscripten/contourpy/recipe.yaml +++ b/recipes/recipes_emscripten/contourpy/recipe.yaml @@ -19,8 +19,9 @@ requirements: - cross-python_${{target_platform}} - meson-python - pip >=24 - - pybind11 <2.13.6 + - pkg-config host: + - pybind11 - python run: - numpy diff --git a/recipes/recipes_emscripten/kiwisolver/build.sh b/recipes/recipes_emscripten/kiwisolver/build.sh index 05e2f566d..bcbc60c5f 100644 --- a/recipes/recipes_emscripten/kiwisolver/build.sh +++ b/recipes/recipes_emscripten/kiwisolver/build.sh @@ -1,2 +1,2 @@ #!/bin/bash -${PYTHON} setup.py install +${PYTHON} -m pip install . -vvv --no-deps --no-build-isolation diff --git a/recipes/recipes_emscripten/libpng/build.sh b/recipes/recipes_emscripten/libpng/build.sh index a019296f9..3f2488c8b 100644 --- a/recipes/recipes_emscripten/libpng/build.sh +++ b/recipes/recipes_emscripten/libpng/build.sh @@ -13,6 +13,7 @@ mkdir -p build cd build emconfigure ../configure --prefix=$PREFIX \ + --host=wasm32-unknown-emscripten \ --with-zlib-prefix=$PREFIX \ --disable-shared # NOTE: to enable shared, the -shared flag needs to be replaced with SIDE_MODULE diff --git a/recipes/recipes_emscripten/matplotlib/build-base.sh b/recipes/recipes_emscripten/matplotlib/build-base.sh index 16e4f6255..c10466938 100644 --- a/recipes/recipes_emscripten/matplotlib/build-base.sh +++ b/recipes/recipes_emscripten/matplotlib/build-base.sh @@ -2,7 +2,7 @@ # Set up the cross file # Note: the include folder is moved to `$BUILD_PREFIX` by the cross-python activation script -export NUMPY_INCLUDE_DIR="$BUILD_PREFIX/lib/python${PY_VER}/site-packages/numpy/core/include" +export NUMPY_INCLUDE_DIR="$BUILD_PREFIX/lib/python${PY_VER}/site-packages/numpy/_core/include" # write out the cross file sed "s|@(NUMPY_INCLUDE_DIR)|${NUMPY_INCLUDE_DIR}|g" $RECIPE_DIR/emscripten.meson.cross > $SRC_DIR/emscripten.meson.cross.temp diff --git a/recipes/recipes_emscripten/matplotlib/recipe.yaml b/recipes/recipes_emscripten/matplotlib/recipe.yaml index 5d6e3b8a9..a06e865dc 100644 --- a/recipes/recipes_emscripten/matplotlib/recipe.yaml +++ b/recipes/recipes_emscripten/matplotlib/recipe.yaml @@ -27,7 +27,7 @@ outputs: - ${{ compiler('cxx') }} - pkg-config - meson-python - + - numpy - setuptools_scm_git_archive # to template the emscripten.meson.cross file diff --git a/recipes/recipes_emscripten/pillow/recipe.yaml b/recipes/recipes_emscripten/pillow/recipe.yaml index 8db695906..3bd0655c0 100644 --- a/recipes/recipes_emscripten/pillow/recipe.yaml +++ b/recipes/recipes_emscripten/pillow/recipe.yaml @@ -33,9 +33,5 @@ tests: requirements: build: - pytester - - python < 3.12 run: - - pytest < 8 - - pytester-run - - emscripten-abi = 3.1.45 - - python < 3.12 + - pytester-run \ No newline at end of file diff --git a/recipes/recipes_emscripten/pillow/setup.py b/recipes/recipes_emscripten/pillow/setup.py index e96c7947b..abd6ed67d 100644 --- a/recipes/recipes_emscripten/pillow/setup.py +++ b/recipes/recipes_emscripten/pillow/setup.py @@ -21,10 +21,12 @@ def get_version(): - version_file = "src/PIL/_version.py" - with open(version_file) as f: - exec(compile(f.read(), version_file, "exec")) - return locals()["__version__"] + # version_file = "src/PIL/_version.py" + # with open(version_file) as f: + # exec(compile(f.read(), version_file, "exec")) + # return locals()["__version__"] + return "10.3.0" + PILLOW_VERSION = get_version() diff --git a/recipes/recipes_emscripten/regex/recipe.yaml b/recipes/recipes_emscripten/regex/recipe.yaml index 309bdc2d1..a20f759c4 100644 --- a/recipes/recipes_emscripten/regex/recipe.yaml +++ b/recipes/recipes_emscripten/regex/recipe.yaml @@ -16,6 +16,7 @@ build: requirements: build: - python + - crossenv >=1.2 - cross-python_emscripten-wasm32 - ${{ compiler("c") }} - pip From b70c467dfbd0093ffa82d07f508dd04ff503f45f Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Thu, 9 Jan 2025 12:29:20 +0100 Subject: [PATCH 20/20] wip --- recipes/recipes_emscripten/pillow/build.sh | 7 +++++++ recipes/recipes_emscripten/pillow/recipe.yaml | 2 +- recipes/recipes_emscripten/pillow/setup.py | 9 ++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/recipes/recipes_emscripten/pillow/build.sh b/recipes/recipes_emscripten/pillow/build.sh index 91c857019..d37203de1 100644 --- a/recipes/recipes_emscripten/pillow/build.sh +++ b/recipes/recipes_emscripten/pillow/build.sh @@ -7,6 +7,13 @@ $EMSCRIPTEN_FORGE_EMSDK_DIR/upstream/emscripten/embuilder build libjpeg --pic export LDFLAGS="${LDFLAGS} -s USE_LIBJPEG" export CFLAGS="${CFLAGS} -s USE_ZLIB=1 -s USE_LIBJPEG=1 -s USE_FREETYPE=1 -s SIDE_MODULE=1" + + + +# replace version in setup.py +sed -i.bak "s/PILLOW_PACKAGE_VERSION_PLACEHOLDER/$PKG_VERSION/g" setup.py + + ${PYTHON} -m pip install . diff --git a/recipes/recipes_emscripten/pillow/recipe.yaml b/recipes/recipes_emscripten/pillow/recipe.yaml index 3bd0655c0..837098c63 100644 --- a/recipes/recipes_emscripten/pillow/recipe.yaml +++ b/recipes/recipes_emscripten/pillow/recipe.yaml @@ -14,7 +14,7 @@ source: - path: setup.py build: - number: 1 + number: 2 requirements: build: diff --git a/recipes/recipes_emscripten/pillow/setup.py b/recipes/recipes_emscripten/pillow/setup.py index abd6ed67d..522e62554 100644 --- a/recipes/recipes_emscripten/pillow/setup.py +++ b/recipes/recipes_emscripten/pillow/setup.py @@ -21,11 +21,10 @@ def get_version(): - # version_file = "src/PIL/_version.py" - # with open(version_file) as f: - # exec(compile(f.read(), version_file, "exec")) - # return locals()["__version__"] - return "10.3.0" + + ver = "PILLOW_PACKAGE_VERSION_PLACEHOLDER" + print(f"Version: {ver}") + return ver