diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8ae87e76..924448d2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -249,6 +249,19 @@ jobs: ./build-linux.py --target-triple ${{ matrix.target_triple }} --python cpython-${{ matrix.python }} --options ${{ matrix.build_options }} + - name: Generate attestations + uses: actions/attest-build-provenance@v2 + if: ${{ github.ref == 'refs/heads/main' }} + with: + subject-path: dist/* + + - name: Upload Distribution + if: ${{ ! matrix.dry-run }} + uses: actions/upload-artifact@v4 + with: + name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }} + path: dist/* + - name: Validate Distribution if: ${{ ! matrix.dry-run }} run: | @@ -267,19 +280,6 @@ jobs: build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst - - name: Generate attestations - uses: actions/attest-build-provenance@v2 - if: ${{ github.ref == 'refs/heads/main' }} - with: - subject-path: dist/* - - - name: Upload Distribution - if: ${{ ! matrix.dry-run }} - uses: actions/upload-artifact@v4 - with: - name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }} - path: dist/* - build-1: needs: - generate-matrix @@ -349,6 +349,19 @@ jobs: ./build-linux.py --target-triple ${{ matrix.target_triple }} --python cpython-${{ matrix.python }} --options ${{ matrix.build_options }} + - name: Generate attestations + uses: actions/attest-build-provenance@v2 + if: ${{ github.ref == 'refs/heads/main' }} + with: + subject-path: dist/* + + - name: Upload Distribution + if: ${{ ! matrix.dry-run }} + uses: actions/upload-artifact@v4 + with: + name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }} + path: dist/* + - name: Validate Distribution if: ${{ ! matrix.dry-run }} run: | @@ -366,16 +379,3 @@ jobs: fi build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst - - - name: Generate attestations - uses: actions/attest-build-provenance@v2 - if: ${{ github.ref == 'refs/heads/main' }} - with: - subject-path: dist/* - - - name: Upload Distribution - if: ${{ ! matrix.dry-run }} - uses: actions/upload-artifact@v4 - with: - name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }} - path: dist/* diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e285fac3..165ff261 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -146,12 +146,6 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\${{ matrix.vcvars }}" py.exe -3.12 build-windows.py --python cpython-${{ matrix.python }} --sh c:\cygwin\bin\sh.exe --options ${{ matrix.build_options }} - - name: Validate Distribution - if: ${{ ! matrix.dry-run }} - run: | - $Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative - .\pythonbuild.exe validate-distribution --run $Dists - - name: Generate attestations uses: actions/attest-build-provenance@v2 if: ${{ github.ref == 'refs/heads/main' }} @@ -163,3 +157,9 @@ jobs: with: name: cpython-${{ matrix.python }}-${{ matrix.vcvars }}-${{ matrix.build_options }} path: dist/* + + - name: Validate Distribution + if: ${{ ! matrix.dry-run }} + run: | + $Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative + .\pythonbuild.exe validate-distribution --run $Dists diff --git a/cpython-unix/build-tcl.sh b/cpython-unix/build-tcl.sh index 43a4a6ad..ef9d9ddc 100755 --- a/cpython-unix/build-tcl.sh +++ b/cpython-unix/build-tcl.sh @@ -22,21 +22,6 @@ if [ -n "${STATIC}" ]; then fi fi -patch -p1 << 'EOF' -diff --git a/unix/Makefile.in b/unix/Makefile.in ---- a/unix/Makefile.in -+++ b/unix/Makefile.in -@@ -1813,7 +1813,7 @@ configure-packages: - $$i/configure --with-tcl=../.. \ - --with-tclinclude=$(GENERIC_DIR) \ - $(PKG_CFG_ARGS) --libdir=$(PACKAGE_DIR) \ -- --enable-shared --enable-threads; ) || exit $$?; \ -+ --enable-shared=no --enable-threads; ) || exit $$?; \ - fi; \ - fi; \ - fi; \ -EOF - # Remove packages we don't care about and can pull in unwanted symbols. rm -rf pkgs/sqlite* pkgs/tdbc* @@ -48,12 +33,9 @@ CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./conf --build=${BUILD_TRIPLE} \ --host=${TARGET_TRIPLE} \ --prefix=/tools/deps \ - --enable-shared=no \ + --enable-shared \ --enable-threads make -j ${NUM_CPUS} make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out make -j ${NUM_CPUS} install-private-headers DESTDIR=${ROOT}/out - -# For some reason libtcl*.a have weird permissions. Fix that. -chmod 644 ${ROOT}/out/tools/deps/lib/libtcl*.a diff --git a/cpython-unix/build-tk.sh b/cpython-unix/build-tk.sh index 2769a631..aa7a5b67 100755 --- a/cpython-unix/build-tk.sh +++ b/cpython-unix/build-tk.sh @@ -31,7 +31,7 @@ CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \ --host=${TARGET_TRIPLE} \ --prefix=/tools/deps \ --with-tcl=${TOOLS_PATH}/deps/lib \ - --enable-shared=no \ + --enable-shared \ --enable-threads \ ${EXTRA_CONFIGURE_FLAGS} @@ -53,7 +53,4 @@ touch wish make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out make -j ${NUM_CPUS} install-private-headers DESTDIR=${ROOT}/out -# For some reason libtk*.a have weird permissions. Fix that. -chmod 644 /${ROOT}/out/tools/deps/lib/libtk*.a - rm ${ROOT}/out/tools/deps/bin/wish* diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index 3d69f049..0b46cf76 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -676,40 +676,11 @@ _tkinter: - WITH_APPINIT includes-deps: - include/X11 + build-mode: shared links: - tcl8.6 - tk8.6 - # Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance. - # See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92. - # This is apparently an issue with static linking Objective-C binaries. - linker-args: - - args: ["-ObjC"] - targets: - - .*-apple-darwin - links-conditional: - - name: X11 - targets: - - .*-unknown-linux-.* - - name: xcb - targets: - - .*-unknown-linux-.* - - name: Xau - targets: - - .*-unknown-linux-.* - # Many of these are dependencies of libtcl and libtk. - frameworks: - - AppKit - - ApplicationServices - - Carbon - - Cocoa - - CoreFoundation - - CoreServices - - CoreGraphics - - IOKit - - QuartzCore - - UniformTypeIdentifiers - _tokenize: minimum-python-version: "3.11" config-c-only: true diff --git a/src/validation.rs b/src/validation.rs index 9084754b..f28004b8 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -822,7 +822,7 @@ const GLOBAL_EXTENSIONS_WINDOWS_PRE_3_13: &[&str] = &["_msi"]; const GLOBAL_EXTENSIONS_WINDOWS_NO_STATIC: &[&str] = &["_testinternalcapi", "_tkinter"]; /// Extension modules that should be built as shared libraries. -const SHARED_LIBRARY_EXTENSIONS: &[&str] = &["_crypt"]; +const SHARED_LIBRARY_EXTENSIONS: &[&str] = &["_crypt", "_tkinter"]; const PYTHON_VERIFICATIONS: &str = include_str!("verify_distribution.py");