Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dune site (without plugins) forces -linkall #11281

Open
sim642 opened this issue Jan 10, 2025 · 0 comments
Open

Dune site (without plugins) forces -linkall #11281

sim642 opened this issue Jan 10, 2025 · 0 comments

Comments

@sim642
Copy link

sim642 commented Jan 10, 2025

Expected Behavior

-linkall is not forced when not necessary. As far as I understand, dune sites (without any plugins) do not actually need to force it because there's no dynamic loading/linking happening.
Correct me if I'm wrong, but manually doing the final executable step to remove -linkall still works fine because as long as the generated dune_site__Dune_site_data.cmx is explicitly linked. -linkall is not necessary for just the data.

Actual Behavior

This code seems to be responsible for forcing -linkall when dune site is in use:

| Dune_site { data_module; plugins } ->
let code =
Action_builder.of_memo
@@ Memo.of_thunk
@@ fun () ->
if plugins then dune_site_plugin_code else Memo.return (dune_site_code ())
in
let& module_ =
generate_and_compile_module
cctx
~obj_name:None
~name:data_module
~lib
~code
~requires:(Resolve.Memo.return [ lib ])
~precompiled_cmi:true
in
process_libs
libs
~to_link_rev:(Lib lib :: Module (obj_dir, module_) :: to_link_rev)
~force_linkall:true))

Notably, #4348 added the forcing, but it even happens when dune plugins are not used, only sites.

Specifications

  • Version of dune (output of dune --version): 3.16.0
  • Version of ocaml (output of ocamlc --version): 4.14.2
  • Operating system (distribution and version): Ubuntu 22.04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant