Merge pull request #399 from sched-ext/meson-serialize

meson: introduce serialize build option
This commit is contained in:
Andrea Righi 2024-06-28 20:13:16 +02:00 committed by GitHub
commit 183b1b2cfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 47 additions and 6 deletions

View File

@ -264,6 +264,7 @@ options can be used in such cases.
- 'cargo_home': 'CARGO_HOME env to use when invoking cargo'
- `offline`: 'Compilation step should not access the internet'
- `enable_rust`: 'Enable the build of rust sub-projects'
- `serialize`: 'Enable/disable the sequential build of the schedulers. Set this to false if you need to build just one scheduler.'
For example, let's say you want to use `bpftool` and `libbpf` shipped in the
kernel tree located at `$KERNEL`. We need to build `bpftool` in the kernel

View File

@ -12,6 +12,8 @@ cc = meson.get_compiler('c')
enable_rust = get_option('enable_rust')
serialize = get_option('serialize')
bpf_clang = find_program(get_option('bpf_clang'))
enable_stress = get_option('enable_stress')

View File

@ -14,6 +14,8 @@ option('offline', type: 'boolean', value: 'false',
description: 'Compilation step should not access the internet')
option('enable_rust', type: 'boolean', value: 'true',
description: 'Enable rust sub-projects')
option('serialize', type: 'boolean', value: 'true',
description: 'Serialize the build of all schedulers')
option('enable_stress', type: 'boolean', value: 'true',
description: 'Enable stress tests')
option('kernel', type: 'string', value: 'vmlinuz',

View File

@ -1,8 +1,14 @@
if serialize
sched_deps = [libbpf, bpftool_target, sched]
else
sched_deps = [libbpf, bpftool_target]
endif
sched = custom_target('scx_lavd',
output: '@PLAINNAME@.__PHONY__',
input: 'Cargo.toml',
command: [cargo, 'build', '--manifest-path=@INPUT@', '--target-dir=@OUTDIR@',
cargo_build_args],
env: cargo_env,
depends: [sched],
depends: sched_deps,
build_always_stale: true)

View File

@ -1,8 +1,14 @@
if serialize
sched_deps = [libbpf, bpftool_target, sched]
else
sched_deps = [libbpf, bpftool_target]
endif
sched = custom_target('scx_layered',
output: '@PLAINNAME@.__PHONY__',
input: 'Cargo.toml',
command: [cargo, 'build', '--manifest-path=@INPUT@', '--target-dir=@OUTDIR@',
cargo_build_args],
env: cargo_env,
depends: [libbpf, bpftool_target, sched],
depends: sched_deps,
build_always_stale: true)

View File

@ -1,8 +1,14 @@
if serialize
sched_deps = [libbpf, bpftool_target, sched]
else
sched_deps = [libbpf, bpftool_target]
endif
sched = custom_target('scx_mitosis',
output: '@PLAINNAME@.__PHONY__',
input: 'Cargo.toml',
command: [cargo, 'build', '--manifest-path=@INPUT@', '--target-dir=@OUTDIR@',
cargo_build_args],
env: cargo_env,
depends: [libbpf, bpftool_target, sched],
depends: sched_deps,
build_always_stale: true)

View File

@ -1,8 +1,14 @@
if serialize
sched_deps = [libbpf, bpftool_target, sched]
else
sched_deps = [libbpf, bpftool_target]
endif
sched = custom_target('scx_rlfifo',
output: '@PLAINNAME@.__PHONY__',
input: 'Cargo.toml',
command: [cargo, 'build', '--manifest-path=@INPUT@', '--target-dir=@OUTDIR@',
cargo_build_args],
env: cargo_env,
depends: [libbpf, bpftool_target, sched],
depends: sched_deps,
build_always_stale: true)

View File

@ -1,8 +1,14 @@
if serialize
sched_deps = [libbpf, bpftool_target, sched]
else
sched_deps = [libbpf, bpftool_target]
endif
sched = custom_target('scx_rustland',
output: '@PLAINNAME@.__PHONY__',
input: 'Cargo.toml',
command: [cargo, 'build', '--manifest-path=@INPUT@', '--target-dir=@OUTDIR@',
cargo_build_args],
env: cargo_env,
depends: [libbpf, bpftool_target, sched],
depends: sched_deps,
build_always_stale: true)

View File

@ -1,8 +1,14 @@
if serialize
sched_deps = [libbpf, bpftool_target, sched]
else
sched_deps = [libbpf, bpftool_target]
endif
sched = custom_target('scx_rusty',
output: '@PLAINNAME@.__PHONY__',
input: 'Cargo.toml',
command: [cargo, 'build', '--manifest-path=@INPUT@', '--target-dir=@OUTDIR@',
cargo_build_args],
env: cargo_env,
depends: [libbpf, bpftool_target, sched],
depends: sched_deps,
build_always_stale: true)