dune icon indicating copy to clipboard operation
dune copied to clipboard

`Error: read(): Is a directory` when locking a project containing (dune) pins

Open gridbugs opened this issue 1 year ago • 3 comments
trafficstars

To reproduce, clone https://github.com/gridbugs/ocaml.org and checkout the dune-pkg branch. The branch makes a couple of changes to allow dune package management to solve this project (except for the issue described here).

Run dune pkg lock.

The output will be:

Error: read(): Is a directory
Error: read(): Is a directory

(and no lockdir is generated).

The number of times the error prints out appears to be the number of pins in the project - removing one of the pins causes it to just print once and removing both allows dune pkg lock to succeed.

I've reproduce this on both macos and linux.

gridbugs avatar Feb 23 '24 08:02 gridbugs

The --debug-backtraces option might help you determine the cause of this exception.

rgrinberg avatar Feb 23 '24 08:02 rgrinberg

Ah useful. The output is:

$ dune pkg lock --debug-backtraces
Error: read(): Is a directory
Raised by primitive operation at Dune_digest.Direct_impl.file in file
  "src/dune_digest/dune_digest.ml", line 30, characters 23-29
Called from Stdune__Exn.protectx in file "otherlibs/stdune/src/exn.ml", line
  10, characters 8-11
Re-raised at Stdune__Exn.protectx in file "otherlibs/stdune/src/exn.ml", line
  16, characters 4-11
Called from Dune_pkg__Source.fetch_and_hash_archive_cached.(fun) in file
  "src/dune_pkg/source.ml", line 55, characters 25-48
Called from Fiber__Core.O.(>>|).(fun) in file "vendor/fiber/src/core.ml",
  line 253, characters 36-41
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
  line 76, characters 8-11

gridbugs avatar Feb 23 '24 08:02 gridbugs

I guess since we're trying to compute the checksum for a directory. Not sure why we're doing that, but if you're using a git pin, no checksums are needed since we rely on the git sha.

rgrinberg avatar Feb 23 '24 08:02 rgrinberg