Skip to content
Merged
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: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
3 changes: 2 additions & 1 deletion doc/nixos.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 1 addition & 3 deletions nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion nix/tests/module-cross.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
8 changes: 3 additions & 5 deletions nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
Loading