Skip to content

Commit efdbfa6

Browse files
thesamesamnirbheek
authored andcommitted
ci: add Gentoo
We may want to consider our own binpkg cache for future to speed things up, in addition to the ones provided by Gentoo's own binhost. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
1 parent 80bb47e commit efdbfa6

File tree

7 files changed

+167
-2
lines changed

7 files changed

+167
-2
lines changed

.github/workflows/images.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
- { name: Arch Linux, id: arch }
4242
- { name: CUDA (on Arch), id: cuda }
4343
- { name: Fedora, id: fedora }
44+
- { name: Gentoo, id: gentoo }
4445
- { name: OpenSUSE, id: opensuse }
4546
- { name: Ubuntu Bionic, id: bionic }
4647
- { name: Ubuntu Rolling, id: ubuntu-rolling }

.github/workflows/os_comp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- { name: Arch Linux, id: arch }
4141
- { name: CUDA (on Arch), id: cuda }
4242
- { name: Fedora, id: fedora }
43+
- { name: Gentoo, id: gentoo }
4344
- { name: OpenSUSE, id: opensuse }
4445
- { name: Ubuntu Bionic, id: bionic }
4546
container: mesonbuild/${{ matrix.cfg.id }}:latest

ci/ciimage/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def gen_bashrc(self) -> None:
7878
if [ -f "$HOME/.cargo/env" ]; then
7979
source "$HOME/.cargo/env"
8080
fi
81+
82+
if [ -f /etc/profile.env ]; then
83+
source /etc/profile.env
84+
fi
8185
'''
8286

8387
out_file.write_text(out_data, encoding='utf-8')

ci/ciimage/gentoo/image.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"base_image": "gentoo/stage3:desktop",
3+
"env": {
4+
"CI": "1",
5+
"MESON_CI_JOBNAME": "linux-gentoo-gcc",
6+
"SKIP_STATIC_BOOST": "1"
7+
}
8+
}

ci/ciimage/gentoo/install.sh

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source /ci/common.sh
5+
6+
# We divide the package list into 'pkgs_stable' and 'pkgs_latest'. The trade-off
7+
# is that latest stuff may not have a binpkg available, but of course we get
8+
# better test coverage with the bleeding edge then.
9+
pkgs_stable=(
10+
app-portage/portage-utils
11+
dev-build/cmake
12+
dev-vcs/git
13+
14+
# language support
15+
dev-python/cython
16+
dev-python/lxml
17+
dev-python/pip
18+
virtual/fortran
19+
dev-lang/nasm
20+
dev-lang/vala
21+
dev-lang/python:2.7
22+
dev-java/openjdk-bin
23+
# requires rustfmt, bin rebuild (TODO: file bug)
24+
#dev-util/bindgen
25+
26+
dev-libs/elfutils
27+
dev-libs/gobject-introspection
28+
dev-util/itstool
29+
dev-libs/protobuf
30+
31+
# custom deps
32+
net-libs/libpcap
33+
dev-util/gtk-doc
34+
media-libs/libwmf
35+
sys-cluster/openmpi
36+
sci-libs/netcdf
37+
media-libs/libsdl2
38+
dev-cpp/gtest
39+
sci-libs/hdf5
40+
dev-qt/linguist-tools
41+
sys-devel/llvm
42+
# qt6 unstable
43+
#dev-qt/qttools
44+
45+
# misc
46+
app-admin/sudo
47+
app-text/doxygen
48+
sys-apps/fakeroot
49+
sys-devel/bison
50+
sys-devel/gettext
51+
52+
# TODO: vulkan-validation-layers
53+
# TODO: cuda
54+
#dev-cpp/gtkmm:3.0
55+
#dev-java/openjdk-bin:8
56+
#dev-lang/go
57+
#dev-lang/mono
58+
#dev-lang/python
59+
#dev-lang/rust-bin
60+
#dev-libs/wayland
61+
#dev-libs/wayland-protocols
62+
#dev-python/pypy3
63+
#dev-qt/qtbase:6
64+
#dev-qt/qtcore:5
65+
#dev-qt/qttools:6
66+
#dev-vcs/mercurial
67+
#gnustep-base/gnustep-base
68+
#media-gfx/graphviz
69+
#sci-libs/netcdf-fortran
70+
#sys-devel/clang
71+
#x11-libs/gtk+:3
72+
)
73+
pkgs_latest=(
74+
# ~arch boost needed for py3.12 for now (needs 1.84)
75+
dev-build/b2
76+
dev-libs/boost
77+
78+
dev-build/autoconf
79+
dev-build/automake
80+
81+
# ~arch only
82+
sci-libs/scalapack
83+
)
84+
pkgs=( "${pkgs_stable[@]}" "${pkgs_latest[@]}" )
85+
86+
emerge-webrsync --quiet
87+
88+
# This means we can't really take advantage of the binhost but a lot of the
89+
# advantages of using Gentoo in CI come from the bleeding edge side.
90+
# With full ~arch, we don't get binpkgs for much at all. Instead, let's just
91+
# do ~arch for the test deps we have.
92+
#echo 'ACCEPT_KEYWORDS="~amd64"' >> /etc/portage/make.conf
93+
94+
printf "%s\n" ${pkgs[@]} >> /var/lib/portage/world
95+
printf "%s\n" ${pkgs_latest[@]} >> /etc/portage/package.accept_keywords/meson
96+
cat /etc/portage/package.accept_keywords/meson
97+
98+
cat <<-EOF > /etc/portage/package.accept_keywords/misc
99+
dev-lang/python-exec
100+
dev-lang/python
101+
EOF
102+
103+
mkdir /etc/portage/binrepos.conf || true
104+
mkdir /etc/portage/profile || true
105+
cat <<-EOF > /etc/portage/package.use/ci
106+
dev-cpp/gtkmm X
107+
108+
dev-libs/boost python
109+
sys-libs/zlib static-libs
110+
EOF
111+
112+
cat <<-EOF >> /etc/portage/make.conf
113+
EMERGE_DEFAULT_OPTS="--complete-graph --quiet=y --quiet-build=y --jobs=$(nproc) --load-average=$(nproc)"
114+
EMERGE_DEFAULT_OPTS="\${EMERGE_DEFAULT_OPTS} --autounmask-write --autounmask-continue --autounmask-keep-keywords=y --autounmask-use=y"
115+
EMERGE_DEFAULT_OPTS="\${EMERGE_DEFAULT_OPTS} --binpkg-respect-use=y"
116+
117+
FEATURES="\${FEATURES} parallel-fetch parallel-install -merge-sync"
118+
FEATURES="\${FEATURES} getbinpkg binpkg-request-signature"
119+
120+
# These don't work in Docker, so reduce noise in logs
121+
FEATURES="\${FEATURES} -ipc-sandbox -network-sandbox -pid-sandbox"
122+
EOF
123+
124+
# TODO: Enable all Pythons / add multiple jobs with diff. Python impls?
125+
#echo '*/* PYTHON_TARGETS: python3_10 python3_11 python3_12' >> /etc/portage/package.use/python
126+
echo '*/* PYTHON_TARGETS: python3_12' >> /etc/portage/package.use/python
127+
cat <<-EOF >> /etc/portage/profile/use.mask
128+
-python_targets_python3_12
129+
-python_single_target_python3_12
130+
EOF
131+
cat <<-EOF >> /etc/portage/profile/use.stable.mask
132+
-python_targets_python3_12
133+
-python_single_target_python3_12
134+
EOF
135+
136+
echo 'dev-lang/python ensurepip' >> /etc/portage/package.use/python
137+
138+
# Silly mono circular dep
139+
#USE=minimal emerge --oneshot dev-lang/mono
140+
141+
# If we don't want to do this, we could use the 'portage' container instead
142+
# so the stage3/repo match.
143+
emerge --update --deep --changed-use @world
144+
qlop -d 'yesterday'
145+
146+
env-update && . /etc/profile
147+
148+
rm /usr/lib/python/EXTERNALLY-MANAGED
149+
python3 -m ensurepip
150+
install_python_packages
151+
python3 -m pip install "${base_python_pkgs[@]}"

test cases/frameworks/15 llvm/test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{ "val": "combination", "skip_on_jobname": ["msys2"] }
88
],
99
"link-static": [
10-
{ "val": true, "skip_on_jobname": ["opensuse"] },
10+
{ "val": true, "skip_on_jobname": ["opensuse", "linux-gentoo-gcc"] },
1111
{ "val": false }
1212
]
1313
}

test cases/frameworks/25 hdf5/test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"matrix": {
33
"options": {
44
"method": [
5-
{ "val": "pkg-config" },
5+
{ "val": "pkg-config", "skip_on_jobname": ["linux-gentoo-gcc"] },
66
{ "val": "config-tool", "skip_on_jobname": ["macos"] }
77
]
88
}

0 commit comments

Comments
 (0)