Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dune pkg outdatedcauses runtime error #11188

Open
smorimoto opened this issue Dec 8, 2024 · 4 comments
Open

dune pkg outdatedcauses runtime error #11188

smorimoto opened this issue Dec 8, 2024 · 4 comments

Comments

@smorimoto
Copy link
Member

Expected Behavior

Run without runtime error.

Actual Behavior

It causes runtime error...

Reproduction

Run dune pkg outdated.

Specifications

  • Version of dune (output of dune --version):
    • "Dune Developer Preview: build 2024-12-07T02:23:19Z, git revision 832acca36a9abbf76de8a51d92f52ac264b56ec8"
  • Version of ocaml (output of ocamlc --version)
    • 5.2.1
  • Operating system (distribution and version):
    • 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031 arm64

Additional information

❯ dune pkg outdated --verbose
Shared cache: enabled
Shared cache location: /Users/smorimoto/.cache/dune/db
Workspace root:
/Users/smorimoto/src/github.com/ocamllabs/vscode-ocaml-platform
Auto-detected concurrency: 16
Running[0]: (cd /Users/smorimoto/.cache/dune/git-repo && /opt/homebrew/bin/git ls-remote https://github.com/ocaml-dune/opam-overlays.git) > /var/folders/1d/l60l1pjj1c377p2bjvtvc86h0000gn/T/dune_7f67cc_output
Running[1]: (cd /Users/smorimoto/.cache/dune/git-repo && /opt/homebrew/bin/git ls-remote https://github.com/ocaml/opam-repository.git) > /var/folders/1d/l60l1pjj1c377p2bjvtvc86h0000gn/T/dune_c8be45_output
Error: exception Invalid_argument("filter_deps")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from OpamFilter.resolve_ident_raw in file
  "vendor/opam/src/format/opamFilter.ml", line 206, characters 10-44
Called from OpamFilter.resolve_ident in file
  "vendor/opam/src/format/opamFilter.ml", line 230, characters 8-53
Called from OpamFilter.reduce in file "vendor/opam/src/format/opamFilter.ml",
  line 383, characters 8-54
Called from OpamFilter.eval_to_bool in file
  "vendor/opam/src/format/opamFilter.ml" (inlined), line 391, characters
  54-68
Called from OpamFilter.filter_constraints.(fun) in file
  "vendor/opam/src/format/opamFilter.ml", line 519, characters 11-40
Called from OpamFilter.gen_filter_formula.(fun) in file
  "vendor/opam/src/format/opamFilter.ml", line 553, characters 29-43
Called from OpamFormula.map in file "vendor/opam/src/format/opamFormula.ml",
  line 143, characters 35-44
Called from Dune_pkg_outdated.better_candidate.(fun) in file
  "src/dune_pkg_outdated/dune_pkg_outdated.ml", line 93, characters 6-331
Called from Stdlib__Map.Make.exists in file "map.ml", line 337, characters
  29-34
Called from Dune_pkg_outdated.better_candidate in file
  "src/dune_pkg_outdated/dune_pkg_outdated.ml", line 92, characters 4-509
Called from Stdune__Map.Make.to_list_map.(fun) in file
  "otherlibs/stdune/src/map.ml", line 95, characters 61-66
Called from Stdlib__Map.Make.fold in file "map.ml", line 329, characters
  19-42
Called from Stdlib__Map.Make.fold in file "map.ml", line 329, characters
  26-41
Called from Stdlib__Map.Make.fold in file "map.ml", line 329, characters
  26-41
Called from Stdlib__Map.Make.fold in file "map.ml", line 329, characters
  26-41
Called from Stdlib__Map.Make.fold in file "map.ml", line 329, characters
  26-41
Called from Stdune__Map.Make.to_list_map in file
  "otherlibs/stdune/src/map.ml", line 95, characters 25-74
Called from Dune_pkg_outdated.find in file
  "src/dune_pkg_outdated/dune_pkg_outdated.ml", line 174, characters 2-109
Called from Main__Outdated.find_outdated_packages.(fun) in file
  "bin/pkg/outdated.ml", line 19, characters 21-84
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
  line 76, characters 8-11

I must not crash.  Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration.  I will fully express my cases. 
Execution will pass over me and through me.  And when it has gone past, I
will unwind the stack along its path.  Where the cases are handled there will
be nothing.  Only I will remain.
@rgrinberg
Copy link
Member

Could you point us to the lock directory causing the bug in question?

@Sudha247
Copy link
Collaborator

I'm unable to reproduce this on my Linux machine. Is this only command that's buggy?

$ dune-2024-12-07-x86_64-unknown-linux-musl/dune --version
"Dune Developer Preview: build 2024-12-07T02:23:05Z, git revision
832acca36a9abbf76de8a51d92f52ac264b56ec8"

$ dune-2024-12-07-x86_64-unknown-linux-musl/dune pkg outdated
2/47 packages in dune.lock are outdated.
Showing immediate dependencies, use --transitive to see the rest.
- ocaml 5.2.1 < 5.4.0

@smorimoto
Copy link
Member Author

dune pkg validate-lockdir also fails.

❯ dune pkg validate-lockdir --verbose
Shared cache: enabled
Shared cache location: /Users/smorimoto/.cache/dune/db
Workspace root:
/Users/smorimoto/src/github.com/ocamllabs/vscode-ocaml-platform
Auto-detected concurrency: 16
Internal error, please report upstream including the contents of _build/log.
Description:
  ("Map.find_exn: failed to find key",
   { key = "dune"
   ; keys =
       [ "base"
       ; "base-unix"
       ; "cmdliner"
       ; "csexp"
       ; "dune-configurator"
       ; "gen"
       ; "gen_js_api"
       ; "js_of_ocaml"
       ; "js_of_ocaml-compiler"
       ; "jsonoo"
       ; "menhir"
       ; "menhirCST"
       ; "menhirLib"
       ; "menhirSdk"
       ; "ocaml"
       ; "ocaml-base-compiler"
       ; "ocaml-compiler-libs"
       ; "ocaml-config"
       ; "ocaml-version"
       ; "ocaml_intrinsics_kernel"
       ; "ojs"
       ; "opam-file-format"
       ; "ppx_derivers"
       ; "ppxlib"
       ; "promise_jsoo"
       ; "sedlex"
       ; "seq"
       ; "sexplib0"
       ; "stdlib-shims"
       ; "yojson"
       ]
   })
Raised at Stdune__Code_error.raise in file
  "otherlibs/stdune/src/code_error.ml", line 10, characters 30-62
Called from Dune_pkg__Lock_dir.transitive_dependency_closure.loop in file
  "src/dune_pkg/lock_dir.ml", line 854, characters 27-70
Called from Dune_pkg__Lock_dir.transitive_dependency_closure in file
  "src/dune_pkg/lock_dir.ml", line 860, characters 7-19
Called from
  Dune_pkg__Package_universe.check_for_unnecessary_packges_in_lock_dir in
  file "src/dune_pkg/package_universe.ml", line 96, characters 8-120
Called from Dune_pkg__Package_universe.create in file
  "src/dune_pkg/package_universe.ml", line 235, characters 4-14
Called from Main__Validate_lock_dir.validate_lock_dirs.(fun) in file
  "bin/pkg/validate_lock_dir.ml", line 43, characters 17-64
Called from Stdune__List.rev_filter_map.loop in file
  "otherlibs/stdune/src/list.ml", line 21, characters 13-16
Called from Stdune__List.filter_map in file "otherlibs/stdune/src/list.ml"
  (inlined), line 28, characters 26-47
Called from Main__Validate_lock_dir.validate_lock_dirs in file
  "bin/pkg/validate_lock_dir.ml", line 40, characters 6-272
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

I must not crash.  Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration.  I will fully express my cases. 
Execution will pass over me and through me.  And when it has gone past, I
will unwind the stack along its path.  Where the cases are handled there will
be nothing.  Only I will remain.

@smorimoto
Copy link
Member Author

Could you point us to the lock directory causing the bug in question?

On macOS, this command fails for all projects. But I have not tried it on other platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants