From 04d7278a75d5cee4d6e3368f563784eec729518c Mon Sep 17 00:00:00 2001 From: mdsitton Date: Mon, 13 Jul 2026 18:49:31 -0500 Subject: [PATCH] Fix BeefBuild managed cache path on packaged Linux Initialize the packaged Linux user data directory for both BeefIDE and the CLI so BeefBuild stores managed libraries under the user's config directory instead of the installation directory. Report managed cache directory creation failures and propagate package manager initialization errors back through project loading. This prevents projects from being marked deferred when no package work was queued, which previously left BeefBuild polling indefinitely. --- BeefBuild/src/BuildApp.bf | 1 + IDE/src/BeefConfig.bf | 2 ++ IDE/src/IDEApp.bf | 19 ++++++++++++++----- IDE/src/util/PackMan.bf | 7 ++++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/BeefBuild/src/BuildApp.bf b/BeefBuild/src/BuildApp.bf index 9b7347251..241091803 100644 --- a/BeefBuild/src/BuildApp.bf +++ b/BeefBuild/src/BuildApp.bf @@ -84,6 +84,7 @@ namespace BeefBuild Fail("Platform not specified"); base.Init(); + InitUserDataDir(); mSettings.Load(); mSettings.Apply(); diff --git a/IDE/src/BeefConfig.bf b/IDE/src/BeefConfig.bf index 901958dda..e0f6cc65e 100644 --- a/IDE/src/BeefConfig.bf +++ b/IDE/src/BeefConfig.bf @@ -233,6 +233,8 @@ namespace IDE #endif if (Directory.CreateDirectory(managedPath) case .Ok) mManagedLibPath.Set(managedPath); + else + gApp.OutputErrorLine("Failed to create managed library directory '{0}'", managedPath); } mConfigFiles.Add(configFile); diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index 26c05067b..4bd963bad 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -3372,7 +3372,11 @@ namespace IDE } else { - mPackMan.GetWithVersion(projectName, url, ver); + if (mPackMan.GetWithVersion(projectName, url, ver) case .Err) + { + Fail(scope $"Failed to initialize managed library support for project '{projectName}'"); + return .Err(.NotFound); + } isDeferredLoad = true; } default: @@ -13081,6 +13085,14 @@ namespace IDE return mVersionInfo; } + protected void InitUserDataDir() + { +#if BF_PLATFORM_LINUX && LINUX_PACKAGE + delete mUserDataDir; + mUserDataDir = new $"{Environment.GetEnvironmentVariable("HOME", .. scope .())}/.config/beeflang/"; +#endif + } + #if !CLI public override void Init() { @@ -13110,10 +13122,7 @@ namespace IDE mSettings.Apply(); mGitManager.Init(); - -#if BF_PLATFORM_LINUX && LINUX_PACKAGE - mUserDataDir = new $"{Environment.GetEnvironmentVariable("HOME", .. scope .())}/.config/beeflang/"; -#endif + InitUserDataDir(); //Yoop(); diff --git a/IDE/src/util/PackMan.bf b/IDE/src/util/PackMan.bf index eaafeb258..728bcad11 100644 --- a/IDE/src/util/PackMan.bf +++ b/IDE/src/util/PackMan.bf @@ -290,10 +290,10 @@ namespace IDE.util mWorkItems.Add(workItem); } - public void GetWithVersion(StringView projectName, StringView url, SemVer semVer) + public Result GetWithVersion(StringView projectName, StringView url, SemVer semVer) { if (!CheckInit()) - return; + return .Err; bool ignoreLock = false; if (gApp.mWantUpdateVersionLocks != null) @@ -309,7 +309,7 @@ namespace IDE.util case .Git(let checkURL, let tag, let hash): if (checkURL == url) GetWithHash(projectName, url, tag, hash); - return; + return .Ok; default: } } @@ -324,6 +324,7 @@ namespace IDE.util if (semVer?.IsEmpty == false) workItem.mConstraints = new .() { new String(semVer.mVersion) }; mWorkItems.Add(workItem); + return .Ok; } public void UpdateGitConstraint(StringView url, SemVer semVer)