-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop using BuildPackages.sh #105
Comments
Moreover, if using GAP installed with |
Amusingly, creating |
Hmm, isn't the actual problem that For But a better fix would be to bundle a copy of ... and even better would be to not use that script at all! It contains a lot of complexity that is unnecessary for PackageManager. E.g. it creates its own log files, deals with multiple packages etc. etc. -- but the relevant code is really tiny. Let's look at it a bit closer... but first let me point out that also e.g. https://github.com/gap-actions/build-pkg/blob/main/action.yml has code with a similar role which is MUCH more compact... Looking at run_configure_and_make() {
# We want to know if this is an autoconf configure script
# or not, without actually executing it!
if [[ -x autogen.sh && ! -x configure ]]
then
./autogen.sh
fi
if [[ -x configure ]]
then
if grep Autoconf ./configure > /dev/null
then
local PKG_NAME=$($GAP -q -T -A -M <<GAPInput
Read("PackageInfo.g");
Print(GAPInfo.PackageInfoCurrent.PackageName);
GAPInput
)
local CONFIG_ARGS_FLAG_NAME="`PACKAGE_CONFIG_ARGS`_${PKG_NAME}"
echo_run ./configure --with-gaproot="$GAPROOT" $CONFIGFLAGS ${!CONFIG_ARGS_FLAG_NAME}
echo_run "$MAKE" clean
else
echo_run ./configure "$GAPROOT"
echo_run "$MAKE" clean
echo_run ./configure "$GAPROOT"
fi
echo_run "$MAKE"
else
notice "No building required for $PKG"
fi
} Note that there is a lot of stuff in there we don't need for PackageManager or could do better...
The second relevant part is this, I guess: build_one_package() {
# requires one argument which is the package directory
PKG="$1"
[[ $GITHUB_ACTIONS = true ]] && echo "::group::$PKG"
echo ""
date
echo ""
notice "==== Checking $PKG"
( # start subshell
set -e
cd "$CURDIR/$PKG"
if [[ -x prerequisites.sh ]]
then
./prerequisites.sh "$GAPROOT"
elif [[ -x build-normaliz.sh ]]
then
# used in NormalizInterface; to be replaced by prerequisites.sh in future
# versions
./build-normaliz.sh "$GAPROOT"
fi
case "$PKG" in
# All but the last lines should end by '&&', otherwise (for some reason)
# some packages that fail to build will not get reported in the logs.
atlasrep*)
chmod 1777 datagens dataword
;;
pargap*)
echo_run ./configure --with-gap="$GAPROOT" && \
echo_run "$MAKE" && \
cp bin/pargap.sh "$GAPROOT/bin" && \
rm -f ALLPKG
;;
xgap*)
echo_run ./configure --with-gaproot="$GAPROOT" && \
echo_run "$MAKE" && \
rm -f "$GAPROOT/bin/xgap.sh" && \
cp bin/xgap.sh "$GAPROOT/bin"
;;
simpcomp*)
# Old versions of simpcomp were not setting the executable
# bit for some files; they also were not copying the bistellar
# executable to the right place
(chmod a+x configure depcomp install-sh missing || :) && \
run_configure_and_make && \
mkdir -p bin && test -x bin/bistellar || mv bistellar bin
;;
*)
run_configure_and_make
;;
esac
) &&
( # start subshell
if [[ $GITHUB_ACTIONS = true ]]
then
echo "::endgroup::"
fi
) || build_fail
}
Well...
If someone would like to help make this happen, a good start would be to write a minimal replacement shell script for In a second update this script could be replaced by equivalent GAP code calling out to subprocesses, but this requires a lot more work; plus I really think we should first extend GAP to support capturing |
we don't run in |
we can reuse it to do the simplification you propose. But now I have to deal with my son getting hold of a non-empty ink bottle and splashing it over himself 🤦 |
Regarding NormalizInterface, of course I was wrong sigh one has to explicitly tell it to use the system wide Normaliz; there is an old issue to improve that, but I just could never be bothered (also, strictly speaking, not every Normaliz version will work, as Normaliz tends to introduce breaking changes to its API quote often). Oh and I submitted gap-packages/NormalizInterface#109 |
I did not suggest that SageMath should use |
Indeed, I had only tested non-binary packages. |
I can definitely see advantages in a PackageManager-specific alternative to I've changed the issue title to make the goal more precise. I think it'd be worth doing. |
Note that the package manager currently has a special bit of code for handling |
I'm confused - when we e.g. use GAP installed with |
It doesn't work with packages that need compilation |
OTOH, if |
Loading
packagemanager
fails if the dirlib/gap/bin
doesn't exist (for instance, if gap has been installed somewhere viamake install
and is not being run from the source tree).Simply creating an empty
lib/gap/bin
subdir makespackagemanager
load and work fine, so I assume its presence is not essential. Loading the package should not fail if the dir doesn't exist.The text was updated successfully, but these errors were encountered: