Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
build/bin/sage-dist-helpers (sdh_build_wheel): New option --sdist-the…
…n-wheel
  • Loading branch information
Matthias Koeppe committed Jun 22, 2024
commit 03d0a0156d2ebcb7c1c76ff8bd98bdb7d58dbc91
13 changes: 9 additions & 4 deletions build/bin/sage-dist-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ sdh_build_wheel() {
build_options=""
# pip has --no-build-isolation but no flag that turns the default back on...
build_isolation_option=""
# build has --wheel but no flag that turns the default (build sdist and then wheel) back on
dist_option="--wheel"
export PIP_FIND_LINKS="$SAGE_SPKG_WHEELS"
unset PIP_NO_BINARY
while [ $# -gt 0 ]; do
Expand All @@ -242,6 +244,9 @@ sdh_build_wheel() {
export PIP_NO_BINARY=:all:
build_isolation_option="--no-isolation --skip-dependency-check"
;;
--sdist-then-wheel)
dist_option=""
;;
--no-deps)
install_options="$install_options $1"
;;
Expand All @@ -257,20 +262,20 @@ sdh_build_wheel() {
esac
shift
done
if python3 -m build --wheel --outdir=dist $build_isolation_option $build_options "$@"; then
if python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options "$@"; then
: # successful
else
case $build_isolation_option in
*--no-isolation*)
sdh_die "Error building a wheel for $PKG_NAME"
;;
*)
echo >&2 "Warning: building with \"python3 -m build --wheel --outdir=dist $build_isolation_option $build_options $@\" failed."
echo >&2 "Warning: building with \"python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options $@\" failed."
unset PIP_FIND_LINKS
export PIP_NO_BINARY=:all:
build_isolation_option="--no-isolation --skip-dependency-check"
echo >&2 "Retrying with \"python3 -m build --wheel --outdir=dist $build_isolation_option $build_options $@\"."
if python3 -m build --wheel --outdir=dist $build_isolation_option $build_options "$@"; then
echo >&2 "Retrying with \"python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options $@\"."
if python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options "$@"; then
echo >&2 "Warning: Wheel building needed to use \"$build_isolation_option\" to succeed. This means that a dependencies file in build/pkgs/ needs to be updated. Please report this to [email protected], including the build log of this package."
else
sdh_die "Error building a wheel for $PKG_NAME"
Expand Down