Skip to content

Include subdirectories #34

Closed
Closed

Description

@bobot

I'm trying to convert to jbuilder an existing project that contains its sources spread in different sub-directories (~140 ml files). It seems that jbuilder looks only to sub-directories in order to find sub-libraries or just file to copy. Is it the case?

I'm trying to add a stanza (includes (sub_dirs (dirs)) that would tell to also look at these directories for .h, .ml, .mli, as if they where in the jbuild directory. It is not in the roadmap, but is it ok?

It seems to require to change quite a lot of types, such as in Module the ml_fname and mli_fname fields from string to Path.t.

Activity

  1. bobot commented on Mar 22, 2017

    @bobot
    ContributorAuthor

    Here the culprit frama-c! They are all part of the frama-c kernel, so they share the same purpose. I could separate each directory in a particular library but since they should be in the same namespace it seems not possible.

  2. bobot commented on Mar 22, 2017

    @bobot
    ContributorAuthor

    Well, you could have a toplevel library that include the smaller ones

    But when you are developing inside a library don't you have to qualify the others (except if you add -open frama_c but it seems to start to be complicated).

    We pack only the plugins, and we want to use module alias instead for them, so the wrapping is fine for them.

    It seems like it would complicate things quite a lot.

    I'm debugging it. If you think the MR is too complicated for the codebase, I will look at your solution that seems more complicated for the user.

  3. meadofpoetry commented on May 29, 2017

    @meadofpoetry

    @diml Could you add mlpack support? And mlpack for subdirectories in particular. Because sometimes modules could not be placed in a separate library, but logically should be separated.

    Subdirectory support is really vital for any big project. Just look at the linux source tree, how much libraries might it have, if I want to build it with jbuilder?

  4. meadofpoetry commented on May 29, 2017

    @meadofpoetry

    @diml Could be some sort of recursive build implemented with jbuilder? Something like recursive make, without usage of libraries? Or jbuilder does not support any sort of code separation beyond libraries?

  5. ghost added this to the 1.1.0 milestone on Jun 2, 2017
  6. UnixJunkie commented on Jun 23, 2017

    @UnixJunkie

    I had to do this:
    jbuilder build test.exe --root src
    since my sources are under src/.
    That's not obvious.
    I would have expected jbuilder to be smart and go find the jbuild file under src/

  7. UnixJunkie commented on Jun 23, 2017

    @UnixJunkie

    @bobot did you manage to switch frama-c to jbuilder?
    How about build times compared to what you were using before?

  8. andreypopp commented on Jun 23, 2017

    @andreypopp
    Member

    @UnixJunkie You can try jbuilder builder src/test.exe. That's what I do and it works.

  9. bobot commented on Jun 23, 2017

    @bobot
    ContributorAuthor

    @UnixJunkie I'm still working on it. More than the build time it is the simplicity of the description. I think we will be able to remove at least 3000 line of Makefile thanks to the conversion, go from pack to module alias, better merlin goto definition, ...

    My last problems I'm working on:

    • Being able to add environement variable for jbuilder exec to add: FRAMA_C_SHARE, ...
    • Choose the library linking order, by adding local dependencies between libraries (MR soon)
    • read the files to install from a file.

    But currently with just 418 line of jbuilder (mainly module listing), it works very well.

  10. rgrinberg commented on Jun 23, 2017

    @rgrinberg
    Member

    @bobot if you have some clean build timings to compare, feel free to share them.

  11. rgrinberg commented on Oct 19, 2017

    @rgrinberg
    Member

    @bobot this can be closed I believe. copy_files addresses this. Please re-open if I've misinterpreted.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions