plea for help with js-dossier documentation tool (used by closure library)

20 views
Skip to first unread message

Erik Neumann

unread,
Mar 10, 2023, 5:48:48 PM3/10/23
to Closure Library Discuss

I know js-dossier is not the responsibility of the closure compiler or library teams, but does anyone have ideas for me trying to revive the js-dossier project?


https://github.com/jleyba/js-dossier is used by closure library for its documentation.  The js-dossier project has not been updated in 4 years, and seems to be abandoned.


I would love to fix it up, but I can't get it to build.  It seems to want an ancient version of bazel (0.29, the current version is 6.1.0), which I kind of installed, but now it fails on a missing 'python' command in some sub-folder of maven.  (So perhaps the build process didn't get entirely moved from maven to bazel 4 years ago?)


So, I'm pretty stuck and wondering if anyone has ideas or general advice on trying to revive an old project like this.


FWIW here is some of the error messages I got

[14:05:35 ~/Documents/Programming/js-dossier]$ ./gendossier.sh -r

erikn's .bashrc is running

INFO: Starting clean.

INFO: Call stack for the definition of repository 'maven' which is a coursier_fetch (rule definition at /private/var/tmp/_bazel_erikn/4521f4523bde805bb0b44649cb6641b5/external/rules_jvm_external/coursier.bzl:870:18):

 - /private/var/tmp/_bazel_erikn/4521f4523bde805bb0b44649cb6641b5/external/rules_jvm_external/defs.bzl:83:5

 - /Users/erikn/Documents/Programming/js-dossier/WORKSPACE:28:1

INFO: Repository 'maven' used the following cache hits instead of downloading the corresponding file.

 * Hash '17f4ff053d0d1dca588afdcc94ca952f7ed85bb03675cd77ec05b7352a832b86' for https://github.com/coursier/coursier/releases/download/v2.0.0-RC3/coursier.jar

If the definition of 'maven' was updated, verify that the hashes were also updated.

ERROR: An error occurred during the fetch of repository 'maven':

   Error while obtaining the sha256 checksum of v1/https/jcenter.bintray.com/aopalliance/aopalliance/1.0/aopalliance-1.0.jar: java.io.IOException: Cannot run program "python" (in directory "/private/var/tmp/_bazel_erikn/4521f4523bde805bb0b44649cb6641b5/external/maven"): error=2, No such file or directory

ERROR: /Users/erikn/Documents/Programming/js-dossier/test/java/com/github/jsdossier/BUILD:7:1: //test/java/com/github/jsdossier:lib depends on @maven//:com_google_inject_guice in repository @maven which failed to fetch. no such package '@maven//': Error while obtaining the sha256 checksum of v1/https/jcenter.bintray.com/aopalliance/aopalliance/1.0/aopalliance-1.0.jar: java.io.IOException: Cannot run program "python" (in directory "/private/var/tmp/_bazel_erikn/4521f4523bde805bb0b44649cb6641b5/external/maven"): error=2, No such file or directory

ERROR: /Users/erikn/Documents/Programming/js-dossier/test/java/com/github/jsdossier/BUILD:7:1: //test/java/com/github/jsdossier:lib depends on @maven//:com_google_guava_guava in repository @maven which failed to fetch. no such package '@maven//': Error while obtaining the sha256 checksum of v1/https/jcenter.bintray.com/aopalliance/aopalliance/1.0/aopalliance-1.0.jar: java.io.IOException: Cannot run program "python" (in directory "/private/var/tmp/_bazel_erikn/4521f4523bde805bb0b44649cb6641b5/external/maven"): error=2, No such file or directory

ERROR: /Users/erikn/Documents/Programming/js-dossier/test/java/com/github/jsdossier/BUILD:7:1: //test/java/com/github/jsdossier:lib depends on @maven//:com_google_jimfs_jimfs in repository @maven which failed to fetch. no such package '@maven//': Error while obtaining the sha256 checksum of v1/https/jcenter.bintray.com/aopalliance/aopalliance/1.0/aopalliance-1.0.jar: java.io.IOException: Cannot run program "python" (in directory "/private/var/tmp/_bazel_erikn/4521f4523bde805bb0b44649cb6641b5/external/maven"): error=2, No such file or directory

Stephen Hicks

unread,
Mar 16, 2023, 1:54:50 PM3/16/23
to Closure Library Discuss
I wish I had a better answer for you here, but we're also in a bad state here and don't currently have the resources to fix it.  Based on your error and the timing, it looks like it's probably expecting to find Python 2 somewhere and it can't.  So maybe installing Python 2 would be a good first try?  Going further, you might be able to make a new bazel workspace with the most current version of the bazel rules, and copying all the sources out of the Dossier project.

Overall, the writing is kind of on the wall here for Dossier and Closure types in general.  TypeScript is a much better maintained ecosystem and has solid doc extraction tools, so in the long term, you'll likely have a much better time if you can make the move to TypeScript.

Sorry this probably isn't the answer you want to hear.

gramic

unread,
Mar 17, 2023, 4:07:18 AM3/17/23
to Closure Library Discuss
The problem is in the build process and probably the python toolchain is not registered.
We are using bazel build for many years and currently transitioning to bzlmod with bazel 6.0.0.
Supporting anything with such an early version of bazel will be very difficult.
In a month or so, I will create bzlmod support for rules_closure and after that I would be able to help you with  js-dossier, if you are willing to wait for it.

Transitioning to TypeScript seems good choice, however, using Closure you can use the interactive mode of debugging and editing source files directly in the browser.
The experience of that interaction is very pleasant and useful, while with preprocessed TypeScript this is not possible.
Also, after TypeScript transpiler to javascript, Closure Compiler optimizes the code to production quality.

Steve Hicks

unread,
Mar 20, 2023, 3:34:06 PM3/20/23
to closure-lib...@googlegroups.com
FWIW, I've had a very good experience with esbuild for TypeScript edit-refresh.  With bundling, it can be about as quick as the cascading separate-file loads that Closure's debug loader can give you, and debugging with source maps is generally pretty pleasant (not perfect, but good enough that TS's benefits still vastly outweigh the costs).

--

---
You received this message because you are subscribed to the Google Groups "Closure Library Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-library-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-library-discuss/6b79db67-30be-4a7e-9329-caeea5bb02e7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages