Skip to content

[RFC] Link time code generation #594

@ghost

Description

It'd be nice to support special libraries whose implementation would be generated at link time. Here are several uses cases:

Build info

module Dune_build_info : sig
  (** If inside git, this is the output of [git describe ...] *)
  val vcs_head : string option

  (** Project version *)
  val version : string

  (** For things that dynamically load libraries *)
  val linked_in_libraries : string list
end

Ocaml config

This could be used for all configurator scripts:

module Dune_ocaml_config : sig
  val version : int * int * int
  val standard_library : string
  ...
end

all you'd have to do is add dune.ocaml_config in the libraries field and we'd get this library with the values instantiated with the current build context configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalRFC's that are awaiting discussion to be accepted or rejected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions