diff --git a/CHANGELOG.md b/CHANGELOG.md index bbc8fcd3..8d3266ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,20 @@ -0.18.2 +0.19.0 ====== * Update python 3.10 to 3.10.17: https://www.python.org/downloads/release/python-31017/ * Update python 3.13 to 3.13.3 * Update libxcrypt to 4.4.38 +* Update libffi to 3.4.8 * Update gdbm to 1.25 +* Include libstdc++ in relenv lib +* Update environment with buildenv when RELENV_BUILDENV environment is set. +* Include libstdc++ in relenv's lib directory instead of passing + -static-libstdc++ +* Clean up duplicate options in sysconfig data. +* Work with setuptools >= 72.2.0 +* Default to positition indipendent code gen +* Add --download-only option to build 0.18.1 diff --git a/relenv/build/__init__.py b/relenv/build/__init__.py index 047fcc3f..828dbf30 100644 --- a/relenv/build/__init__.py +++ b/relenv/build/__init__.py @@ -86,6 +86,12 @@ def setup_parser(subparsers): action="store_true", help="Force downloading source tarballs even if they exist", ) + build_subparser.add_argument( + "--download-only", + default=False, + action="store_true", + help="Stop after downloading source tarballs", + ) build_subparser.add_argument( "--step", dest="steps", @@ -179,6 +185,7 @@ def signal_handler(signal, frame): clean=args.clean, cleanup=not args.no_cleanup, force_download=args.force_download, + download_only=args.download_only, show_ui=show_ui, log_level=args.log_level.upper(), ) diff --git a/relenv/build/common.py b/relenv/build/common.py index 1016e3e1..226a4529 100644 --- a/relenv/build/common.py +++ b/relenv/build/common.py @@ -801,7 +801,6 @@ def __init__( recipies=None, build_default=build_default, populate_env=populate_env, - force_download=False, arch="x86_64", version="", ): @@ -824,7 +823,6 @@ def __init__( self.build_default = build_default self.populate_env = populate_env - self.force_download = force_download self.toolchains = get_toolchain(root=self.dirs.root) self.set_arch(self.arch) @@ -842,7 +840,6 @@ def copy(self, version, checksum): recipies, self.build_default, self.populate_env, - self.force_download, self.arch, version, ) @@ -1207,6 +1204,7 @@ def __call__( clean=True, cleanup=True, force_download=False, + download_only=False, show_ui=False, log_level="WARNING", ): @@ -1267,6 +1265,8 @@ def __call__( # Start a process for each build passing it an event used to notify each # process if it's dependencies have finished. self.download_files(steps, force_download=force_download, show_ui=show_ui) + if download_only: + return self.build(steps, cleanup, show_ui=show_ui, log_level=log_level) def check_versions(self): @@ -1407,7 +1407,13 @@ def install_runtime(sitepackages): relenv = sitepackages / "relenv" os.makedirs(relenv, exist_ok=True) - for name in ["runtime.py", "relocate.py", "common.py", "__init__.py"]: + for name in [ + "runtime.py", + "relocate.py", + "common.py", + "buildenv.py", + "__init__.py", + ]: src = MODULE_DIR / name dest = relenv / name with io.open(src, "r") as rfp: @@ -1495,6 +1501,15 @@ def find_pythonlib(libdir): format_shebang("../../../bin/python3"), ) + shutil.copy( + pathlib.Path(dirs.toolchain) + / env["RELENV_HOST"] + / "sysroot" + / "lib" + / "libstdc++.so.6", + libdir, + ) + # Moved in python 3.13 or removed? if (pymodules / "cgi.py").exists(): patch_shebang( diff --git a/relenv/build/darwin.py b/relenv/build/darwin.py index f6f50f7a..1ac823b3 100644 --- a/relenv/build/darwin.py +++ b/relenv/build/darwin.py @@ -87,8 +87,7 @@ def build_python(env, dirs, logfp): build.add( "XZ", download={ - "fallback_url": "http://tukaani.org/xz/xz-{version}.tar.gz", - "url": "https://woz.io/relenv/dependencies/xz-{version}.tar.gz", + "url": "http://tukaani.org/xz/xz-{version}.tar.gz", "version": "5.6.2", "checksum": "0d6b10e4628fe08e19293c65e8dbcaade084a083", }, diff --git a/relenv/build/linux.py b/relenv/build/linux.py index 6c74b68a..ce9f77ae 100644 --- a/relenv/build/linux.py +++ b/relenv/build/linux.py @@ -35,38 +35,36 @@ def populate_env(env, dirs): :type dirs: ``relenv.build.common.Dirs`` """ # CC and CXX need to be to have the full path to the executable - env["CC"] = "{}/bin/{}-gcc -no-pie".format(dirs.toolchain, env["RELENV_HOST"]) - env["CXX"] = "{}/bin/{}-g++ -no-pie".format(dirs.toolchain, env["RELENV_HOST"]) + env["CC"] = f"{dirs.toolchain}/bin/{env['RELENV_HOST']}-gcc" + env["CXX"] = f"{dirs.toolchain}/bin/{env['RELENV_HOST']}-g++" # Add our toolchain binaries to the path. We also add the bin directory of # our prefix so that libtirpc can find krb5-config - env["PATH"] = "{}/bin/:{}/bin/:{PATH}".format(dirs.toolchain, dirs.prefix, **env) + env["PATH"] = f"{dirs.toolchain}/bin/:{dirs.prefix}/bin/:{env['PATH']}" ldflags = [ "-Wl,--build-id=sha1", - "-Wl,--rpath={prefix}/lib", - "-L{prefix}/lib", - "-L{}/{RELENV_HOST}/sysroot/lib".format(dirs.toolchain, **env), - "-static-libstdc++", + f"-Wl,--rpath={dirs.prefix}/lib", + f"-L{dirs.prefix}/lib", + f"-L{dirs.toolchain}/{env['RELENV_HOST']}/sysroot/lib", ] - env["LDFLAGS"] = " ".join(ldflags).format(prefix=dirs.prefix) + env["LDFLAGS"] = " ".join(ldflags) cflags = [ "-g", - "-I{prefix}/include", - "-I{prefix}/include/readline", - "-I{prefix}/include/ncursesw", - "-I{}/{RELENV_HOST}/sysroot/usr/include".format(dirs.toolchain, **env), + f"-I{dirs.prefix}/include", + f"-I{dirs.prefix}/include/readline", + f"-I{dirs.prefix}/include/ncursesw", + f"-I{dirs.toolchain}/{env['RELENV_HOST']}/sysroot/usr/include", ] - env["CFLAGS"] = " ".join(cflags).format(prefix=dirs.prefix) + env["CFLAGS"] = " ".join(cflags) # CPPFLAGS are needed for Python's setup.py to find the 'nessicery bits' # for things like zlib and sqlite. cpplags = [ - "-I{prefix}/include", - "-I{prefix}/include/readline", - "-I{prefix}/include/ncursesw", - "-I{}/{RELENV_HOST}/sysroot/usr/include".format(dirs.toolchain, **env), + f"-I{dirs.prefix}/include", + f"-I{dirs.prefix}/include/readline", + f"-I{dirs.prefix}/include/ncursesw", + f"-I{dirs.toolchain}/{env['RELENV_HOST']}/sysroot/usr/include", ] - env["CPPFLAGS"] = " ".join(cpplags).format(prefix=dirs.prefix) - env["CXXFLAGS"] = " ".join(cpplags).format(prefix=dirs.prefix) - env["LD_LIBRARY_PATH"] = "{prefix}/lib" + # env["CXXFLAGS"] = " ".join(cpplags) + env["CPPFLAGS"] = " ".join(cpplags) env["PKG_CONFIG_PATH"] = f"{dirs.prefix}/lib/pkgconfig" @@ -85,12 +83,12 @@ def build_bzip2(env, dirs, logfp): [ "make", "-j8", - "PREFIX={}".format(dirs.prefix), - "LDFLAGS={}".format(env["LDFLAGS"]), + f"PREFIX={dirs.prefix}", + f"LDFLAGS={env['LDFLAGS']}", "CFLAGS=-fPIC", - "CC={}".format(env["CC"]), - "BUILD={}".format("x86_64-linux-gnu"), - "HOST={}".format(env["RELENV_HOST"]), + f"CC={env['CC']}", + "BUILD=x86_64-linux-gnu", + f"HOST={env['RELENV_HOST']}", "install", ], env=env, @@ -102,10 +100,10 @@ def build_bzip2(env, dirs, logfp): "make", "-f", "Makefile-libbz2_so", - "CC={}".format(env["CC"]), - "LDFLAGS={}".format(env["LDFLAGS"]), - "BUILD={}".format("x86_64-linux-gnu"), - "HOST={}".format(env["RELENV_HOST"]), + f"CC={env['CC']}", + f"LDFLAGS={env['LDFLAGS']}", + "BUILD=x86_64-linux-gnu", + f"HOST={env['RELENV_HOST']}", ], env=env, stderr=logfp, @@ -128,10 +126,10 @@ def build_libxcrypt(env, dirs, logfp): runcmd( [ "./configure", - "--prefix={}".format(dirs.prefix), + f"--prefix={dirs.prefix}", # "--enable-libgdbm-compat", - "--build={}".format(env["RELENV_BUILD"]), - "--host={}".format(env["RELENV_HOST"]), + f"--build={env['RELENV_BUILD']}", + f"--host={env['RELENV_HOST']}", ], env=env, stderr=logfp, @@ -155,10 +153,10 @@ def build_gdbm(env, dirs, logfp): runcmd( [ "./configure", - "--prefix={}".format(dirs.prefix), + f"--prefix={dirs.prefix}", "--enable-libgdbm-compat", - "--build={}".format(env["RELENV_BUILD"]), - "--host={}".format(env["RELENV_HOST"]), + f"--build={env['RELENV_BUILD']}", + f"--host={env['RELENV_HOST']}", ], env=env, stderr=logfp, @@ -205,19 +203,20 @@ def build_ncurses(env, dirs, logfp): "--disable-stripping", f"--with-pkg-config={dirs.prefix}/lib/pkgconfig", "--enable-pc-files", - "--build={}".format(env["RELENV_BUILD"]), - "--host={}".format(env["RELENV_HOST"]), + f"--build={env['RELENV_BUILD']}", + f"--host={env['RELENV_HOST']}", ], env=env, stderr=logfp, stdout=logfp, ) runcmd(["make", "-j8"], env=env, stderr=logfp, stdout=logfp) + ticdir = str(pathlib.Path(dirs.tmpbuild) / "progs" / "tic") runcmd( [ "make", - "DESTDIR={}".format(dirs.prefix), - "TIC_PATH={}".format(str(pathlib.Path(dirs.tmpbuild) / "progs" / "tic")), + f"DESTDIR={dirs.prefix}", + f"TIC_PATH={ticdir}", "install", ], env=env, @@ -240,12 +239,12 @@ def build_readline(env, dirs, logfp): env["LDFLAGS"] = f"{env['LDFLAGS']} -ltinfow" cmd = [ "./configure", - "--prefix={}".format(dirs.prefix), + f"--prefix={dirs.prefix}", ] if env["RELENV_HOST"].find("linux") > -1: cmd += [ - "--build={}".format(env["RELENV_BUILD"]), - "--host={}".format(env["RELENV_HOST"]), + f"--build={env['RELENV_BUILD']}", + f"--host={env['RELENV_HOST']}", ] runcmd(cmd, env=env, stderr=logfp, stdout=logfp) runcmd(["make", "-j8"], env=env, stderr=logfp, stdout=logfp) @@ -266,10 +265,10 @@ def build_libffi(env, dirs, logfp): runcmd( [ "./configure", - "--prefix={}".format(dirs.prefix), + f"--prefix={dirs.prefix}", "--disable-multi-os-directory", - "--build={}".format(env["RELENV_BUILD"]), - "--host={}".format(env["RELENV_HOST"]), + f"--build={env['RELENV_BUILD']}", + f"--host={env['RELENV_HOST']}", ], env=env, stderr=logfp, @@ -294,12 +293,12 @@ def build_zlib(env, dirs, logfp): :param logfp: A handle for the log file :type logfp: file """ - env["CFLAGS"] = "-fPIC {}".format(env["CFLAGS"]) + env["CFLAGS"] = f"-fPIC {env['CFLAGS']}" runcmd( [ "./configure", - "--prefix={}".format(dirs.prefix), - "--libdir={}/lib".format(dirs.prefix), + f"--prefix={dirs.prefix}", + f"--libdir={dirs.prefix}/lib", "--shared", ], env=env, @@ -329,11 +328,11 @@ def build_krb(env, dirs, logfp): runcmd( [ "./configure", - "--prefix={}".format(dirs.prefix), + f"--prefix={dirs.prefix}", "--without-system-verto", "--without-libedit", - "--build={}".format(env["RELENV_BUILD"]), - "--host={}".format(env["RELENV_HOST"]), + f"--build={env['RELENV_BUILD']}", + f"--host={env['RELENV_HOST']}", ], env=env, stderr=logfp, @@ -354,9 +353,9 @@ def build_python(env, dirs, logfp): :param logfp: A handle for the log file :type logfp: file """ - env["LDFLAGS"] = "-Wl,--rpath={prefix}/lib {ldflags}".format( - prefix=dirs.prefix, ldflags=env["LDFLAGS"] - ) + ldflagopt = f"-Wl,--rpath={dirs.prefix}/lib" + if ldflagopt not in env["LDFLAGS"]: + env["LDFLAGS"] = f"{ldflagopt} {env['LDFLAGS']}" # Needed when using a toolchain even if build and host match. runcmd( @@ -433,6 +432,8 @@ def build_python(env, dirs, logfp): with io.open("Modules/Setup", "a+") as fp: fp.seek(0, io.SEEK_END) fp.write("*disabled*\n" "_tkinter\n" "nsl\n" "nis\n") + for _ in ["LDFLAGS", "CFLAGS", "CPPFLAGS", "CXX", "CC"]: + env.pop(_) runcmd(["make", "-j8"], env=env, stderr=logfp, stdout=logfp) runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp) @@ -451,7 +452,6 @@ def build_python(env, dirs, logfp): build_func=build_openssl, download={ "url": "https://github.com/openssl/openssl/releases/download/openssl-{version}/openssl-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/openssl-{version}.tar.gz", "version": "3.2.4", "checksum": "2247802a1193c0f8eb41c870e8de45a2241422d5", "checkfunc": tarball_version, @@ -466,7 +466,6 @@ def build_python(env, dirs, logfp): wait_on=["openssl"], download={ "url": "https://www.openssl.org/source/openssl-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/openssl-{version}.tar.gz", "version": "3.0.8", "checksum": "580d8a7232327fe1fa6e7db54ac060d4321f40ab", "checkfunc": tarball_version, @@ -490,7 +489,6 @@ def build_python(env, dirs, logfp): "XZ", download={ "url": "http://tukaani.org/xz/xz-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/xz-{version}.tar.gz", "version": "5.6.2", "checksum": "0d6b10e4628fe08e19293c65e8dbcaade084a083", "checkfunc": tarball_version, @@ -502,7 +500,6 @@ def build_python(env, dirs, logfp): build_func=build_sqlite, download={ "url": "https://sqlite.org/2024/sqlite-autoconf-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/sqlite-autoconf-{version}.tar.gz", "version": "3460100", "checksum": "1fdbada080f3285ac864c314bfbfc581b13e804b", "checkfunc": sqlite_version, @@ -515,7 +512,6 @@ def build_python(env, dirs, logfp): build_func=build_bzip2, download={ "url": "https://sourceware.org/pub/bzip2/bzip2-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/bzip2-{version}.tar.gz", "version": "1.0.8", "checksum": "bf7badf7e248e0ecf465d33c2f5aeec774209227", "checkfunc": tarball_version, @@ -527,7 +523,6 @@ def build_python(env, dirs, logfp): build_func=build_gdbm, download={ "url": "https://ftp.gnu.org/gnu/gdbm/gdbm-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/gdbm-{version}.tar.gz", "version": "1.25", "checksum": "d55bdf2bb5f92f80006166dd8a8323cb2a428bd1", "checkfunc": tarball_version, @@ -539,7 +534,6 @@ def build_python(env, dirs, logfp): build_func=build_ncurses, download={ "url": "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/ncurses-{version}.tar.gz", # XXX: Need to work out tinfo linkage # "version": "6.5", # "checksum": "cde3024ac3f9ef21eaed6f001476ea8fffcaa381", @@ -554,9 +548,8 @@ def build_python(env, dirs, logfp): build_libffi, download={ "url": "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/libffi-{version}.tar.gz", - "version": "3.4.7", - "checksum": "b07136211f47fa30c0512ebd7484fde724978d99", + "version": "3.4.8", + "checksum": "6930b77aebe2465a8e1a8617c4c9a8fa3199b256", "checkfunc": github_version, "checkurl": "https://github.com/libffi/libffi/releases/", }, @@ -567,7 +560,6 @@ def build_python(env, dirs, logfp): build_zlib, download={ "url": "https://zlib.net/fossils/zlib-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/zlib-{version}.tar.gz", "version": "1.3.1", "checksum": "f535367b1a11e2f9ac3bec723fb007fbc0d189e5", "checkfunc": tarball_version, @@ -578,7 +570,6 @@ def build_python(env, dirs, logfp): "uuid", download={ "url": "https://sourceforge.net/projects/libuuid/files/libuuid-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/libuuid-{version}.tar.gz", "version": "1.0.3", "checksum": "46eaedb875ae6e63677b51ec583656199241d597", "checkfunc": uuid_version, @@ -591,7 +582,6 @@ def build_python(env, dirs, logfp): wait_on=["openssl"], download={ "url": "https://kerberos.org/dist/krb5/{version}/krb5-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/krb5-{version}.tar.gz", "version": "1.21", "checksum": "e2ee531443122376ac8b62b3848d94376f646089", "checkfunc": krb_version, @@ -605,7 +595,6 @@ def build_python(env, dirs, logfp): wait_on=["ncurses"], download={ "url": "https://ftp.gnu.org/gnu/readline/readline-{version}.tar.gz", - # "fallback_url": "https://woz.io/relenv/dependencies/readline-{version}.tar.gz", "version": "8.2.13", "checksum": "5ffb6a334c2422acbe8f4d2cb11e345265c8d930", "checkfunc": tarball_version, @@ -620,7 +609,6 @@ def build_python(env, dirs, logfp): download={ "url": "https://sourceforge.net/projects/libtirpc/files/libtirpc-{version}.tar.bz2", # "url": "https://downloads.sourceforge.net/projects/libtirpc/files/libtirpc-{version}.tar.bz2", - # "fallback_url": "https://woz.io/relenv/dependencies/libtirpc-{version}.tar.bz2", "version": "1.3.4", "checksum": "63c800f81f823254d2706637bab551dec176b99b", "checkfunc": tarball_version, @@ -647,7 +635,6 @@ def build_python(env, dirs, logfp): ], download={ "url": "https://www.python.org/ftp/python/{version}/Python-{version}.tar.xz", - # "fallback_url": "https://woz.io/relenv/dependencies/Python-{version}.tar.xz", "version": build.version, "checksum": "d31d548cd2c5ca2ae713bebe346ba15e8406633a", "checkfunc": python_version, diff --git a/relenv/buildenv.py b/relenv/buildenv.py index 2a08412f..8a28e1d6 100644 --- a/relenv/buildenv.py +++ b/relenv/buildenv.py @@ -51,20 +51,20 @@ def buildenv(relenv_path=None): "TOOLCHAIN_PATH": f"{toolchain}", "TRIPLET": f"{triplet}", "RELENV_PATH": f"{relenv_path}", - "CC": f"{toolchain}/bin/{triplet}-gcc -no-pie", - "CXX": f"{toolchain}/bin/{triplet}-g++ -no-pie", - "CFLAGS": ( - # f"-L{relenv_path}/lib -L{toolchain}/{triplet}/sysroot/lib " + "CC": f"{toolchain}/bin/{triplet}-gcc", + "CXX": f"{toolchain}/bin/{triplet}-g++", + "CFLAGS": f"-I{relenv_path}/include -I{toolchain}/sysroot/usr/include", + "CXXFLAGS": ( f"-I{relenv_path}/include " - f"-I{toolchain}/sysroot/usr/include" + f"-I{toolchain}/{triplet}/sysroot/usr/include " + f"-L{relenv_path}/lib -L{toolchain}/{triplet}/sysroot/lib " + f"-Wl,-rpath,{relenv_path}/lib" ), "CPPFLAGS": ( - # f"-L{relenv_path}/lib -L{toolchain}/{triplet}/sysroot/lib " - f"-I{relenv_path}/include -I{toolchain}/{triplet}/sysroot/usr/include" + f"-I{relenv_path}/include " f"-I{toolchain}/{triplet}/sysroot/usr/include" ), "CMAKE_CFLAGS": ( - # f"-L{relenv_path}/lib -L{toolchain}/{triplet}/sysroot/lib " - f"-I{relenv_path}/include -I{toolchain}/{triplet}/sysroot/usr/include" + f"-I{relenv_path}/include " f"-I{toolchain}/{triplet}/sysroot/usr/include" ), "LDFLAGS": ( f"-L{relenv_path}/lib -L{toolchain}/{triplet}/sysroot/lib " diff --git a/relenv/runtime.py b/relenv/runtime.py index 440e709e..0e4de7f0 100644 --- a/relenv/runtime.py +++ b/relenv/runtime.py @@ -70,6 +70,17 @@ def relocate(): return relocate.relocate +def buildenv(): + """ + Late import relenv buildenv. + """ + if not hasattr(buildenv, "builenv"): + buildenv.buildenv = path_import( + "relenv.buildenv", str(pathlib.Path(__file__).parent / "buildenv.py") + ) + return buildenv.buildenv + + def get_major_version(): """ Current python major version. @@ -1024,3 +1035,11 @@ def bootstrap(): setup_crossroot() install_cargo_config() sys.meta_path = [importer] + sys.meta_path + # XXX This causes our m2crypto test to break + # if "RELENV_BUILDENV" in os.environ: + # env = buildenv().buildenv() + # for key in env: + # if key in os.environ: + # os.environ[key] = f"{env[key]} {os.environ[key]}" + # else: + # os.environ[key] = env[key] diff --git a/tests/test_build.py b/tests/test_build.py index 6e09e00c..0fc04825 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -33,7 +33,6 @@ def test_builder_defaults_linux(): assert builder.toolchain == DATA_DIR / "toolchain" / "x86_64-linux-gnu" assert callable(builder.build_default) assert callable(builder.populate_env) - assert builder.force_download is False assert builder.recipies == {} diff --git a/tests/test_verify_build.py b/tests/test_verify_build.py index 0bab2578..d85ef6a1 100644 --- a/tests/test_verify_build.py +++ b/tests/test_verify_build.py @@ -107,6 +107,11 @@ def test_pip_install_salt_git(pipexec, build, build_dir, pyexec, build_version): if sys.platform == "darwin" and "3.13" in build_version: pytest.xfail("Salt does not work with 3.13 on macos yet") + # if sys.platform == "linux": + # subprocess.run( + # [pipexec, "--upgrade", "install", "setuptools>=72.2.0"], check=True + # ) + env = os.environ.copy() env["RELENV_BUILDENV"] = "yes" if sys.platform == "linux" and shutil.which("git"): @@ -339,31 +344,35 @@ def test_pip_install_salt_w_package_requirements( "23.2.0", "25.1.2", "26.2.0", + "26.4.0", ], ) -def test_pip_install_pyzmq(pipexec, pyzmq_version, build_version, arch): +def test_pip_install_pyzmq(pipexec, pyzmq_version, build_version, arch, build): if pyzmq_version == "23.2.0" and "3.12" in build_version: pytest.xfail(f"{pyzmq_version} does not install on 3.12") + if pyzmq_version == "23.2.0" and "3.13" in build_version: + pytest.xfail(f"{pyzmq_version} does not install on 3.13") + if pyzmq_version == "23.2.0" and sys.platform == "darwin": pytest.xfail("pyzmq 23.2.0 fails on macos arm64") - if sys.platform == "win32" and pyzmq_version == "25.1.2": - pytest.xfail("pyzmq 25.1.2 fails on windows") - - if sys.platform == "win32" and pyzmq_version == "23.2.0": - pytest.xfail("vcredist not found as of 9/9/24") - - if sys.platform == "win32" and pyzmq_version == "26.2.0": + if pyzmq_version == "23.2.0" and sys.platform == "win32": pytest.xfail("vcredist not found as of 9/9/24") - if pyzmq_version == "23.2.0" and "3.13" in build_version: - pytest.xfail(f"{pyzmq_version} does not install on 3.13") - if pyzmq_version == "25.1.2" and "3.13" in build_version: pytest.xfail(f"{pyzmq_version} does not install on 3.13") + if pyzmq_version == "25.1.2" and sys.platform == "win32": + pytest.xfail("pyzmq 25.1.2 fails on windows") + + if pyzmq_version == "26.2.0" and sys.platform == "win32": + pytest.xfail("vcredist not found as of 9/9/24") + + if pyzmq_version == "26.4.0" and sys.platform == "win32": + pytest.xfail("Needs troubleshooting 4/12/25") + env = os.environ.copy() p = subprocess.run( @@ -404,6 +413,21 @@ def test_pip_install_pyzmq(pipexec, pyzmq_version, build_version, arch): ) assert p.returncode == 0, "Failed to pip install package requirements" + if shutil.which("docker"): + subprocess.run( + [ + "docker", + "run", + "-v", + f"{build}:/test", + "amazonlinux:2", + "/test/bin/python3", + "-c", + "import zmq", + ], + check=True, + ) + def test_pip_install_cryptography(pipexec): packages = [ @@ -553,18 +577,35 @@ def test_pip_install_m2crypto_system_ssl(pipexec, pyexec): @pytest.mark.skip_unless_on_linux -def test_pip_install_m2crypto_relenv_ssl(pipexec, pyexec, build): +@pytest.mark.parametrize( + "m2crypto_version", + [ + "0.38.0", + "0.44.0", + ], +) +def test_pip_install_m2crypto_relenv_ssl( + m2crypto_version, pipexec, pyexec, build, build_version, minor_version +): + if m2crypto_version == "0.38.0" and minor_version in ["3.12", "3.13"]: + pytest.xfail("Fails due to no distutils") env = os.environ.copy() env["RELENV_BUILDENV"] = "yes" env["RELENV_DEBUG"] = "yes" env["LDFLAGS"] = f"-L{build}lib" - env["CFLAGS"] = f"-I{build}/include" - env["SWIG_FEATURES"] = f"-I{build}/include" + env["CFLAGS"] = f"-I{build}/include -I{build}/include/python{minor_version}" + env["SWIG_FEATURES"] = f"-I{build}/include -I{build}/include/python{minor_version}" p = subprocess.run( ["swig", "-version"], ) p = subprocess.run( - [str(pipexec), "install", "m2crypto", "--no-cache-dir", "-v"], + [ + str(pipexec), + "install", + f"m2crypto=={m2crypto_version}", + "--no-cache-dir", + "-v", + ], env=env, stderr=subprocess.PIPE, )