Skip to content

Commit

Permalink
fix(pkg): ignore depexts that cannot be evaluated (#10942)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg authored Sep 20, 2024
1 parent 772afb5 commit d6f1a27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/dune_pkg/opam_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ let opam_package_to_lock_file_pkg
let depexts =
OpamFile.OPAM.depexts opam_file
|> List.concat_map ~f:(fun (sys_pkgs, filter) ->
if OpamFilter.eval_to_bool (Solver_env.to_env solver_env) filter
let env = Solver_env.to_env solver_env in
if OpamFilter.eval_to_bool ~default:false env filter
then OpamSysPkg.Set.to_list_map OpamSysPkg.to_string sys_pkgs
else [])
in
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/depexts/unknown-variable.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Make a project that uses the foo library:

Locking should succeed and not include the "unzip" package
$ dune pkg lock 2>&1 | head -n 1
Error: exception Failure("Undefined boolean filter value: foobar")
Solution for dune.lock:

$ [ -e dune.lock/foo.pkg ] && cat dune.lock/foo.pkg
[1]
(version 0.0.1)

0 comments on commit d6f1a27

Please sign in to comment.