janet-lang / jpm

Janet Project Manager
MIT License
65 stars 21 forks source link

jpm installation requires multiple runs to succeed #55

Closed ianthehenry closed 2 years ago

ianthehenry commented 2 years ago

From an empty directory, run:

$ jpm -l install https://github.com/janet-lang/spork
Initialized empty Git repository in /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork/.git/
...
generating meta file build/spork/rawterm.meta.janet...
error: could not open file build/spork/rawterm.meta.janet with mode wb
compiling src/json.c to build/src___json.o...
generating meta file build/spork/json.meta.janet...
error: could not open file build/spork/json.meta.janet with mode wb
compiling src/rawterm.c to build/src___rawterm.o...
compiling src/tarray.c to build/src___tarray.o...
generating meta file build/spork/tarray.meta.janet...
error: could not open file build/spork/tarray.meta.janet with mode wb
error: build fail
  in pdag [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 214, column 9
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 200, column 5
  in bundle-install [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 198, column 3
  in install [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/commands.janet] (tailcall) on line 165, column 20
  in run-main [boot.janet] on line 3776, column 16
  in cli-main [boot.janet] on line 3921, column 17

Always fails.

But trying again causes it to succeed:

$ jpm -l install https://github.com/janet-lang/spork
From https://github.com/janet-lang/spork
 * branch            HEAD       -> FETCH_HEAD
HEAD is now at 7b51d62 Merge pull request #67 from pepe/htmlgen-docs
compiling src/json.c to build/src___json.static.o...
creating native module build/spork/json.so...
generating meta file build/spork/tarray.meta.janet...
generating meta file build/spork/json.meta.janet...
creating native module build/spork/rawterm.so...
generating meta file build/spork/rawterm.meta.janet...
compiling src/rawterm.c to build/src___rawterm.static.o...
creating native module build/spork/tarray.so...
compiling src/tarray.c to build/src___tarray.static.o...
creating static library build/spork/json.a...
creating static library build/spork/rawterm.a...
creating static library build/spork/tarray.a...
generating /Users/ian/src/janet-test/jpm_tree/lib/.manifests/spork.jdn...
Installed as 'spork'.
copying spork to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/json.so to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/json.meta.janet to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/json.a to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/rawterm.so to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/rawterm.meta.janet to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/rawterm.a to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/tarray.so to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/tarray.meta.janet to /Users/ian/src/janet-test/jpm_tree/lib...
copying build/spork/tarray.a to /Users/ian/src/janet-test/jpm_tree/lib...
copying src/tarray.h to /Users/ian/src/janet-test/jpm_tree/lib/...

There doesn't seem to be a way to identify the version of jpm that I'm running, but this is happening on whatever is bundled with Janet 1.23.0 in the Homebrew formula.

sogaiu commented 2 years ago

May be the specific jpm in question can be determined from the following:

https://github.com/Homebrew/homebrew-core/blob/48b63e7f477fe551f7c3d0b9201166cee7d541bc/Formula/janet.rb#L21-L24

ianthehenry commented 2 years ago

I tried to re-do this with verbose output, and this time it took three tries to get a successful install.

$ jpm -l -v install https://github.com/janet-lang/spork
git -c init.defaultBranch=master -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork init
Initialized empty Git repository in /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork/.git/
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork remote add origin https://github.com/janet-lang/spork
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork fetch --tags origin
remote: Enumerating objects: 753, done.
remote: Counting objects: 100% (240/240), done.
remote: Compressing objects: 100% (98/98), done.
remote: Total 753 (delta 169), reused 186 (delta 140), pack-reused 513
Receiving objects: 100% (753/753), 170.87 KiB | 2.25 MiB/s, done.
Resolving deltas: 100% (463/463), done.
From https://github.com/janet-lang/spork
 * [new branch]      master     -> origin/master
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork fetch origin HEAD
From https://github.com/janet-lang/spork
 * branch            HEAD       -> FETCH_HEAD
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork reset --hard FETCH_HEAD
HEAD is now at 7b51d62 Merge pull request #67 from pepe/htmlgen-docs
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork submodule update --init --recursive
cc -c src/tarray.c -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -fPIC -o build/src___tarray.o
cc -c src/json.c -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -fPIC -o build/src___json.o
cc -c src/rawterm.c -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -fPIC -o build/src___rawterm.o
generating meta file build/spork/json.meta.janet...
error: error: could not open file build/spork/json.meta.janet with mode wb
  in spit [boot.janet] (tailcall) on line 1701, column 13
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/rules.janet] on line 20, column 22
generating meta file build/spork/tarray.meta.janet...
error: error: could not open file build/spork/tarray.meta.janet with mode wb
  in spit [boot.janet] (tailcall) on line 1701, column 13
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/rules.janet] on line 20, column 22
generating meta file build/spork/rawterm.meta.janet...
error: error: could not open file build/spork/rawterm.meta.janet with mode wb
  in spit [boot.janet] (tailcall) on line 1701, column 13
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/rules.janet] on line 20, column 22
error: build fail
  in pdag [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 214, column 9
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 200, column 5
  in bundle-install [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 198, column 3
  in install [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/commands.janet] (tailcall) on line 165, column 20
  in run-main [boot.janet] on line 3776, column 16
  in cli-main [boot.janet] on line 3921, column 17
$ jpm -l -v install https://github.com/janet-lang/spork
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork fetch --tags origin
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork fetch origin HEAD
From https://github.com/janet-lang/spork
 * branch            HEAD       -> FETCH_HEAD
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork reset --hard FETCH_HEAD
HEAD is now at 7b51d62 Merge pull request #67 from pepe/htmlgen-docs
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork submodule update --init --recursive
cc -c src/json.c -DJANET_ENTRY_NAME=janet_module_entry_spork_47_json -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -o build/src___json.static.o
generating meta file build/spork/rawterm.meta.janet...
error: error: could not open file build/spork/rawterm.meta.janet with mode wb
  in spit [boot.janet] (tailcall) on line 1701, column 13
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/rules.janet] on line 20, column 22
generating meta file build/spork/json.meta.janet...
error: error: could not open file build/spork/json.meta.janet with mode wb
  in spit [boot.janet] (tailcall) on line 1701, column 13
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/rules.janet] on line 20, column 22
cc -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -o build/spork/rawterm.so build/src___rawterm.o -shared -undefined dynamic_lookup -lpthread
cc -c src/rawterm.c -DJANET_ENTRY_NAME=janet_module_entry_spork_47_rawterm -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -o build/src___rawterm.static.o
cc -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -o build/spork/tarray.so build/src___tarray.o -shared -undefined dynamic_lookup -lpthread
cc -c src/tarray.c -DJANET_ENTRY_NAME=janet_module_entry_spork_47_tarray -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -o build/src___tarray.static.o
cc -std=c99 -I/usr/local/Cellar/janet/1.23.0/include/janet -I/Users/ian/src/janet-test/jpm_tree/lib -O2 -o build/spork/json.so build/src___json.o -shared -undefined dynamic_lookup -lpthread
generating meta file build/spork/tarray.meta.janet...
error: build fail
  in pdag [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 214, column 9
  in <anonymous> [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 200, column 5
  in bundle-install [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/pm.janet] on line 198, column 3
  in install [/usr/local/Cellar/janet/1.23.0/lib/janet/jpm/commands.janet] (tailcall) on line 165, column 20
  in run-main [boot.janet] on line 3776, column 16
  in cli-main [boot.janet] on line 3921, column 17
$ jpm -l -v install https://github.com/janet-lang/spork
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork fetch --tags origin
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork fetch origin HEAD
From https://github.com/janet-lang/spork
 * branch            HEAD       -> FETCH_HEAD
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork reset --hard FETCH_HEAD
HEAD is now at 7b51d62 Merge pull request #67 from pepe/htmlgen-docs
git -C /Users/ian/src/janet-test/jpm_tree/lib/.cache/git__https___github.com_janet-lang_spork submodule update --init --recursive
generating meta file build/spork/rawterm.meta.janet...
ar rcs build/spork/json.a build/src___json.static.o
ar rcs build/spork/rawterm.a build/src___rawterm.static.o
ar rcs build/spork/tarray.a build/src___tarray.static.o
generating meta file build/spork/json.meta.janet...
generating /Users/ian/src/janet-test/jpm_tree/lib/.manifests/spork.jdn...
git remote get-url origin
git rev-parse HEAD
Installed as 'spork'.
copying spork to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf spork /Users/ian/src/janet-test/jpm_tree/lib
chmod +x /Users/ian/src/janet-test/jpm_tree/bin/janet-format
chmod +x /Users/ian/src/janet-test/jpm_tree/bin/janet-netrepl
copying build/spork/json.so to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/json.so /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/json.meta.janet to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/json.meta.janet /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/json.a to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/json.a /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/rawterm.so to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/rawterm.so /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/rawterm.meta.janet to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/rawterm.meta.janet /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/rawterm.a to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/rawterm.a /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/tarray.so to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/tarray.so /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/tarray.meta.janet to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/tarray.meta.janet /Users/ian/src/janet-test/jpm_tree/lib
copying build/spork/tarray.a to /Users/ian/src/janet-test/jpm_tree/lib...
cp -rf build/spork/tarray.a /Users/ian/src/janet-test/jpm_tree/lib
copying src/tarray.h to /Users/ian/src/janet-test/jpm_tree/lib/...
cp -rf src/tarray.h /Users/ian/src/janet-test/jpm_tree/lib/

Re-trying it a few times interactively seems like it takes 3 tries about half the time and 2 tries about half the time. Never had it succeed on the first try.

ianthehenry commented 2 years ago

This was fixed by https://github.com/janet-lang/jpm/commit/7f0af49ca2d18cd0657be37fd6d4d775613c99bb; I was using an old jpm. Sorry!