Skip to content
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

gap: update to 4.12.1 #12555

Merged
merged 4 commits into from
Oct 28, 2022
Merged

gap: update to 4.12.1 #12555

merged 4 commits into from
Oct 28, 2022

Conversation

fingolfin
Copy link
Contributor

I am not a Termux user myself, so I am not completely sure I got this right.
(Rather, I am one of the developers of GAP.) Apologies if I did something
wrong here.

packages/gap/build.sh Outdated Show resolved Hide resolved
@fingolfin
Copy link
Contributor Author

Unfortunately, I noticed that this packages seems mostly useless in its current form, as it seems to skip completely over installing GAP packages (included in the pkg subdirectory of the tarball). I've also noticed you have a rule for keeping packages below 100 MB; I was wondering how this recipe managed that; well, if one skips pkg, that's easy. But at the same time, there are currently four "required" packages; GAP won't even start without those.

I don't know a way to try out Termux packages right now, but I wonder if the current gap packages even allows starting gap?

@fingolfin
Copy link
Contributor Author

Found https://github.com/termux/termux-docker and tried it, and yeah, it is exactly as I expected:

Preparing to unpack .../gap_4.11.1-1_x86%5f64.deb ...
Unpacking gap (4.11.1-1) ...
Setting up gap (4.11.1-1) ...
~ $ gap
 ┌───────┐   GAP 4.11.1 of 2021-03-02
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-pc-linux-android-default64-kv7
 Configuration:  gmp 6.2.1, GASMAN, readline
 Loading the library and packages ...
#I  gapdoc package is not available. Check that the name is correct
#I  and it is present in one of the GAP root directories (see '??RootPaths')
#I  GAP: needed package gapdoc cannot be loaded
Error, failed to load needed package `gapdoc' (version >= 1.2) at /data/data/com.termux/files/usr/share/gap/lib/package.gi:1919 called from
func(  ); at /data/data/com.termux/files/usr/share/gap/lib/system.g:216 called from
<function "CallAndInstallPostRestore">( <arguments> )
 called from read-eval loop at /data/data/com.termux/files/usr/share/gap/lib/init.g:690
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk>

(Although it is not completely useless as one can start it via gap --bare, but in that mode all kinds of things won't work right, it is mostly for bootstrapping)

I could address this here, but installing all packages would probably end up using > 1 GB disk space. Even with the minimal set of packages and some tricks I don't think one can stay under the 100 MB limit (but < 200 MB may be possible)

@Grimler91
Copy link
Member

I think I was planning to add (some or all) packages to another subpackage of gap ("gap-packages"), or perhaps advice users to download them manually (but neither of those things were done).

Having several subpackages that are 100 MB or less each works

Seems ffgen needs to be built in a hostbuild step, and Makefile or similar patched. Right now build tries to run an executable that is cross-compiled for android

@fingolfin
Copy link
Contributor Author

The build fails because it tries to execute ffgen which fails (due to cross compilation). But this is weird, it shouldn't execute ffgen (precisely to enable cross compilation), that tool should only be run in git snapshots of GAP (source: I wrote that code, and regularly cross compile it, too). But of course this could be a regression in 4.12.1... alas I just verified it locally (downloaded the GAP tarball referenced in this PR, run ./configure && make in it -- no ffgen binary was even created, let alone run. Weird...

@fingolfin
Copy link
Contributor Author

Regarding packages: note that gapdoc+smallgrp+transgrp+primgrp in unmodified form already take > 300 MB storage, but one can use that GAP supports transparent *.gz compression and run something like gzip -9 -n -f transgrp/data/*.* primgrp/data/*.* smallgrp/id*/*.* smallgrp/small*/*.* to get them "small enough". (The -f to avoid issues with the files with extension .z -- those are not compressed files, they are all plain text. And the -n to improve reproducibility, by avoiding pointless timestamps in the .gz)

@fingolfin
Copy link
Contributor Author

Ahh, wait, I just noticed the line configure: out-of-tree build in the build log... and now I understand the problem: the code for not regenerating ffdata.c when it is already present in src does not take out-of-tree builds into account. So this is indeed a bug on our (GAP) side. I'll work on a fix for the next release, which then can also be added as a patch here.

@fingolfin fingolfin force-pushed the mh/gap branch 2 times, most recently from 4b7d80a to 959249e Compare October 26, 2022 06:35
@fingolfin
Copy link
Contributor Author

I've now added a workaround for the ffgen issue, and some (currently commented out) code for installing a minimal set of packages. Someone needs to let the CI tests run again, though :-)

@Grimler91
Copy link
Member

Added some commits to avoid install -s, and to create a gap-packages subpackage, gap-packages for aarch64 is 91 MB, and gap 22 MB, so acceptable sizes

@fingolfin
Copy link
Contributor Author

Thanks, that looks fine to me! I'd be happy if this PR was merged as-is, overall it should be a net-positive for anyone trying to use GAP this way.

Down the road, perhaps one could also wrap the remaining GAP packages (in the pkg dir), each in a separate (sub-?)package -- it wouldn't be too hard to write a script which takes the list of all packages and their metadata (available at https://github.com/gap-system/gap/releases/download/v4.12.1/package-infos.json.gz) and spits out code for each (sub-)package. In other distros, typically a GAP package foo will be wrapped as gap-pkg-foo or so (to avoid clashes with other software). But perhaps "subpackages" are not the right way to do it, as each of those has a version of its own, independent of that from GAP... Anyway, I am not a Termux user, so I won't delve into this, I just wanted to mention the possibility :-).

fingolfin and others added 4 commits October 28, 2022 10:06
The host strip cannot handle arm binaries, and we already run strip in
termux_step_massage, so there is no need to use install -s.
Detected in termux_step_massage:

find: File system loop detected; ‘./include/gap/src’ is part of the same file system loop as ‘./include/gap’.
@Grimler91
Copy link
Member

Thanks!

@fingolfin fingolfin deleted the mh/gap branch October 28, 2022 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants