diff --git a/CHANGELOG.md b/CHANGELOG.md index a3dacc6..ff41639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,4 +19,4 @@ - `dynamicTimeoutMs`, `dynamicLimit`, `maxCompletions`, `cacheTtlSecs` and `completeTimeoutMs` reject negative values at evaluation. negative values used to be ignored or replaced by the default at runtime. a negative `timeoutMs` or `workers = 0` already failed the build and now fails at evaluation. `ee0111c` - `helpOnlyCommands` follows the `--help-only` change above and covers the subcommands of each listed command. `8fdc9c1` -- when cross compiling, a scraped package, `nushellPackage` or `package` is only replaced by its spliced build-platform twin, or by the stock build package when it is the unmodified stock package. an override is no longer matched to the stock build package by name and version. a scraped package without a twin is skipped with a warning naming it, and a `nushellPackage` or `package` without one fails evaluation, where both used to run with the host-platform tools. `1524d5f` +- when cross compiling, a scraped package, `nushellPackage` or `package` is only replaced by its spliced build-platform twin, or by the stock build package when it is the unmodified stock package. an override is no longer matched to the stock build package by name and version. a scraped package without a twin is indexed with the build-platform tools, so binaries the build machine cannot run get completions from their man pages only, and a `nushellPackage` or `package` without one fails evaluation, where both used to run with the host-platform tools. `1524d5f` diff --git a/doc/nixos.md b/doc/nixos.md index b7e0a7a..7d5d2aa 100644 --- a/doc/nixos.md +++ b/doc/nixos.md @@ -286,6 +286,7 @@ used by the module. if discovery or indexing fails, the build fails rather than silently shipping an empty or incomplete index. when cross compiling, a package is indexed with its build-platform twin, the spliced build package or the stock build package when the package is the unmodified stock one. a package -without a twin, such as an override, is skipped with a warning naming it. a +without a twin, such as an override, is indexed itself with the build-platform +tools. binaries the build machine cannot run are indexed from their man pages. a `nushellPackage` or `package` without one fails evaluation, since host-platform tools cannot run on the build machine. diff --git a/nix/module.nix b/nix/module.nix index 08b3427..acf375f 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -333,9 +333,7 @@ in plan = indexToolsFor pkg; index = mkIndex pkg.name plan.tools (installedOutputs plan.scrape); in - lib.optionalString (plan != null) ( - lib.concatMapStrings (prefix: "${prefix} ${index}\n") (installedOutputs pkg) - ); + lib.concatMapStrings (prefix: "${prefix} ${index}\n") (installedOutputs pkg); sourcesFile = pkgs.writeText "inshellah-sources" ( lib.concatMapStrings indexFor ( lib.filter lib.isDerivation (config.environment.systemPackages ++ cfg.extraScrapePackages) diff --git a/nix/tests/module-cross.nix b/nix/tests/module-cross.nix index 31fb4e9..e60fdd2 100644 --- a/nix/tests/module-cross.nix +++ b/nix/tests/module-cross.nix @@ -81,7 +81,9 @@ let (indexToolsFor { } defaultPackage).scrape == buildInshellah; "a priority wrapped stock package resolves to its build twin" = (indexToolsFor { } (lib.hiPrio crossPkgs.hello)).scrape == buildHello; - "an overridden scraped package is skipped" = indexToolsFor { } overriddenHello == null; + "an overridden scraped package indexes itself with build platform tools" = + (indexToolsFor { } overriddenHello).scrape == overriddenHello + && indexUsesBuildPlatform overriddenHello; "an overridden nushellPackage fails evaluation" = throws (extraSetupFor { nushellPackage = overriddenNu; }); diff --git a/nix/tools.nix b/nix/tools.nix index 73ded93..03fe3c9 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -81,11 +81,9 @@ in tools = hostTools; scrape = pkg; } - else if twin != null then + else { tools = buildTools; - scrape = twin; - } - else - lib.warn "programs.inshellah: ${pkg.name} has no build-platform twin to run while cross compiling, so it is not indexed" null; + scrape = if twin != null then twin else pkg; + }; }