-
Notifications
You must be signed in to change notification settings - Fork 72
Pharo on Open Build Service
This page gathers all the knowledge and documentation on the effort to have Pharo building on the Open Build Service for *nixes, started by Esteban Lorenzano.
Everything is here: https://build.opensuse.org/project/show/home:estebanlm
In general lines, the real problem is that OBS gives you an infrastucture to build, but it will not give you a single description mechanism that will build all distros, you need to do all that by yourself. Which means in practice:
- learn 3 ways of packaging: deb, rpm, arch
- learn also what OBS previews to handle differences for each distro type (deb, rpm) in different versions.
- Ubuntu 18.04, 19.04, 20.04
- Debian 9, 10, Testing
- Fedora 31, 32
- OpenSuse Leap 15.1, 15.2, Thumbleweed
- Arch (Manjaro)
NOTE: I let out ubuntu the .10 versions because they are not needed, the .04 versions will work too
NOTE: I just added Fedora 33, but it need to be verified
NOTE: OBS supports aarch64
(for those distros that support it). Which means we will also be available to distribute our ARMv64 vms too).
We build two main packages:
- pharoMAJORVERSION
- pharoMAJORVERSION-ui
Includes the VM + plugins. It will install them into:
/usr/lib64/pharoMAJORVERSION
and it will create a symlink pharo
in /usr/bin
.
Also, some platforms require to build some dependencies (because they do not include them, or include different versions than those needed). This is the origin of the packages libffi7
, libgit2-1
.
We also have a package pharo9-plugin-tffi
but this will be removed since is not needed anymore.
This is (almost) a metapackage. It declares dependencies on pharoMAJORVERSION
and SDL2
.
It also install the pharo-ui
file and symlink to it at /usr/bin
.
NOTE: Both scripts pharo
and pharo-ui
are modified versions from what exist now in the pharo distribution.
To build, OBS uses
- a set of descriptions (depending on distros), and
- a set of sources (defined by the user).
OBS will not download anything when building, which means all elements needed to create the VM need to be there (there are some mechanism defined to be able to take things from a repository, but a) I did not dig into it and b) it would not solve our problem either).
To build the VM, I follow this steps
- generate VM sources.
- pack them into a package called as the OBS package plus OBS package version info (this version info is defined in the packaging description files). E.g.
pharo9-9.0.tar.gz
. Compressed file has to have thebuild
structure of pharovm, we do not modify that. - copy them to OBS package subdirectory, and (since OBS works as a vcs), commit the changes.
This will trigger the build.
WARNING: It will not trigger dependent builds (like pharo9-ui
)
debian usa ubuntu hay 3 "estilos" debian -> debian y debian derivados (ubuntu es uno) rpm -> fedora, rhat, opensuse y otros arch -> arch y manjaro (no se si hay otros) entonces ahí tenés los debian cosas los .dsc y .spec son para los rpm y el PKGBUILD es el de arch
si hay cosas especiales hay un esquema de prefijos tipo pharo9-Debian_Testing.dsc es una regla especial para debian "Testing" podría haber pharo9-xUbuntu_20.04.dsc
Pero en rpm, eso esta adentro del descriptor unico fijate en el pharo9.spec tenes
%if 0%{?suse_version} || 0%{?sle_version} >= 150100
BuildRequires: clang
BuildRequires: libopenssl-1_0_0-devel libuuid-devel
Requires: glibc libopenssl1_0_0 libuuid %{name}-plugin-tffi
%endif
%if 0%{?fedora}
BuildRequires: clang
BuildRequires: openssl-devel libuuid-devel
Requires: glibc openssl libuuid %{name}-plugin-tffi
%endif
con las diferencias para suse y fedora te digo, una vez que lo aprendés, es medio facilongo pero aprenderlo es un bardo además porque la documentación es pobre por ejemplo esta linea:
# Workaround to bypass test phase on OSL versions (rpath is no valid there, but
# we do not care as it will be ignored)
%if (0%{?sle_version} >= 150100)
export NO_BRP_CHECK_RPATH=true
%endif
la aprendí buscando otras configuraciones a ver como mierda resolvian el problema
As you can see, this worked fine as a PoC. To work properly, we need to:
- take the description files and transform them into templates (putting them in pharovm sources, also).
- a script that will a. generate sources and package them, b. generate description files from templates, c. copy all that into an OBS structure and commit them
- put all this as a jenkins step, maybe.
- move from
home:estebanlm
topharo
OBS group
- How does the updates (with obsoletes, conflicts and replacements) work?