Skip to content

More robust handling of missing imported variables #131

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

Merged

Conversation

mshinwell
Copy link
Collaborator

When building parts of the Jane Street tree problems were found with imported variables from missing .cmx files. The kinds of such variables are not known. This is already handled in various places, but one more in particular needed dealing with: the new code relating to depth variables occurring free in the types of closure variables.

This patch removes the few uses of DE.find_variable (which always provided "don't know the kind" to TE.find) in favour of calling TE.find directly. Then all places that look up types in the environment have to identify whether the kind is known -- and be prepared for an error if it is not, and the .cmx is missing. Then the patch adds logic specifically for the above case: if the kind is unknown for any variable involved in the type of a closure variable, the whole closure variable is marked as "degraded" and given type Unknown. This should be a rare situation.

This can be reviewed later as part of the Flambda 2 review process.
cc @lthls @lukemaurer

@mshinwell mshinwell added the flambda2 Prerequisite for, or part of, flambda2 label Aug 3, 2021
@mshinwell mshinwell merged commit 0a7cf02 into ocaml-flambda:main Aug 3, 2021
mshinwell added a commit to mshinwell/flambda-backend that referenced this pull request Aug 4, 2021
ccasin added a commit to ccasin/flambda-backend that referenced this pull request Mar 12, 2023
5e7dfce331 Merge flambda-backend changes
9f7f2d24a7 Edit script for test merge
1ae71ce59d Review comments (ocaml-flambda#6)
1845365bd0 Layouts version 1
aba6294 Immediacy rework (ocaml-flambda#122)
cf4eeef Add no-stack-allocation variant of some tests that print lambda (ocaml-flambda#133)
8f22438 Fully switch over Jane Street Merlin support to `.local-*` (ocaml-flambda#136)
5482a8d Remove `Lev_module_definition` from lambda (ocaml-flambda#135)
261e016 Change modular extensions to produce `AST_desc` types (ocaml-flambda#132)
0760c82 Disable module patterns in comprehensions (ocaml-flambda#131)
6acac80 Add Ctype global state debug printers (ocaml-flambda#130)
bc32037 Enable support for Jane Street's internal Merlin configuration (ocaml-flambda#64)
d1a8d03 Split out `Clflags.Extension` into a new file, `Language_extension` (ocaml-flambda#125)
435de6d Fix bootstrap and add legacy CI (ocaml-flambda#126)
7e5a626 Improve the API of language extensions to better support upstream compatibility (and also tooling) (ocaml-flambda#13)
c4e17b0 Replace var with local for faster mode checking (ocaml-flambda#53)
6d477d8 Merge pull request ocaml-flambda#124 from riaqn/merge-backend
d737533 minor fixes after merge
f1710d6 Merge flambda-backend changes
cc18534 Just run make boostrap (ocaml-flambda#123)

git-subtree-dir: ocaml
git-subtree-split: 5e7dfce331d0e39c695fab9b00e3d2cda7d9ebb4
ccasin added a commit that referenced this pull request Mar 24, 2023
ea89813 Merge pull request #154 from ocaml-flambda/merge-flambda-backend
23cf5a5 Merge flambda-backend changes
b3af0c4 Unboxed types version 3 tests (#82)
1282d16 Functions with no clauses aren't local-returning (#149)
15d38c0 `make install` puts ocamlc at workspace root (#152)
b4928ee Remove -absname to improve build errors (#151)
f5b5e49 Remove `type_unpacks` (#150)
50d54db Remove arity-interrupting elaboration of module patterns (#146)
4382869 Remove the need to manually update the `tools/debug_printers` file (#148)
06a1d91 Add `promote-failed` targets to the Makefiles (#144)
d04eb58 Cleanup of comprehensions and immutable arrays (#127)
a45df79 Add a Module_strengthening extension (#142)
163c4b9 Add support for extensions in module types (#141)
74aa974 Some small patch-ups around matching on extensions (#140)
07127fe Remove raw_body from modular extensions setup (#137)
3f9bd64 Don't copy when resolving aliases in try_modtypes (#143)
aba6294 Immediacy rework (#122)
cf4eeef Add no-stack-allocation variant of some tests that print lambda (#133)
8f22438 Fully switch over Jane Street Merlin support to `.local-*` (#136)
5482a8d Remove `Lev_module_definition` from lambda (#135)
261e016 Change modular extensions to produce `AST_desc` types (#132)
0760c82 Disable module patterns in comprehensions (#131)
6acac80 Add Ctype global state debug printers (#130)
bc32037 Enable support for Jane Street's internal Merlin configuration (#64)
d1a8d03 Split out `Clflags.Extension` into a new file, `Language_extension` (#125)
435de6d Fix bootstrap and add legacy CI (#126)
7e5a626 Improve the API of language extensions to better support upstream compatibility (and also tooling) (#13)
c4e17b0 Replace var with local for faster mode checking (#53)
6d477d8 Merge pull request #124 from riaqn/merge-backend
d737533 minor fixes after merge
f1710d6 Merge flambda-backend changes
cc18534 Just run make boostrap (#123)

git-subtree-dir: ocaml
git-subtree-split: ea89813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flambda2 Prerequisite for, or part of, flambda2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant