Skip to content

Improve the opam file comparison to avoid unnecessary rebuild #6480

Description

@kit-ty-kate

The following change ocaml/opam-repository@ee5295d has no effect on unix systems. However it will still trigger a rebuild of your switch.

We could try to be a bit more clever and:

  1. store all the value of all the variables used in a given package, as the time of last install
  2. upon testing if a package needs to be rebuilt, we:
    • Set the default values in x-env-path-rewrite for each undefined environment variable
    • Do a pass on the previous and new opam files, so that all the variables are replaced by their values and all the formulas reduced. If a field such as available or build reduces to true or [] respectively, remove it.

Point 1. could also be useful down the line as we could reuse some of those variables (e.g. with-test) when reinstalling/upgrading/downgading the package. However this requires us to think about design and UI around this, so this would be done later.

Related to #6505

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions