From b7fc37b0154b14d677f2d05b06b761373e2d44b6 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 13 Sep 2024 16:26:15 -0700 Subject: [PATCH] store: add a hint on how to fix Lix installs broken by macOS Sequoia This is not a detailed diagnosis, and it's not worth writing one, tbh. This error basically never happens in normal operation, so diagnosing it by changing the error on macOS is good enough. Relevant: https://git.lix.systems/lix-project/lix-installer/issues/24 Relevant: https://git.lix.systems/lix-project/lix-installer/issues/18 Relevant: https://git.lix.systems/lix-project/lix/issues/521 Change-Id: I03701f917d116575c72a97502b8e1617679447f2 --- src/libstore/lock.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libstore/lock.cc b/src/libstore/lock.cc index 05296757d..377499c0a 100644 --- a/src/libstore/lock.cc +++ b/src/libstore/lock.cc @@ -73,8 +73,16 @@ struct SimpleUserLock : UserLock debug("trying user '%s'", i); struct passwd * pw = getpwnam(i.c_str()); - if (!pw) - throw Error("the user '%s' in the group '%s' does not exist", i, settings.buildUsersGroup); + if (!pw) { +#ifdef __APPLE__ +#define APPLE_HINT "\n\nhint: this may be caused by an update to macOS Sequoia breaking existing Lix installations.\n" \ + "See the macOS Sequoia page on the Lix wiki for detailed repair instructions: https://wiki.lix.systems/link/81" +#else +#define APPLE_HINT +#endif + throw Error("the user '%s' in the group '%s' does not exist" APPLE_HINT, i, settings.buildUsersGroup); +#undef APPLE_HINT + } auto fnUserLock = fmt("%s/userpool/%s", settings.nixStateDir,pw->pw_uid);