Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ci/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import sys
import contextlib

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[1].as_posix())

from ci.lib.runner import ArgparseActionList, TestConfig, matrix_product
Expand Down
2 changes: 2 additions & 0 deletions ci/examples/blk.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import tempfile
import types

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[2].as_posix())

from ci.lib.backends import *
Expand Down
2 changes: 2 additions & 0 deletions ci/examples/echo_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from pathlib import Path
import sys

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[2].as_posix())

from ci.lib.backends import *
Expand Down
2 changes: 2 additions & 0 deletions ci/examples/i2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from pathlib import Path
import sys

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[2].as_posix())

from ci.lib.backends import *
Expand Down
2 changes: 2 additions & 0 deletions ci/examples/i2c_bus_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from pathlib import Path
import sys

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[2].as_posix())

from ci.lib.backends import *
Expand Down
2 changes: 2 additions & 0 deletions ci/examples/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from pathlib import Path
import sys

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[2].as_posix())

from ci.lib.backends import *
Expand Down
2 changes: 2 additions & 0 deletions ci/examples/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from pathlib import Path
import sys

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[2].as_posix())

from ci.lib.backends import *
Expand Down
2 changes: 2 additions & 0 deletions ci/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from pathlib import Path
import sys

assert list(map(int, sys.version.split(" ")[0].split("."))) > [3, 9, 0]

sys.path.insert(1, Path(__file__).parents[1].as_posix())

from ci.common import TestConfig, backend_fn
Expand Down
17 changes: 17 additions & 0 deletions flake.lock

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

19 changes: 17 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
# Python 3.9 is not in the official repo anymore
python39.url = "github:NixOS/nixpkgs/c5dd43934613ae0f8ff37c59f61c507c2e8f980d";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to download duplicates of everything including entire libc and everything, which is a lot of extra things to download

zig-overlay.url = "github:mitchellh/zig-overlay";
zig-overlay.inputs.nixpkgs.follows = "nixpkgs";
sdfgen.url = "github:au-ts/microkit_sdf_gen/0.28.1";
Expand All @@ -16,6 +18,7 @@
outputs =
{
nixpkgs,
python39,
zig-overlay,
sdfgen,
...
Expand All @@ -39,13 +42,16 @@
pkgs = import nixpkgs {
inherit system;
};
pkgs39 = import python39 {
inherit system;
};

llvm = pkgs.llvmPackages_18;
zig = zig-overlay.packages.${system}."0.15.1";

pysdfgen = sdfgen.packages.${system}.pysdfgen.override {
zig = zig;
pythonPackages = pkgs.python312Packages;
pythonPackages = pkgs39.python39Packages;
};

clang-complete = (pkgs.symlinkJoin {
Expand Down Expand Up @@ -73,9 +79,16 @@

genmc = pkgs.callPackage ./ci/genmc/nix/package.nix { inherit clang-complete; llvm = pkgs.llvmPackages_20.llvm; };

pythonTool = pkgs.python312.withPackages (ps: [
pythonTool = pkgs39.python39.withPackages (ps: [
pysdfgen
]);
## Fixup python and python3 resolving
pythonShim = pkgs.writeShellScriptBin "python" ''
exec ${pythonTool}/bin/python3 "$@"
'';
python3Shim = pkgs.writeShellScriptBin "python3" ''
exec ${pythonTool}/bin/python3 "$@"
'';
in
{
genmc = pkgs.mkShell rec {
Expand Down Expand Up @@ -131,6 +144,8 @@
llvm.libllvm
dtc
pythonTool
pythonShim
python3Shim
];

# To avoid Nix adding compiler flags that are not available on a freestanding
Expand Down