-
Notifications
You must be signed in to change notification settings - Fork 412
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
per_file support for flags #61
Comments
It's not currently possible, but adding support for |
Interesting that you have it as a |
@bmillwood my primary use-case is turning off some warnings on generated files, so something like:
I guess it would also work in the other way round but would be a bit less convenient. |
It would also be useful for packages like https://github.com/c-cube/ocaml-containers to enable the |
This would also be useful for Lwt. For example, see ocsigen/lwt#354 (comment). |
@bmillwood What you're suggesting sounds a lot like ocamlbuild's tags system. I don't have many fond memories of ocamlbuild, but I thought that how it let one concisely specify where extra command line flags are needed was one of its strong points. |
this seems essential for any big project that has code from various generators |
While this feature is important, I'd actually recommend for the code generators to change to output correct warning removing annotations ( |
Yes, this would be desirable, but
|
One more use-case : enabling -opaque for generated version.ml (without introducing separate dev and release modes) for native binaries |
By the way, the way that I'm currently thinking of solving this problem is allow glob/file constructors in the flags field. This will be consistent with how we'd like to extend the OSL elsewhere as well. @diml what do you think?
Note that with our current support for opaque, this actually will not do so much good as we'll still be generating the same rules. Would you expect dune to setup correct per modules based on the flags that you've provided to modules? This is possible, but has some limitations and isn't easy to do. |
That seems good to me. Note that we can do these two features independently:
BTW, @ygrek nobody is questioning the value of this feature. It's just a question of priority, all dune developers already have a packed todolist. If someone is willing to spend a bit of time on this, that would help a lot, even if the result is not a fully polished feature. |
Oh, I was thinking to add the glob support directly to flags. So that you could do things like:
I'm not sure if the extra per_file is necessary. Although per_module might still be useful. |
The two are not incompatible, Regarding the syntax, I feel like there is something missing to separate the thing we are dispatching on and the arguments. What about: (flags
(glob_files *.bar -> -w -1)
(glob_files *.foo -> -w -1)) It feels like the term |
I feel I don't have enough understanding of some mechanics to figure what is the catch here compared to my description :) But I think it is important to have a way to tell dune to compile one file/module (version.ml in my case) with option -opaque. My understanding is that this will be enough for further build steps to detect that build artifacts (cmx in this case) didn't change and no recompilations "down the chain" are necessary.
Ok, sure, it just looked abandoned (and removed from 1.1.0). It is up to developers to decide priorities based on bigger picture of course, my job as a user here is to provide some pressure/feedback for the priority-assignment algo :) |
Yes, that's correct. More precisely, if you pass |
is this theoretical scenario or it is possible to setup somehow with current dune release? |
I was referring to: (flags (:standard -opaque)) Technically, dune could see that you passed |
Ah, it means for all files, and dune is agnostic to flags, so no rebuild takes place because of natural build artifact change detection, got it, thanks. |
Now that we have the predicate_lang, I wonder if we need to extend it to describe maps rather than just sets. I can imagine this being useful not just for flags. |
That seems fine to me |
+1 for this feature request |
This would be useful for -rectypes: -rectypes when passed to a .ml but not to the .mli is supposed to work without requiring users to also pass -rectypes. |
I'm interested in this too, for the same reason as the initial comment, i.e. to enable less strict warnings on some generated files. I understand that #2019 could be used to do that, but that it has never been connected to the rest of dune. Is this correct? How much effort would that be? |
+1! |
I would like to change the flags on a specific file (e.g. a generated file where I want to disable some warnings). Is this currently possible? If not, I think using something like this could be useful:
The text was updated successfully, but these errors were encountered: