chibi-scheme icon indicating copy to clipboard operation
chibi-scheme copied to clipboard

snow-chibi package: package-docs fails unless the package is already installed

Open nytpu opened this issue 3 years ago • 2 comments

When I try to package a library using snow-chibi package <library.sld> I always get the following warning:

WARNING: package-docs failed: {Exception #19 user "car: not a pair" (#f) #<procedure module-name->strings> ("/usr/local/share/chibi/init-7.scm" . 255) #f}

The package .tgz is still built but does not have any documentation bundled inside. If I run snow-chibi install <package.tgz> and re-run the package command above then the warning disappears and the package builds correctly, with all bundled documentation.

My ~/.snow/config.scm contains:

((command
  (package
    (authors "nytpu <[email protected]>")
    (doc-from-scribble #t)
    (version-file "VERSION")
    (test-library (append-to-last -test)))))

As of this writing I can reproduce this issue when packaging https://git.sr.ht/~nytpu/getopt-scheme. A script demonstrating the workaround is available in the repo.

I'm running Artix Linux 5.15, and I've gotten the error on both Chibi Scheme 0.10.0 from the website and from the most recent commit to master (f812bbc9 as of this writing).

nytpu avatar Dec 18 '21 00:12 nytpu

The doc-from-scribble needs to load the module to be able to generate docs. It doesn't have to be installed, but does need to be in the current-module-path. I think it's safe enough for snow-chibi to automatically add the directory containing library.sld to the current-module-path.

ashinn avatar Dec 21 '21 12:12 ashinn

Ah, that may also be the root cause of (append-to-last -test) not working, since if the test module isn't in the module path it obviously can't find it. I assumed the library's directory would be added to the current-module path automatically; it's pretty strange that one (currently) has to manually add the work directory before packaging.

nytpu avatar Dec 21 '21 15:12 nytpu