-
Notifications
You must be signed in to change notification settings - Fork 407
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
Fix parsing/generation of installed dune files #909
Comments
Just curious about this:
Is it just for simplicity? I can see an argument being made to make subsystems be versioned independently |
The issue is the following: the versionning of the inline_tests and ppx subsystems is now in line with the versionning of the main dune language. This mean that for files installed by jbuilder the version of these subsystems should be 0.0 and for files installed by dune the version should be 1.0. However, at the moment the version in files installed by jbuilder is 1.0. I guess we could ignore the version in files starting with The other proposal I have in mind is the following: replace the variable (lang dune-package 1.0)
(using foo 1.42)
(library
((name blah)
(archives ((bytes x.cma) (native x.cmxa)))
...
(sub_systems
(inline_tests ...)
(ppx.driver ....)))) Here the |
Are you missing a
I think it still makes sense to version subsystems individually given that we do end up getting requests to tweak them various ways. The inline tests for example ended up getting some (backwards compatible) features added later on. |
Yes, that the idea, we could define them all in one file, no need to generate one file per library. |
The current behaviour in master regarding installed dune files is not right as they are parsed using the new lexer. That means that if a user upgrades from jbuilder to dune, dune will fail when trying to read an installed dune file installed by jbuilder.
Parsing these files
Installed dune files start with:
(dune <version>
, where<version>
is currently 1. Let's do the following to load these files:Sexp.Lexer.token
and check that they areLparen, Atom "dune", Atom s
. Ifs
is1
we parse the rest of the file usingLexer.jbuild_token
and setStanza.syntax
to(0, 0)
.2
we parse the rest of the file usingLexer.token
and setStanza.syntax
to(1, 0)
Versions of subsystems
Currently these files look like:
Here the
1.0
was supposed to be the version of the sub-system. However, this doesn't correspond to the right thing anymore as the version of the inline test and ppx subsystems are aligned with the version of the dune language.I have a proposal in mind where installed dune files will become similar to
dune-project
files, but it will be more work, so for now we should simply ignore this1.0
.Generating these files
The syntax into which these files are generated should match the version of the file where the library is defined. So if the library was defined in a
jbuild
file, we should generate the file in version1
(so jbuild syntax) if if the library was defined in adune
file, we should generate the file in version2
(so dune syntax).The text was updated successfully, but these errors were encountered: