Skip to content

Commit 32bf899

Browse files
Add exit code to fake scripts (emscripten-forge#2292)
1 parent 735c43b commit 32bf899

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

recipes/recipes_emscripten/python/build.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
export PYMAJOR_VERSION=3.13
3+
PY_VERSION=3.13
44

55
set -euxo pipefail
66

@@ -22,7 +22,7 @@ cp ${BUILD}/LICENSE .
2222
# since the python build script overwrites the env variable PYTHON to python.js
2323
# as it assumes this is the correct name for the python binary when building for emscripten.
2424
# But emscripten itself (emcc/emar/...) relies on the env variable PYTHON to be set to python<version_major>.<version_minor>
25-
ln -s $BUILD_PREFIX/bin/python${PYMAJOR_VERSION} $BUILD_PREFIX/bin/python.js
25+
ln -s $BUILD_PREFIX/bin/python${PY_VERSION} $BUILD_PREFIX/bin/python.js
2626

2727
# create an empty emsdk_env.sh in CONDA_EMSDK_DIR
2828
echo "" > $EMSCRIPTEN_FORGE_EMSDK_DIR/emsdk_env.sh
@@ -36,35 +36,36 @@ cp ${RECIPE_DIR}/Setup.local .
3636
cp ${RECIPE_DIR}/adjust_sysconfig.py .
3737

3838
# The actual build
39-
make
39+
make
4040

4141
# (TODO move in recipe) install libmpdec and libexpat
4242
cp ${BUILD}/Modules/_decimal/libmpdec/libmpdec.a $PREFIX/lib
4343
cp ${BUILD}/Modules/expat/libexpat.a $PREFIX/lib
4444

4545
# a fake wheel command
4646
touch $PREFIX/bin/wheel
47-
# append #!/bin/bash
48-
4947
echo "#!/bin/bash" >> $PREFIX/bin/wheel
50-
echo "echo \"wheel is not a supported on this platform.\"" >> $PREFIX/bin/wheel
48+
echo "echo \"wheel is not supported on this platform.\"" >> $PREFIX/bin/wheel
49+
echo "exit 1" >> $PREFIX/bin/wheel
5150
chmod +x $PREFIX/bin/wheel
5251

5352
# a fake pip command
5453
touch $PREFIX/bin/pip
5554
echo "#!/bin/bash" >> $PREFIX/bin/pip
56-
echo "echo \"pip is not a supported on this platform.\"" >> $PREFIX/bin/pip
55+
echo "echo \"pip is not supported on this platform.\"" >> $PREFIX/bin/pip
56+
echo "exit 1" >> $PREFIX/bin/pip
5757
chmod +x $PREFIX/bin/pip
5858

59-
# a fake python3 command
60-
touch $PREFIX/bin/python${PYMAJOR_VERSION}
61-
echo "#!/bin/bash" >> $PREFIX/bin/python${PYMAJOR_VERSION}
62-
echo "echo \"python3 is not a supported on this platform.\"" >> $PREFIX/bin/python${PYMAJOR_VERSION}
63-
chmod +x $PREFIX/bin/python${PYMAJOR_VERSION}
59+
# a fake python3.XY command
60+
touch $PREFIX/bin/python${PY_VERSION}
61+
echo "#!/bin/bash" >> $PREFIX/bin/python${PY_VERSION}
62+
echo "echo \"python3 is not supported on this platform.\"" >> $PREFIX/bin/python${PY_VERSION}
63+
echo "exit 1" >> $PREFIX/bin/python${PY_VERSION}
64+
chmod +x $PREFIX/bin/python${PY_VERSION}
6465

65-
# create symlink st. all possible python3.11 commands are available
66-
ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python
67-
ln -s $PREFIX/bin/python${PYMAJOR_VERSION} $PREFIX/bin/python3
66+
# create symlink st. all possible python3.XY commands are available
67+
ln -s $PREFIX/bin/python${PY_VERSION} $PREFIX/bin/python
68+
ln -s $PREFIX/bin/python${PY_VERSION} $PREFIX/bin/python3
6869

6970
# copy sysconfigdata
7071
cp $PREFIX/sysconfigdata/_sysconfigdata__emscripten_wasm32-emscripten.py $PREFIX/etc/conda/

recipes/recipes_emscripten/python/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ context:
44
name: python
55
ver2: "3.13"
66
ver2nd: ${{ version | version_to_buildstring}}
7-
build_number: 4
7+
build_number: 5
88
abi_tag: "cp${{ ver2nd }}"
99

1010
package:

0 commit comments

Comments
 (0)