pkgx: unexpected error cannot intersect: @1.6.4 && @1.5.4

Getting the following error in a random fashion as i move through terraform codebases

Error

$ terraform fmt -recursive
× unexpected error cannot intersect: @1.6.4 && @1.5.4
│ Error: cannot intersect: @1.6.4 && @1.5.4
│     at Module.intersect (https://deno.land/x/libpkgx@v0.15.0/src/utils/semver.ts:382:30)
│     at condense (https://deno.land/x/libpkgx@v0.15.0/src/plumbing/hydrate.ts:78:33)
│     at hydrate (https://deno.land/x/libpkgx@v0.15.0/src/plumbing/hydrate.ts:13:15)
│     at file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/prefab/install.ts:10:60
│     at failsafe (file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/prefab/failsafe.ts:5:18)
│     at default (file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/prefab/install.ts:10:47)
│     at eventLoopTick (ext:core/01_core.js:178:11)
│     at async default (file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/modes/x.ts:30:18)
│     at async default (file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/app.ts:48:11)
│     at async file:///Users/builder/actions-runner/_work/pkgx/pkgx/entrypoint.ts:59:3
╰─➤ https://github.com/pkgxdev/pkgx/issues/new

Workaround

Do dev off and then run dev

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Reactions: 2
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I hit this too today, I would think it’s related, but otherwise I’ll open another issue. Tried to run pkgx psql in a folder with some packages already, and got:

$ env +psql
× unexpected error cannot intersect: ^71 && ^73
│ Error: cannot intersect: ^71 && ^73
│     at Module.intersect (https://deno.land/x/libpkgx@v0.16.0/src/utils/semver.ts:384:30)
│     at hydrate (https://deno.land/x/libpkgx@v0.16.0/src/plumbing/hydrate.ts:51:48)
│     at eventLoopTick (ext:core/01_core.js:181:11)
│     at async failsafe (file:///Users/runner/work/pkgx/pkgx/src/prefab/failsafe.ts:5:12)
│     at async default (file:///Users/runner/work/pkgx/pkgx/src/prefab/install.ts:10:41)
│     at async default (file:///Users/runner/work/pkgx/pkgx/src/modes/internal.use.ts:16:20)
│     at async default (file:///Users/runner/work/pkgx/pkgx/src/app.ts:65:20)
│     at async file:///Users/runner/work/pkgx/pkgx/entrypoint.ts:59:3
╰─➤ https://github.com/pkgxdev/pkgx/issues/new

Output of env:

PKGX_POWDER=nodejs.org^18 git-scm.org pkgx.sh
PKGX_PKGENV=curl.se/ca-certs=2023.8.22 gnome.org/libxml2=2.11.4 tukaani.org/xz=5.4.5 unicode.org=71.1.0 openssl.org=1.1.1w zlib.net=1.3.0 gnu.org/gettext=0.21.1 curl.se=8.3.0 perl.org=5.38.0 libexpat.github.io=2.5.0 nodejs.org=18.18.0 npmjs.com=9.9.0 git-scm.org=2.42.0 pkgx.sh=1.1.4

pkgx.yaml:

dependencies:
  nodejs.org: 18
  npmjs.com: 9

basically this code needs to know if it’s going from one dev-env to another, rather than within a single dev-env. your test case looks something like this:

mkdir -p a/b a/c
echo -e "dependencies:\n  llvm.org: ^15" >a/pkgx.yml
echo -e "dependencies:\n  llvm.org: ^16" >a/b/pkgx.yml
cd a
dev
test "$(clang --version)" | grep "version 15"
cd b
test "$(clang --version)" | grep "version 16"
cd c
test "$(clang --version)" | grep "version 15"
cd b
test "$(clang --version)" | grep "version 16"
cd ..
test "$(clang --version)" | grep "version 15"
cd c
test "$(clang --version)" | grep "version 15"

i think.