Relocatable build tree - #12145
Conversation
7f4f8fa to
a64cab1
Compare
In what sense does it "re-purpose" the existing option? What was the earlier purpose of this option? |
|
I'm no expert in this area, but I'm not comfortable about such repurposing. AFAICT from brief grepping, the existing Back to your PR, is there a reason to make this behaviour configurable? Is there a reason not to use relative paths always? |
It depends on whether |
|
I hardly imagine Is |
|
(Is it possible to write a standalone executable |
|
It would be possible to write a standalone tool to do the copying. My colleague has created a script to do it entirely in Neovim. I'd like to hear thoughts from maintainers; if this functionality is not gated behind a flag (for example, if |
|
@LaurentRDC I haven't had the chance to review your PR but I want to say that I am very interested in this. In fact I have implemented something similar in stable-haskell/cabal1. We build GHC's binary distribution with cabal so in the end we need something we can put into an archive and ship. I look forward to comparing our approaches. Footnotes |
I agree with this. I'd suggest coming up with a different flag/name for this PR and considering the future of (See #462/#2255 for the original implementation of the feature. Given the discussion on #11221 (comment) perhaps it should be removed. I don't know anything about the details here but perhaps @christiaanb may have insight?) |
5e2b295 to
773515c
Compare
|
I've changed the PR to use a new flag, The main question that remains is: is a flag even needed? Are changes to |

This PR adds a new flag,
--relative-build-tree, to make all paths in the build tree relative to the build tree root. This means that the build tree (e.g.dist-newtyle) can be copied wholesale elsewhere (for example, to a git worktree) and promptly be re-used by cabal without re-building.This behavior can be triggered with
cabal build --relative-build-tree, or the project-level configuration optionrelative-build-tree: True.Some notes:
--relative-build-treechangesplan.jsonto relativize paths. It's not clear if that's too much of a breaking change.--relative-build-treeis not the default; it is opt-in.--relative-build-treeis backwards compatible, in a sense: older versions ofcabalwill see a stale build tree, and rebuild, instead of erroring out.--relative-build-treeis only needed for the initial build: the following does not trigger a rebuild:Fixes #12137
significance: significantin the changelog file.