Skip to content

Commit

Permalink
WiP: blunt CircleCI nix-shell build without gnat6/ada with all boards…
Browse files Browse the repository at this point in the history
… configs without libgfxinit linuxboot#1269

Modified with limited understanding absolute local builds to reuse Nix cache of already confirmed reproducible stuff
Removed gnat6/ada, added swtpm, texinfo and rsync for which otherwise there was local failings
  • Loading branch information
tlaurion committed May 7, 2023
1 parent 9f0988e commit 3b13edb
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@ commands:
type: string
steps:
- run:
name: Install dependencies
command: |
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
apt update
apt install -y build-essential zlib1g-dev uuid-dev libdigest-sha-perl libelf-dev bc bzip2 bison flex git gnupg gawk iasl m4 nasm patch python python2 python3 wget gnat cpio ccache pkg-config cmake libusb-1.0-0-dev autoconf texinfo ncurses-dev doxygen graphviz udev libudev1 libudev-dev automake libtool rsync innoextract sudo libssl-dev device-tree-compiler u-boot-tools sharutils e2fsprogs parted curl unzip
- run:
name: Make Board (FULL ORDERED BUILD LOGS HERE UNTIL JOB FAILED)
name: Make Board
command: |
rm -rf build/<<parameters.arch>>/<<parameters.target>>/* build/<<parameters.arch>>/log/* && make V=1 BOARD=<<parameters.target>> <<parameters.subcommand>> || touch ./tmpDir/failed_build
rm -rf build/<<parameters.arch>>/<<parameters.target>>/* build/<<parameters.arch>>/log/* &&
nix-shell --pure 'make V=1 BOARD=<<parameters.target>> <<parameters.subcommand>>' || touch ./tmpDir/failed_build
no_output_timeout: 3h
- run:
name: Output hashes
Expand Down Expand Up @@ -85,7 +80,7 @@ jobs:
- heads-coreboot-musl-cross-{{ checksum "./tmpDir/coreboot_musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }}
#If precedent cache not found. Restore cache for musl-cross-make module digest (rarely modified).
#Otherwise, we build cleanly.
- heads-musl-cross-{{ checksum "./tmpDir/musl-cross.sha256sums" }}
- heads-musl-cross-{{ checksum "./tmpDir/musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }}
- run:
name: Download and neuter xx20 ME (keep generated GBE and extracted IFD in tree)
command: |
Expand Down Expand Up @@ -114,7 +109,7 @@ jobs:

build_and_persist:
docker:
- image: debian:11
- image: nixos/nix:2.12.0
resource_class: large
parameters:
arch:
Expand All @@ -141,7 +136,7 @@ jobs:

build:
docker:
- image: debian:11
- image: nixos/nix:2.12.0
resource_class: large
parameters:
arch:
Expand All @@ -161,7 +156,7 @@ jobs:

save_cache:
docker:
- image: debian:11
- image: nixos/nix:2.12.0
resource_class: large
steps:
- attach_workspace:
Expand Down
58 changes: 58 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
description = "heads flake, mostly for devshell for now";

inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
gnat6nixpkgs.url = "nixpkgs/19cb612405c82c7f4fb3ce4497e24c1efa0b1935";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShell =
(pkgs.buildFHSUserEnv {
name = "heads-build-env";
targetPkgs = pkgs: (with pkgs;
[
bison # Generate flashmap descriptor parser
curl
flex
git
gcc
gnumake
m4
ncurses # make menuconfig
nss # ca-certs
perl
pkgconfig
qemu # test the image
wget
which
zlib.dev
profile = ''
'';
})
.env;
});
}
39 changes: 39 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
let
_pkgs = import <nixpkgs> {};
in
{
pkgs ?
import (_pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
#branch@date: nixpkgs-unstable@2023-01-03
rev = "298add347c2bbce14020fcb54051f517c391196b";
sha256 = "0q0c6gf21rbfxvb9fvcmybvz9fxskbk324xbvqsh1dz2wzgylrja";
}) {},
}:
(pkgs.buildFHSUserEnv {
name = "heads-build-env";
targetPkgs = pkgs: (with pkgs; [
bison # Generate flashmap descriptor parser
curl
flex
texinfo
gcc
git
gnumake
m4
ncurses # make menuconfig
nss # ca-certs
perl
pkgconfig
wget
which
rsync #needed by 5.x linux kernels
qemu #test image
swtpm #test image with qemu and BOARD=qemu-(fb)whiptail-tpm(1/2) targets
zlib.dev
]);
profile = ''
'';
})
.env

0 comments on commit 3b13edb

Please sign in to comment.