Closed maximd closed 2 months ago
It's worth mentioning that at SPI we're using a RHEL-based OS and make use of devtoolset-6 (or other versions) for gcc, and our package recipe looks like:
pkg: gcc/6.3.1+r.1
build:
options:
- pkg: stdfs
script:
- true
install:
environment:
- set: CC
value: /opt/rh/devtoolset-6/root/usr/bin/gcc
- set: CXX
value: /opt/rh/devtoolset-6/root/usr/bin/g++
- prepend: PATH
value: /opt/rh/devtoolset-6/root/usr/bin
requirements:
- pkg: stdfs
So we don't actually use a self-compiled gcc and using the devtoolset gcc produces binaries compatible with the base distro. Going this route has the benefit of being able to depend on other libraries provided by the distro without having to make spk packages for things where the distro-provided version all you need.
And on Rocky we expose the default gcc this way:
# This package is essentially empty -- it represents using the native version
# of gcc installed on rocky 9.3 (gcc 11).
#
# It doesn't attempt to clean the environment ($PATH, $CC, $CXX) which may be
# set to some other compiler.
pkg: gcc/11.4.1
build:
options:
- pkg: stdfs
script:
- true
variants:
- { distro: rocky }
install:
requirements:
- pkg: stdfs
So we don't actually use a self-compiled gcc and using the devtoolset gcc produces binaries compatible with the base distro. Going this route has the benefit of being able to depend on other libraries provided by the distro without having to make spk packages for things where the distro-provided version all you need.
Ah thanks for the feedback, I figured there must be a way to use the precompiled packages provided by the OS :)
We are especially interested in testing spk on Rocky 9 as a first step, so thanks for the hint!
~Is there any additional documentation on package recipes?~ I found https://getspk.io/admin/bootstrap/ and https://getspk.io/use/spec/#build-configuration so I will go from there to setup a working environment.
We're still figuring out the project configuration now that the repo is public, it seems that this PR didn't run any of the github actions? Anyway CI is failing on the package lint step now that this was merged. I'm investigating.
Failed gnu/gcc/gcc63.spk.yaml:
----->
| #
2 | pkg: gcc/6.3.O
| ^ pkg: Error: expected an ascii digit at O at line 2 column 6
| api: v0/package
|
| sources:
| - tar: http://ftpmirror.gnu.org/gnu/gcc/gcc-6.3.O/gcc-6.3.O.tar.gz
|
The commit history shows that the GCC version was originally 6.3.0 (https://github.com/spkenv/spk/commit/7fb02e3d40596135bee3e58f82799d4f5c677851#diff-633c824ed40d9bb6e821cfa853b3789251fcf4c79857ace47213ebdac3dbbe8c) and the GCC releases shows 6.3.0 as the only valid 6.3 version.
Fixes #1091