Conversation
|
It should not be necessary to have a header in a file generated from another file that does have a header. I make no guarantees that the bot is capable of handling that though. But a "header" at the end would not be seen either. Let's not worry about the header until the bot yells at me. It is complaining already and will until #1349 is merged anyhow. But I expect that this will have to wait for at least #1133. I also could not figure out how to specify the build field of the dune-generated opam file, and getting the correct version when pinning is necessary. |
|
Thanks for your quick reply. I have tested to manually pin master and my branch with esy and I get
I can force dune to add a specific build command (with the template) but it will not update as dune upgrade and change his cli. EDIT: With opam: my fork: 0.14.1-5-gd3b5a80 master: 0.14.1 |
jberdine
left a comment
There was a problem hiding this comment.
This seems like it could be basically okay after a bit more iteration. But I do not understand the motivation for this to be honest. I'm not objecting, but it just seems that we'd copy the contents of the opam file into dune-project and change the syntax. I'd be happy to learn more of the motivation.
| "@install" | ||
| "@runtest" {with-test} |
There was a problem hiding this comment.
Is it obvious that these have the same behavior as the version before this PR?
There was a problem hiding this comment.
dune build @runtest === dune runtest but with one command that allow us to build also the project
https://dune.readthedocs.io/en/stable/tests.html?highlight=%40install#running-tests and @install just generate file required for the installation
-p pkgis a shorthand for--root . --only-packages pkg --profile release --default-target @install
https://dune.readthedocs.io/en/stable/opam.html#invocation-from-opam I am a liitle bit confused because we have then @install present two times but it is taken from dune opam template. https://github.com/ocaml/dune/blob/ecbee3d4bf8d82b47667fd6a1f74f01deb5e9eb2/src/dune/opam_create.ml#L24
There was a problem hiding this comment.
Ok, I hadn't appreciated that {with-test} could be placed on individual arguments instead of whole commands.
Ok, so @install only builds the files to be installed, but does not actually copy them into some other directories, etc. Correct?
There was a problem hiding this comment.
I will ask on discord for confirmation.
There was a problem hiding this comment.
Yes they are doing almost the same thing. As written the command build all installable libraries and executables (Even if not needed for the tests) and runs the tests. You can add different filters on each string in the list In the opam files, it’s quite convenient at times. @Et7f3 reply above is spot on
When dune generate file: dune automatically insert the good dune lower bound so one metadata whe can ignore. Also dune doesn't have such feature yet (or i'm not aware) but it could do more sanity check for instance: only make available dependencies we have listed in our package |
jberdine
left a comment
There was a problem hiding this comment.
Ok, thanks for the discussion, this looks good.
One final question: the dune-project file has the look of being auto-formatted. Is it, and how do you do that? AFAIU e.g. dune build @_build/default/fmt formats dune but not dune-project files. Just me?
|
I rebased and updated the constraint on |
|
|
Yes but it's not integrated the same way dune files are when running |
|
FWIW it could be |
|
@jberdine a motivation for this for example is that when you change |
ocamlformat.opam.template
Outdated
| @@ -0,0 +1,13 @@ | |||
| build: [ | |||
There was a problem hiding this comment.
If we merge #1133 before this, we can remove this file before merging
bfca6ac to
c344d0c
Compare
|
Rebased onto master, should be compatible with the dune-build-info changes. |
In reference of #900 (comment) (opened by @gpetiot) Here metadata are stored with dune who is responsible to build opam metadata (less metadata to update when releasing)
Some notes:
ocamlformat.templateto inject header but it will be at the end.-["ocaml" "tools/gen_version.mlt" "lib/Version.ml" version] {pinned}%%VERSION%%=git describe --always --dirtythe script =
git describe --tags --dirty --alwaysI don't know how should I handle this. I don't get how we can print 0.14.2 for instance and not the commit I have tried with manual
git tagmy repo but no luck 🤷maybe #1133 handle correctly ?
I open in draft because I might have broken version field.