Skip to content

Commit b0094af

Browse files
committed
[per-OS Packages] Improve error message if package is uninstallable
1 parent c43e963 commit b0094af

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

internal/nix/nixprofile/profile.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,14 @@ func ProfileInstall(ctx context.Context, args *ProfileInstallArgs) error {
272272
if exists, err := input.ValidateInstallsOnSystem(); err != nil {
273273
return err
274274
} else if !exists {
275-
platform := " " + nix.System()
275+
platform := nix.System()
276276
return usererr.New(
277-
"package %s cannot be installed on your platform%s. "+
278-
"Run `devbox add %[1]s --exclude-platform%[2]s` and re-try.",
277+
"package %s cannot be installed on your platform %s.\n"+
278+
"If you know this package is incompatible with %[2]s, then "+
279+
"you could run `devbox add %[1]s --exclude-platform %[2]s` and re-try.\n"+
280+
"If you think this package should be compatible with %[2]s, then "+
281+
"it's possible this particular version is not available yet from the nix registry. "+
282+
"You could try `devbox add` with a different version for this package.\n",
279283
input.Raw,
280284
platform,
281285
)

0 commit comments

Comments
 (0)