From 0b1800a9c563f1d8b2e699d373f4889a8f36455f Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Thu, 12 Sep 2024 13:50:24 -0400 Subject: [PATCH] fix regression in construct-env.ts closes #1036 --- src/prefab/construct-env.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/prefab/construct-env.ts b/src/prefab/construct-env.ts index 6bae4d41..c6b2dd2c 100644 --- a/src/prefab/construct-env.ts +++ b/src/prefab/construct-env.ts @@ -37,7 +37,11 @@ export default async function(pkgenv: { installations: Installation[] }) { ///////////////////////// reworked from useShellEnv needs porting back to libpkgx async function mkenv({installations}: {installations: Installation[]}) { const projects = new Set(installations.map(x => `${x.pkg.project}@${x.pkg.version}`)) - console.assert(projects.size == installations.length, "pkgx: env is being duped") + + // we need to do this as well, since we allow multiple versions of e.g. unicode.org. + // however, if we *just* use this as `projects`, then tests below like `projects.has('cmake.org')` will fail + const projects_with_versions = new Set(installations.map(x => `${x.pkg.project}@${x.pkg.version}`)) + console.assert(projects_with_versions.size == installations.length, "pkgx: env is being duped") const common_vars: Record> = {} const common_keys = new Set()