-
Notifications
You must be signed in to change notification settings - Fork 413
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
Register more dependencies statically #667
Conversation
Thanks |
2a991f9
to
996131c
Compare
I rebased this on top of master due to some blackbox test changes. Now every commit passes all the tests. |
~f:Build.return | ||
in | ||
let requires = | ||
let with_lib_deps t compile_info ~dir ~has_dot_merlin ~f = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might be forgetting to set ~has_dot_merlin
correctly. I see it's being set to true
everywhere rather than being based on the context.
This way we know more of the compilation DAG statically. This helps for parallelism as well as for `jbuilder external-lib-deps`
996131c
to
f8b166c
Compare
I just ended up merging this to avoid keeping the PR up to date. Created an issue for the |
Most of the dependencies on files of library dependencies used to be declared dynamically. For instance the dependencies on
<lib-dir>/*.cmi
for every library dependency. As a resultjbuilder external-lib-deps
was quite often broken.This PR changes that by passing the
requires
variable as a value of type(Lib.t list, exn) result
instead of(unit, Lib.t list) Build.t
. This usually simplify a bit the code as we have to go less through the build arrow. The dependency on the.merlin
file and theBuild.record_lib_deps
that used to be encoded inrequires
are now done withprefix_rules
.One negative consequence of these changes is that we often have to pass two arguments instead of one to various functions that call the compiler: we have to pass
requires
as well as the dependencies on of the files of library dependencies. So the last few commits addArg_spec.Hidden_deps
, which allows to declare additional dependencies that are not present on the command line. This is used to represent include directory: we can pack together the-I
flags and the file dependencies.