Skip to content

Top-level configuration options should apply to INPLACE packages, not just local packages #3725

Closed

Description

@ezyang

This is basically a refinement of #3334.

I suggest that top-level configuration operations, e.g., cabal new-configure --blah, apply to inplace packages, and not just local packages, as is the case right now. Here are my reasons:

  1. As we can see in Specifying flags for all non-local packages in cabal.project #3719, new-build can't "undo" a build flag and build without the flag #3681 and --extra-lib-dirs and --extra-include-dirs ignored? #2997, users generally have the expectation that flags apply to all TRANSITIVE dependencies. To be clear, this is not what they actually want, since they probably don't actually want to rebuild everything in the store; a more surgical option setting for a specific package is better. But this admonition doesn't apply when a package is deemed inplace, since we're going to have to rebuild it anyway, so we should go for the more natural behavior.
  2. As mentioned in [nix-local-build] Flag application to local packages, --disable-optimization and vendoring #3334, some configuration options you might set are specifically applicable to the edit-recompile cycle (e.g., --disable-optimization). For these options, applying them to all inplace packages is obviously correct, since that's the point of the flag.
  3. So, which flags in PackageConfig would you actually want to apply to only local packages? I took a look, and actually a vast majority of flags in PackageConfig you either (1) want to apply to a specific package (are inappropriate globally) or (2) you want to apply globally. Most things you would want to apply only to local packages, are actually settings you would want to apply for a specific package. The main ones that don't fit this mold I could see are packageConfigTests, packageConfigBenchmarks, packageConfigCoverage, but all of these options are skating on incredibly thin ice (if you depend on a package which is built with coverage, you will probably keel over and die, see cabal install --enable-coverage doesn't install mix in findable location, causing hpc to fail when those ids are mentioned #3684), and you don't need to toggle these to enable tests anyway.

So what's the downside? I suppose, it's obvious what local packages are and less obvious what inplace packages are. But the inplace determination is already an important user-visible one, so what we really should do is just make it more obvious when an external package is promoted to inplace (and explain why.)

CC @dcoutts @hvr @23Skidoo

Activity

  1. added
    cabal-install: v2-build system
    on Aug 28, 2016
  2. dcoutts commented on Sep 1, 2016

    @dcoutts
    Contributor

    I don't feel very comfortable with this idea yet. My original thought on inplace packages was that it was not a user visible distinction. That is, uses should not really know or care if things are in the store vs built locally (except things are faster / rebuilt less). So it's likely to not be obvious to users when something is built inplace and so unclear if things apply to them or not.

    That said, I can certainly see that in examples like -O0 it's pretty obvious that you would like that for intermediate dependencies too since the real intention there is "do it quickly please". So maybe we should go through that list together and think about it again.

    Of course for some flags they do necessarily apply to all dependencies, like profiling, dynamic etc, but that's an expected property of those flags.

  3. ezyang commented on Sep 6, 2016

    @ezyang
    ContributorAuthor

    OK, I'm abandoning this proposal.

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

    cabal-install: v2-build systemtype: discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions