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

Load all project's libraries into utop #1344

Closed
anton-trunov opened this issue Sep 27, 2018 · 5 comments · Fixed by ocaml/opam-repository#12774
Closed

Load all project's libraries into utop #1344

anton-trunov opened this issue Sep 27, 2018 · 5 comments · Fixed by ocaml/opam-repository#12774
Assignees

Comments

@anton-trunov
Copy link

The docs say

Loading libraries that are defined in different directories into one utop instance isn’t possible.

I'm not sure why this should be the case. I'd like to have an option like dune utop --all (suggested by @ejgallego) so Dune would open utop with all the libraries of the project loaded.

CC: @andreypopp

@rgrinberg
Copy link
Member

I don't think --all is the right way to fix this. Really, we should just setup the utop rules a little more aggressively. For example: if we have lib1 and lib2 like so:

src/
  lib1/dune
  lib2/dune

Both $ dune utop src and $ dune utop . should both work. Unfortunately, setting up these extra utop rules can be a tad bit slow. @diml do we need to wait for the new rules core for this to be done efficiently?

@ghost
Copy link

ghost commented Sep 27, 2018

That's ok because the rules are in a generated sub-directory. Just to be clear, the idea is to recursively include all the libraries from the sub-tree?

@rgrinberg
Copy link
Member

Yeah, that's the idea.

@anton-trunov
Copy link
Author

Just to be clear, the idea is to recursively include all the libraries from the sub-tree?

That's right. Something that would let us play with a complex project interactively, not with just one subpart at a time.

@rgrinberg rgrinberg self-assigned this Sep 28, 2018
@rgrinberg
Copy link
Member

Fixed in master

rgrinberg added a commit to rgrinberg/opam-repository that referenced this issue Oct 4, 2018
CHANGES:

- Do not fail if the output of `ocamlc -config` doesn't include
  `standard_runtime` (ocaml/dune#1326, @diml)

- Let `Configurator.V1.C_define.import` handle negative integers
  (ocaml/dune#1334, @Chris00)

- Re-execute actions when a target is modified by the user inside
  `_build` (ocaml/dune#1343, fix ocaml/dune#1342, @diml)

- Pass `--set-switch` to opam (ocaml/dune#1341, fix ocaml/dune#1337, @diml)

- Fix bad interaction between multi-directory libraries the `menhir`
  stanza (ocaml/dune#1373, fix ocaml/dune#1372, @diml)

- Integration with automatic formatters (ocaml/dune#1252, fix ocaml/dune#1201, @emillon)

- Better error message when using `(self_build_stubs_archive ...)` and
  `(c_names ...)` or `(cxx_names ...)` simultaneously.
  (ocaml/dune#1375, fix ocaml/dune#1306, @nojb)

- Improve name detection for packages when the prefix isn't an actual package
  (ocaml/dune#1361, fix ocaml/dune#1360, @rgrinberg)

- Support for new menhir rules (ocaml/dune#863, fix ocaml/dune#305, @fpottier, @rgrinberg)

- Do not remove flags when compiling compatibility modules for wrapped mode
  (ocaml/dune#1382, fix ocaml/dune#1364, @rgrinberg)

- Fix reason support when using `staged_pps` (ocaml/dune#1384, @charlesetc)

- Add support for `enabled_if` in `rule`, `menhir`, `ocamllex`,
  `ocamlyacc` (ocaml/dune#1387, @diml)

- Exit gracefully when a signal is received (ocaml/dune#1366, @diml)

- Load all defined libraries recursively into utop (ocaml/dune#1384, fix ocaml/dune#1344,
  @rgrinberg)

- Allow to use libraries `bytes`, `result` and `uchar` without `findlib`
  installed (ocaml/dune#1391, @nojb)
rgrinberg added a commit to rgrinberg/opam-repository that referenced this issue Oct 10, 2018
CHANGES:

- Do not fail if the output of `ocamlc -config` doesn't include
  `standard_runtime` (ocaml/dune#1326, @diml)

- Let `Configurator.V1.C_define.import` handle negative integers
  (ocaml/dune#1334, @Chris00)

- Re-execute actions when a target is modified by the user inside
  `_build` (ocaml/dune#1343, fix ocaml/dune#1342, @diml)

- Pass `--set-switch` to opam (ocaml/dune#1341, fix ocaml/dune#1337, @diml)

- Fix bad interaction between multi-directory libraries the `menhir`
  stanza (ocaml/dune#1373, fix ocaml/dune#1372, @diml)

- Integration with automatic formatters (ocaml/dune#1252, fix ocaml/dune#1201, @emillon)

- Better error message when using `(self_build_stubs_archive ...)` and
  `(c_names ...)` or `(cxx_names ...)` simultaneously.
  (ocaml/dune#1375, fix ocaml/dune#1306, @nojb)

- Improve name detection for packages when the prefix isn't an actual package
  (ocaml/dune#1361, fix ocaml/dune#1360, @rgrinberg)

- Support for new menhir rules (ocaml/dune#863, fix ocaml/dune#305, @fpottier, @rgrinberg)

- Do not remove flags when compiling compatibility modules for wrapped mode
  (ocaml/dune#1382, fix ocaml/dune#1364, @rgrinberg)

- Fix reason support when using `staged_pps` (ocaml/dune#1384, @charlesetc)

- Add support for `enabled_if` in `rule`, `menhir`, `ocamllex`,
  `ocamlyacc` (ocaml/dune#1387, @diml)

- Exit gracefully when a signal is received (ocaml/dune#1366, @diml)

- Load all defined libraries recursively into utop (ocaml/dune#1384, fix ocaml/dune#1344,
  @rgrinberg)

- Allow to use libraries `bytes`, `result` and `uchar` without `findlib`
  installed (ocaml/dune#1391, @nojb)

- Take argument to self_build_stubs_archive into account. (ocaml/dune#1395, @nojb)

- Fix bad interaction between `env` customization and vendored
  projects: when a vendored project didn't have its own `env` stanza,
  the `env` stanza from the enclosing project was in effect (ocaml/dune#1408,
  @diml)

- Fix stop early bug when scanning for watermarks (ocaml/dune#1423, @diml)
avsm added a commit to avsm/dune that referenced this issue Dec 31, 2018
The current `C_define.Type.Int` supports signed integers since
the fix in ocaml#1344. This fix meant that some C expressions cannot
be evaluated such as `sizeof(expr)` since those are not valid
in cpp.

This changeset adds a new `Uint` type switch that is expressly
for the purpose of evaluating unsigned C integers only. This
allows for constructs such as `sizeof(expr)`.

This changeset lets the Ctypes library completely use Configurator
for all of its compile-time tests (yallop/ocaml-ctypes#574)

fixes ocaml#1720

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants