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

fix(menhir): sandbox infer rule #5015

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Unreleased
----------

- Sandbox infer rules for menhir. Fixes possible "inconsistent assumptions"
errors (#5015, @rgrinberg)

- Experimental support for ctypes stubs (#3905, fixes #135, @mbacarella)

- Fix interpretation of `binaries` defined in the `env stanza`. Binaries
Expand Down
2 changes: 2 additions & 0 deletions src/dune_rules/compilation_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ let js_of_ocaml t = t.js_of_ocaml

let sandbox t = t.sandbox

let set_sandbox t sandbox = { t with sandbox }

let package t = t.package

let vimpl t = t.vimpl
Expand Down
2 changes: 2 additions & 0 deletions src/dune_rules/compilation_context.mli
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ val js_of_ocaml : t -> Dune_file.Js_of_ocaml.t option

val sandbox : t -> Sandbox_config.t

val set_sandbox : t -> Sandbox_config.t -> t

val package : t -> Package.t option

val vimpl : t -> Vimpl.t option
Expand Down
5 changes: 4 additions & 1 deletion src/dune_rules/menhir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ module Run (P : PARAMS) = struct
(Compilation_context.preprocessing cctx)
name mock_module ~lint:false
in
let cctx = Compilation_context.without_bin_annot cctx in
let cctx =
Compilation_context.set_sandbox cctx Sandbox_config.needs_sandboxing
|> Compilation_context.without_bin_annot
in
let* deps = Dep_rules.for_module cctx mock_module in
let* () =
Module_compilation.ocamlc_i ~deps cctx mock_module
Expand Down