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

Interior files handled in ocamldep #4519

Closed
vicuna opened this issue Mar 10, 2008 · 4 comments
Closed

Interior files handled in ocamldep #4519

vicuna opened this issue Mar 10, 2008 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Mar 10, 2008

Original bug ID: 4519
Reporter: mb
Status: acknowledged (set by @damiendoligez on 2008-03-11T13:36:54Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.10.1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Tags: patch
Related to: #3725

Bug description

ocamldep does not emit dependencies for files which are not
found in the given search path. This is Ok for system files.
However for generated files (eg. via ocamllex or -yacc) this
places a burden on the build system. It has to take care
that all files are generated before the dependencies can be
calculated.

A simpler solution is to pass files interior to the build
graph to ocamldep. So whenever a module is encountered
which has no corresponding source it is checked whether
the file is given as interior file. If so, a dependency is
emited even though the file does not exists, yet. (It will
be later on created during the build process.)

The attached patch implements this change, however it is
very simple-minded and almost certainly needs polish.

File attachments

@vicuna
Copy link
Author

vicuna commented Mar 11, 2008

Comment author: @damiendoligez

That doesn't solve your problem, because ocamldep will then be unable
to emit dependencies for the generated file, since it is missing.
Your dependencies will still be incomplete, so the value of this
new feature is rather doubtful.

@vicuna
Copy link
Author

vicuna commented Mar 11, 2008

Comment author: mb

This is not true. Let me explain my point with an example.

I use the cook program to build my projects. Here I save the
dependency information in different files, which cook knows
how to (re-)generate them if necessary.

Suppose I have prog.ml and lexer.mll. I tell cook that it
should look out for prog.ml.d and lexer.ml.d, which contain
the dependency information. Since neither of them exists,
cook goes on and generates them. Depending on different
parameters cook might choose to do prog.ml.d first. Then it
tries to do lexer.mll.d, but there is no lexer.ml. No problem:
cook knows how to use ocamllex: First generate the .ml then
use ocamldep...

But now the build system is broken! ocamldep did not correctly
specify the dependency and the build will fail if cook tries
to build prog.cmo first.

My proposal fixes the problem. Without my proposal I have to
manually fiddle around with dependency information, which can
be easily obtained from the system. So the feature is clearly
useful.

@vicuna
Copy link
Author

vicuna commented Mar 12, 2008

Comment author: @alainfrisch

Why is the ocamldep's -modules option not enough?

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants