clan-cli: fix clan-cli accidentally dependending on all packages

This commit is contained in:
Michael Hoang
2025-02-03 11:27:54 +07:00
committed by clan-bot
parent efcfae387f
commit 9458fdf7bc
2 changed files with 60 additions and 54 deletions

View File

@@ -94,6 +94,7 @@
self.nixosConfigurations.test-install-machine.config.system.clan.deployment.file
pkgs.stdenv.drvPath
pkgs.nixos-anywhere
pkgs.bubblewrap
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
in

View File

@@ -42,11 +42,12 @@ let
generateRuntimeDependenciesMap =
deps:
lib.filterAttrs (_: pkg: !pkg.meta.unsupported or false) (lib.genAttrs deps (name: pkgs.${name}));
runtimeDependenciesMap = generateRuntimeDependenciesMap allDependencies;
runtimeDependencies = lib.attrValues runtimeDependenciesMap;
includedRuntimeDependenciesMap = generateRuntimeDependenciesMap includedRuntimeDeps;
testRuntimeDependenciesMap = generateRuntimeDependenciesMap allDependencies;
testRuntimeDependencies = lib.attrValues testRuntimeDependenciesMap;
bundledRuntimeDependenciesMap = generateRuntimeDependenciesMap includedRuntimeDeps;
bundledRuntimeDependencies = lib.attrValues bundledRuntimeDependenciesMap;
testDependencies = runtimeDependencies ++ [
testDependencies = testRuntimeDependencies ++ [
gnupg
stdenv.cc # Compiler used for certain native extensions
(pythonRuntime.withPackages (ps: (pyTestDeps ps) ++ (pyDeps ps)))
@@ -103,7 +104,7 @@ pythonRuntime.pkgs.buildPythonApplication {
"--prefix"
"PATH"
":"
(lib.makeBinPath (lib.attrValues includedRuntimeDependenciesMap))
(lib.makeBinPath (lib.attrValues bundledRuntimeDependenciesMap))
# We need this for templates to work
"--set"
@@ -112,7 +113,7 @@ pythonRuntime.pkgs.buildPythonApplication {
"--set"
"CLAN_STATIC_PROGRAMS"
(lib.concatStringsSep ":" (lib.attrNames includedRuntimeDependenciesMap))
(lib.concatStringsSep ":" (lib.attrNames bundledRuntimeDependenciesMap))
];
nativeBuildInputs = [
@@ -120,10 +121,12 @@ pythonRuntime.pkgs.buildPythonApplication {
installShellFiles
];
propagatedBuildInputs = [ pythonRuntimeWithDeps ] ++ runtimeDependencies;
propagatedBuildInputs = [ pythonRuntimeWithDeps ] ++ bundledRuntimeDependencies;
# Define and expose the tests and checks to run in CI
passthru.tests = (lib.mapAttrs' (n: lib.nameValuePair "clan-dep-${n}") runtimeDependenciesMap) // {
passthru.tests =
(lib.mapAttrs' (n: lib.nameValuePair "clan-dep-${n}") testRuntimeDependenciesMap)
// {
clan-pytest-without-core =
runCommand "clan-pytest-without-core" { nativeBuildInputs = testDependencies; }
''
@@ -177,8 +180,10 @@ pythonRuntime.pkgs.buildPythonApplication {
passthru.nixpkgs = nixpkgs';
passthru.devshellPyDeps = ps: (pyTestDeps ps) ++ (pyDeps ps) ++ (devDeps ps);
passthru.pythonRuntime = pythonRuntime;
passthru.runtimeDependencies = runtimeDependencies;
passthru.runtimeDependenciesMap = runtimeDependenciesMap;
passthru.runtimeDependencies = bundledRuntimeDependencies;
passthru.runtimeDependenciesMap = bundledRuntimeDependenciesMap;
passthru.testRuntimeDependencies = testRuntimeDependencies;
passthru.testRuntimeDependenciesMap = testRuntimeDependenciesMap;
postInstall = ''
cp -r ${nixpkgs'} $out/${pythonRuntime.sitePackages}/clan_cli/nixpkgs