GrammaticalFramework/gf-core

Create Ubuntu PPA

inariksit opened this issue · 14 comments

From the discussion in #116

From https://help.launchpad.net/Packaging/PPA:

Using a Personal Package Archive (PPA), you can distribute software and updates directly to Ubuntu users. Create your source package, upload it and Launchpad will build binaries and then host them in your own apt repository.

So if we use a PPA then we won't even need to build the binaries ourselves, which sounds like a plus.

Also, we need at least two versions: one for Ubuntu ≥20 and other for lower. Seems like there is no one version of GF binary that would work on both old and new Ubuntu.

Hello I will look at this.

Ping. I'm a ubuntu user, so this issue would 100% fix my current install issue!!!

If this issue is not avanced yet, give a look at this comment #116 (comment). But on that commend I mentioned that maybe something like Flatpak or Snapcraft could be easier from the point of view of maintainer. This could be relevant in special if the GrammaticalFramework may at some point be heavy on dependencies and a thing like Flatpak (that by the way increase the baseline install size) starts to get interesting.

@fititnt Thanks for the suggestions! I'm personally happy with any solution, or multiple solutions. As long as it doesn't take energy for the maintainers to actively maintain different options, I think the more the merrier.

I believe that we have identified the solutions to make GF installation work for both Ubuntu ≥20 and <20, so is this just a matter of choosing one (or many) and doing it?

My latest attempt https://launchpadlibrarian.net/549609048/buildlog_ubuntu-focal-amd64.gf_3.11.0-3_BUILDING.txt.gz
failed with

Config file path source is default config file.
Config file /sbuild-nonexistent/.cabal/config not found.
Writing default configuration to /sbuild-nonexistent/.cabal/config
/sbuild-nonexistent: createDirectory: permission denied (Permission denied)
make[1]: *** [debian/rules:19: override_dh_auto_configure] Error 1

It seems like the sandbox that it's built in doesn't have a home-directory, so cabal failed to create ~/.cabal for caches and things.

It was more convoluted than I expected to make a ppa multiple different ubuntu versions
Apparently you need to upload multiple times, once for each ubuntu version and modify the ubuntu/changes file for each one.
https://askubuntu.com/questions/30145/ppa-packaging-having-versions-of-packages-for-multiple-distros
https://askubuntu.com/questions/3446/how-to-create-and-administer-multi-architecture-ppas

@fititnt What is your current install issue by the way?

I'm also running into this issue: https://stackoverflow.com/questions/61646468/build-a-debian-package-without-tarball
It seems to not be happy with the -1 at the end of the version number in debian/changelog.

@anka-213 here the full log.

fititnt@bravo:/tmp$ wget http://www.grammaticalframework.org/download/gf_3.10-2_amd64.deb
--2021-07-22 15:08:46--  http://www.grammaticalframework.org/download/gf_3.10-2_amd64.deb
Resolvendo www.grammaticalframework.org (www.grammaticalframework.org)... 129.16.20.109
Conectando-se a www.grammaticalframework.org (www.grammaticalframework.org)|129.16.20.109|:80... conectado.
A requisição HTTP foi enviada, aguardando resposta... 200 OK
Tamanho: 11286894 (11M) [application/x-debian-package]
Salvando em: “gf_3.10-2_amd64.deb”

gf_3.10-2_amd64.deb          100%[============================================>]  10,76M  2,97MB/s    em 3,6s    

2021-07-22 15:08:51 (2,97 MB/s) - “gf_3.10-2_amd64.deb” salvo [11286894/11286894]

fititnt@bravo:/tmp$ sudo dpkg -i gf_3.10-2_amd64.deb
[sudo] senha para fititnt: 
A seleccionar pacote anteriormente não seleccionado gf.
(Lendo banco de dados ... 359514 ficheiros e directórios actualmente instalados.)
A preparar para desempacotar gf_3.10-2_amd64.deb ...
A descompactar gf (3.10-2) ...
dpkg: problemas com dependências impedem a configuração de gf:
 gf depende de libffi6 (>= 3.0.4); porém:
  Pacote libffi6 não está instalado.
 gf depende de libtinfo5 (>= 6); porém:
  Pacote libtinfo5 não está instalado.

dpkg: erro ao processar o pacote gf (--install):
 problemas de dependência - deixando desconfigurado
A processar 'triggers' para libc-bin (2.31-0ubuntu9.2) ...
Erros foram encontrados durante o processamento de:
 gf
fititnt@bravo:/tmp$ sudo apt install ./gf_3.10-2_amd64.deb
Lendo listas de pacotes... Pronto
Construindo árvore de dependências       
Lendo informação de estado... Pronto
Você pode querer executar 'apt --fix-broken install' para corrigí-los.
Os pacotes a seguir têm dependências desencontradas:
 gf : Depende: libffi6 (>= 3.0.4) mas não é instalável
      Depende: libtinfo5 (>= 6) mas não está instalado
