nix-environments
nix-environments copied to clipboard
yocto: unable to build old Yocto releases
Environment
- Ubuntu 24.04.2 with nix
- Yocto kirkstone
- nix-environments#yocto
Steps to reproduce
$ gcc --version
zsh: command not found: gcc
$ git clone git://git.yoctoproject.org/poky
$ cd poky
$ git checkout kirkstone
$ nix develop --impure --no-write-lock-file github:nix-community/nix-environments#yocto
$ gcc --version
gcc --version
gcc (GCC) 14.3.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ . oe-init-build-env
$ bitbake core-image-minimal
==>
[...]
ERROR: libcomps-native-0.1.18-r0 do_compile: ExecutionError('/home/benjamin/yocto/poky/build/tmp/work/x86_64-linux/libcomps-native/0.1.18-r0/temp/run.do_compile.2363001', 1, None, None)
[...]
| /home/benjamin/yocto/poky/build/tmp/work/x86_64-linux/libcomps-native/0.1.18-r0/git/libcomps/tests/check_parse.c:588:11: error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocCategory *’ [-Wincompatible-pointer-types]
| 588 | g = (COMPS_DocCategory*)it->comps_obj;
[...]
Tests done
gcc version used to build Yocto kirkstone is too recent.
I tried the following flake.nix without success:
{
inputs.nix-environments.url = "github:nix-community/nix-environments";
outputs = { self, nixpkgs, nix-environments }:
let system = "x86_64-linux";
in {
devShell.${system} = let pkgs = import nixpkgs { inherit system; };
in nix-environments.devShells.${system}.yocto.overrideAttrs (old: {
extraPkgs = [ pkgs.gcc11 ];
stdenv = pkgs.gcc11Stdenv;
});
};
}
What is the best way to force gcc11 with nix-environments#yocto?