Skip to content
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Tools/msi/obj
Tools/ssl/amd64
Tools/ssl/win32
Tools/freeze/test/outdir
Tools/pixi-packages/**/.pixi
Comment thread
lucascolley marked this conversation as resolved.
Outdated

# The frozen modules are always generated by the build so we don't
# keep them in the repo. Also see Tools/build/freeze_modules.py.
Expand Down
2 changes: 2 additions & 0 deletions Tools/pixi-packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- see comments for which fields should be maintained and kept up-to-date
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated
- combining directories blocked on https://github.com/prefix-dev/pixi/issues/4599
Comment thread
lucascolley marked this conversation as resolved.
Outdated
8 changes: 8 additions & 0 deletions Tools/pixi-packages/asan/pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]
channels = ["https://prefix.dev/conda-forge"]
platforms = ["osx-arm64", "linux-64"]
preview = ["pixi-build"]

[package.build.backend]
name = "pixi-build-rattler-build"
version = "*"
67 changes: 67 additions & 0 deletions Tools/pixi-packages/asan/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
context:
# XXX: keep up to date
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: https://discuss.python.org/t/cryptic-sequences-in-comments/38694

Can we replace all the "XXX" with "TODO" or something else? Maybe we don't even need it here:

Suggested change
# XXX: keep up to date
# Keep up to date

If we do merge this, we have code in https://github.com/python/release-tools which is run during the first beta, when main becomes the next version, that updates a bunch of versions in the repo. And we can later update that to also update these versions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a YAML, TOML, or JSON file that contains the version @hugovk ? If not, could we add one?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't. Yes we can add one, it removes duplication here, and will be easier to programmatically update such a file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any preference for format / location / name?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed this because it was marked as resolved but I don't think it has been :)

Format: TOML or JSON, we can read using the stdlib.

Location: Tools/pixi-packages/, or Tools/ so other scripts can re-use it.

Name: Hmm, python-version.[ext] ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was resolved for this PR via the third paragraph of #142469 (review)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks!

version: "3.15"
minor_version: "3.15"
Comment thread
lucascolley marked this conversation as resolved.
Outdated

package:
name: python
version: ${{ version }}

source:
- path: ../../..

build:
files:
exclude:
- "*.o"
script:
file: ../build.sh
env:
MINOR_VERSION: ${{ minor_version }}
PYTHON_ASAN: "1"

# XXX: maybe not all requirements necessary
Comment thread
FFY00 marked this conversation as resolved.
Outdated
Comment thread
lucascolley marked this conversation as resolved.
Outdated
# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml
requirements:
Comment thread
lucascolley marked this conversation as resolved.
Outdated
build:
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
- make
- libtool
Comment thread
lucascolley marked this conversation as resolved.
Outdated
- pkg-config
# configure script looks for llvm-ar for lto
- if: osx
then:
- llvm-tools
Comment thread
FFY00 marked this conversation as resolved.
- if: linux
then:
- ld_impl_${{ target_platform }}
- binutils_impl_${{ target_platform }}
- clang-19
- llvm-tools-19

host:
- bzip2
- sqlite
- liblzma-devel
- zlib
- zstd
- openssl
- readline
- tk
# These two are just to get the headers needed for tk.h, but is unused
- xorg-libx11
- xorg-xorgproto
- ncurses
- libffi
- if: linux
then:
- ld_impl_${{ target_platform }}
- libuuid
- libmpdec-devel
- expat

about:
homepage: https://www.python.org/
license: Python-2.0
license_file: LICENSE
36 changes: 36 additions & 0 deletions Tools/pixi-packages/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

if [[ "${PYTHON_ASAN}" == 1 ]]; then
echo "BUILD TYPE: ASAN"
BUILD_DIR="../build_asan"
CONFIGURE_EXTRA="--with-address-sanitizer"
export ASAN_OPTIONS="detect_leaks=0:symbolize=1:strict_init_order=true:allocator_may_return_null=1:use_sigaltstack=0"
Comment thread
lucascolley marked this conversation as resolved.
Outdated
else
echo "BUILD TYPE: DEFAULT"
BUILD_DIR="../build"
CONFIGURE_EXTRA=""
fi
Comment thread
lucascolley marked this conversation as resolved.
Outdated

mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"

if [[ -f configure-done ]]; then
echo "Skipping configure step, already done."
Comment thread
FFY00 marked this conversation as resolved.
else
"${SRC_DIR}/configure" \
--prefix="${PREFIX}" \
--oldincludedir="${BUILD_PREFIX}/${HOST}/sysroot/usr/include" \
--enable-shared \
--srcdir="${SRC_DIR}" \
${CONFIGURE_EXTRA}
fi

touch configure-done

make -j"${CPU_COUNT}" install
ln -sf "${PREFIX}/bin/python${MINOR_VERSION}" "${PREFIX}/bin/python"

# https://github.com/prefix-dev/rattler-build/issues/2012
if [[ ${OSTYPE} == "darwin"* ]]; then
cp "${BUILD_PREFIX}/lib/clang/21/lib/darwin/libclang_rt.asan_osx_dynamic.dylib" "${PREFIX}/lib/libclang_rt.asan_osx_dynamic.dylib"
fi
Comment thread
lucascolley marked this conversation as resolved.
8 changes: 8 additions & 0 deletions Tools/pixi-packages/default/pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]
channels = ["https://prefix.dev/conda-forge"]
platforms = ["osx-arm64", "linux-64"]
preview = ["pixi-build"]

[package.build.backend]
name = "pixi-build-rattler-build"
version = "*"
66 changes: 66 additions & 0 deletions Tools/pixi-packages/default/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
context:
# XXX: keep up to date
Comment thread
lucascolley marked this conversation as resolved.
Outdated
version: "3.15"
minor_version: "3.15"

package:
name: python
version: ${{ version }}

source:
- path: ../../..

build:
files:
exclude:
- "*.o"
script:
file: ../build.sh
env:
MINOR_VERSION: ${{ minor_version }}

# XXX: maybe not all requirements necessary
Comment thread
lucascolley marked this conversation as resolved.
Outdated
Comment thread
lucascolley marked this conversation as resolved.
Outdated
# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml
requirements:
build:
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
- make
- libtool
Comment thread
lucascolley marked this conversation as resolved.
Outdated
- pkg-config
# configure script looks for llvm-ar for lto
- if: osx
then:
- llvm-tools
- if: linux
then:
- ld_impl_${{ target_platform }}
- binutils_impl_${{ target_platform }}
- clang-19
- llvm-tools-19

host:
- bzip2
- sqlite
- liblzma-devel
- zlib
- zstd
- openssl
- readline
- tk
# These two are just to get the headers needed for tk.h, but is unused
- xorg-libx11
- xorg-xorgproto
- ncurses
- libffi
- if: linux
then:
- ld_impl_${{ target_platform }}
- libuuid
- libmpdec-devel
- expat

about:
homepage: https://www.python.org/
license: Python-2.0
license_file: LICENSE
Loading