E: Dependências desencontradas. Tente 'apt --fix-broken install' sem nenhum pacote (ou especifique uma solução).
fititnt@bravo:/tmp$ cat /etc/*release | grep VERSION
VERSION="20.04.2 LTS (Focal Fossa)"
VERSION_ID="20.04"
VERSION_CODENAME=focal

Also, after trying to do a normal system update, since the package seems to be installed, this error happens:

fititnt@bravo:/tmp$ sudo apt upgrade
Lendo listas de pacotes... Pronto
Construindo árvore de dependências       
Lendo informação de estado... Pronto
Você pode querer executar 'apt --fix-broken install' para corrigí-los.
Os pacotes a seguir têm dependências desencontradas:
 gf : Depende: libffi6 (>= 3.0.4) mas não é instalável
      Depende: libtinfo5 (>= 6) mas não está instalado
E: Dependências desencontradas. Tente 'apt --fix-broken install' sem nenhum pacote (ou especifique uma solução).

But the sudo apt --fix-broken install fix the partially installed gf by removing it, so the Ubuntu-like distro can continue receiving other updates.


Also, if later someone here wants to give a pre-build release to see if I can do a quick install, just pass the link later.

I'm not in a hurry to install gf (if need, I would build from sources, or maybe create a Dockerized version). But I'm okay on next weeks to an additional person to check if it runs.

I do not have at the moment other ubuntu distros, but if necessary, maybe I could use the LXC containers (to not need install VirtualBox or something). But in general, if something works/build on the GitHub actions for the targeted platform, is very likely to run on averange end user machine.

@inariksit @anka-213 Anyway, if for some reason the work (from the maintainers point of view, in special to keep it up to date) be higher than maybe try some testing with flatpak or maybe snapcraft (since there other two methods are more generic, not just for very Specific Ubuntu and Ubuntu derived), maybe could worth a try. Also the flatpak (see https://flatpak.org/setup/) because it actually install dependencies (think like docker, but without docker) it actually support a lot of Linux platforms.

And some quick search by "Flatpak + Windows", seems that most "workarounds" with problems to run Flatpack on Windows are for GUI based applications (like this post https://www.reddit.com/r/bashonubuntuonwindows/comments/nxjgav/running_flatpak_apps_in_wsl/, and this tutorial https://gist.github.com/tdcosta100/385636cbae39fc8cd0937139e87b1c74). So, i'm assuming that gf, as cli-based application, could actually have all the features also on Windows (okay that any generic Ubuntu installer would allow the same, but just to mention that the Windows WLS (https://docs.microsoft.com/windows/wsl/install-win10) already is a thing.

But like I said before, I personally would be totally fine with a Ubuntu PPA. But I would totally agree with whatever would be simpler to keep up to date for maintainers.

I think this one should work for you https://github.com/anka-213/gf-core/actions/runs/1054662597
Issue #74 will be fixed by #116

@anka-213

fititnt@bravo:/tmp$ wget https://github.com/anka-213/gf-core/releases/download/v3.11-test-release-6/gf_3.10.4-1_amd64.deb

fititnt@bravo:/tmp$ sudo apt install ./gf_3.10.4-1_amd64.deb 
[sudo] senha para fititnt: 
Lendo listas de pacotes... Pronto
Construindo árvore de dependências       
Lendo informação de estado... Pronto
Note, a seleccionar 'gf' em vez de './gf_3.10.4-1_amd64.deb'
Alguns pacotes não puderam ser instalados. Isto pode significar que
você solicitou uma situação impossível ou, se você está usando a
distribuição instável, que alguns pacotes requeridos não foram
criados ainda ou foram retirados da "Incoming".
A informação a seguir pode ajudar a resolver a situação:

Os pacotes a seguir têm dependências desencontradas:
 gf : Depende: libffi6 (>= 3.0.4) mas não é instalável
E: Impossível corrigir problemas, você manteve (hold) pacotes quebrados.

Almost there

@fititnt I meant this file, which can be found on the page I linked, not the one from the release: https://github.com/anka-213/gf-core/suites/3299933055/artifacts/77124032
The issue with the release you tried to download is that both versions have the same name, so the one you needed was overwritten by the one for the older ubuntu version.

@anka-213 now installed without errors!

(I did not tested functionality, but gf --help worked. It's even in portuguese! (used --help from another program that was in Portuguese, but gf --help worked)

Thanks!

Oh I would love to write a GF grammar that generates gf --help for all the RGL languages! 😁 That could be my GF summer school project 🤔