Skip to content

build_sdk: fix config overriding#563

Merged
midnightveil merged 2 commits into
seL4:mainfrom
au-ts:julia/fix-config-generation-order
Jul 16, 2026
Merged

build_sdk: fix config overriding#563
midnightveil merged 2 commits into
seL4:mainfrom
au-ts:julia/fix-config-generation-order

Conversation

@midnightveil

@midnightveil midnightveil commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Previously duplicate config values would cause multiple
-DKernelOption values being passed on the command line,
and then it was up to CMake shenanigans for how this behaves,
especially if they were incompatible options. Instead, merge
the dictionaries and so later-options are more important.

In order of priority, we have:

  • Common kernel options for all arches
  • The kernel arch option
  • Any common arch-specific kernel options
  • Board-specific kernel options

I tested that this makes no changes to the configurations that were build by building the two SDKs, running this script, and then diffing the output, which reported no diffs (that weren't reorderings or different paths)

#!/usr/bin/env bash

set -euo pipefail

build_dir=$(readlink -f "$1")
out_dir_cfg=$(readlink -f "$2")
out_dir_cmake=$(readlink -f "$3")

pushd "$build_dir"

for file in $(fd -t file -uuu gen_config); do
  # zcu102/benchmark/sel4/install/libsel4/include/kernel/gen_config.h
  ofile=$(echo "$file" | sed "s@/@__@g")

  echo "$file --> $ofile"

  cp "$file" "$out_dir_cfg/$ofile"
done;

for file in $(fd -t file -uuu CMakeCache.txt); do
  # x86_64_generic_vtx/smp-release/sel4/build/CMakeCache.txt
  ofile=$(echo "$file" | sed "s@/@__@g")

  echo "$file --> $ofile"

  cp "$file" "$out_dir_cmake/$ofile"
done;


popd

Previously duplicate config values would cause multiple
`-DKernelOption` values being passed on the command line,
and then it was up to CMake shenanigans for how this behaves,
especially if they were incompatible options. Instead, merge
the dictionaries and so later-options are more important.

In order of priority, we have:

- Common kernel options for all arches
- The kernel arch option
- Any common arch-specific kernel options
- Board-specific kernel options

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
Instead of having defaults for each-board, the default
is a global variabled merged into config_args when
we build seL4 that takes priorities into account.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
@midnightveil
midnightveil force-pushed the julia/fix-config-generation-order branch from 56936ab to 0462375 Compare July 16, 2026 02:30
@midnightveil
midnightveil merged commit ee52c8b into seL4:main Jul 16, 2026
12 checks passed
@midnightveil
midnightveil deleted the julia/fix-config-generation-order branch July 16, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants