Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/build_cosmo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,16 @@ function build_python () {
cd ${BUILDDIR}

${WORKDIR}/pyclean -v ${python_install_dir}

cd ${python_install_dir}

# bundle lib/ and licenses/ into a copy of python.com's own zip store
# so it runs standalone with no sibling files
# archives excluded - they can't be used to build native extensions anyways
cp ./bin/python.com ./bin/python.standalone.com
zip -qr9 ./bin/python.standalone.com lib licenses -x "lib/.aarch64/*" "lib/libpython*.a"
cd ${BUILDDIR}

mv ${python_install_dir} python-${python_distro_ver}-${PLATFORM}-${ARCH}
tar -czf ${WORKDIR}/python-${python_distro_ver}-${PLATFORM}-${ARCH}.tar.gz python-${python_distro_ver}-${PLATFORM}-${ARCH}
zip ${WORKDIR}/python-${python_distro_ver}-${PLATFORM}-${ARCH}.zip $(tar tf ${WORKDIR}/python-${python_distro_ver}-${PLATFORM}-${ARCH}.tar.gz)
Expand Down
24 changes: 24 additions & 0 deletions scripts/launch_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ function run_test () {
unzip ${FULL_DISTRO}.zip
cd ${FULL_DISTRO}
chmod +x ./bin/python.com
chmod +x ./bin/python.standalone.com
fi
PYTHON_EXE=python.com
;;
Expand All @@ -193,6 +194,29 @@ function run_test () {
fi

echo "::endgroup::"

if [[ "${OS}" == "cosmo" ]]; then
echo "::group::Standalone Python ${python_distro_ver}"

# move the single-file build out of the extracted distribution so it
# has no sibling files, proving it's actually standalone
STANDALONE_DIR=$(mktemp -d)
cp ${WORKDIR}/${FULL_DISTRO}/bin/python.standalone.com ${STANDALONE_DIR}/
cd ${STANDALONE_DIR}
chmod +x ./python.standalone.com

./python.standalone.com --version
./python.standalone.com -m sysconfig
./python.standalone.com ${WORKDIR}/scripts/test.py
./python.standalone.com -m pip

if [[ "${RUN_TESTS}" == "true" ]]; then
./python.standalone.com -m test -v -ulargefile,network,decimal,cpu,subprocess,urlfetch,tzdata --timeout 60
fi

cd ${WORKDIR}
echo "::endgroup::"
fi
}

run_test
Expand Down
Loading