Skip to content

Commit

Permalink
Merge branch 'main' into anmonteiro/melange-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro authored Dec 19, 2024
2 parents e553e50 + 2616be1 commit c4e64e6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 43 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,41 +136,6 @@ jobs:
- uses: cachix/install-nix-action@v18
- run: nix develop .#fmt -c make fmt

coverage:
name: Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ocaml-compiler:
- 5.1.x
steps:
- uses: actions/checkout@v4
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-depext: false

- name: Set git user
run: |
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com
# Install ocamlfind-secondary and ocaml-secondary-compiler, if needed
- run: opam install ./dune.opam --deps-only --with-test

- name: Install deps on Unix
run: |
opam install . --deps-only
opam exec -- make dev-deps
opam exec -- make coverage-deps
- run: opam exec -- make test-coverage
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}

doc:
name: Documentation
runs-on: ubuntu-latest
Expand Down
5 changes: 2 additions & 3 deletions src/dune_pkg/opam_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ module Priority = struct
end

module Context_for_dune = struct
type filter = OpamTypes.filter

type rejection =
| (* TODO proper error messages for packages skipped via avoid-version *)
Unavailable
Expand Down Expand Up @@ -125,7 +123,8 @@ module Context_for_dune = struct
| Avoid_version -> Pp.paragraph "Package is excluded by avoid-version"
;;

let eval_to_bool (filter : filter) : (bool, [> `Not_a_bool of string ]) result =
let eval_to_bool (filter : OpamTypes.filter) : (bool, [> `Not_a_bool of string ]) result
=
try Ok (OpamFilter.eval_to_bool ~default:false (Fun.const None) filter) with
| Invalid_argument msg -> Error (`Not_a_bool msg)
;;
Expand Down
4 changes: 1 addition & 3 deletions src/dune_rules/melange/melange_stanzas.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module Emit = struct
; compile_flags : Ordered_set_lang.Unexpanded.t
; allow_overlapping_dependencies : bool
; enabled_if : Blang.t
; dune_version : Dune_lang.Syntax.Version.t
}

include Stanza.Make (struct
Expand Down Expand Up @@ -120,7 +119,7 @@ module Emit = struct
let open Enabled_if in
let allowed_vars = Any in
decode ~allowed_vars ~since:None ()
and+ dune_version = Dune_lang.Syntax.get_exn Stanza.syntax in
in
let preprocess =
let init =
let f libname = Preprocess.With_instrumentation.Ordinary libname in
Expand All @@ -144,7 +143,6 @@ module Emit = struct
; compile_flags
; allow_overlapping_dependencies
; enabled_if
; dune_version
})
;;

Expand Down
1 change: 0 additions & 1 deletion src/dune_rules/melange/melange_stanzas.mli
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module Emit : sig
; compile_flags : Ordered_set_lang.Unexpanded.t
; allow_overlapping_dependencies : bool
; enabled_if : Blang.t
; dune_version : Dune_lang.Syntax.Version.t
}

include Stanza.S with type t := t
Expand Down
3 changes: 2 additions & 1 deletion src/dune_rules/ml_sources.ml
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,13 @@ let modules_of_stanzas =
| Melange_stanzas.Emit.T mel ->
let obj_dir = Obj_dir.make_melange_emit ~dir ~name:mel.target in
let+ sources, modules =
let version = Dune_project.dune_version project in
Modules_field_evaluator.eval
~expander
~modules
~stanza_loc:mel.loc
~kind:Modules_field_evaluator.Exe_or_normal_lib
~version:mel.dune_version
~version
~private_modules:Ordered_set_lang.Unexpanded.standard
~src_dir:dir
mel.modules
Expand Down

0 comments on commit c4e64e6

Please sign in to comment.