Repository navigation
Implement 'scope' field for executables (#708) - #3461
Conversation
|
No comment on the functional aspects of this, but it should probably be squashed since the individual commits don't really make sense as separate pieces of functionality. |
|
Yes of course I was just holding off on that as to not create more spam in the linked issue since GH doesn't remove old commit references when you force push over them :) |
|
@dcoutts, what do you think? |
|
AppVeyor build actually succeeded, see https://ci.appveyor.com/project/23Skidoo/cabal/build/%23936%20%28master%29. |
|
I very much welcome support for private $libexec executables. @DanielG is the suggestion that authors can specify any install location for helper/private exes, not just the libexec dir? I'm not so sure about that. Generally the split between authors and builders is that authors specify what category things are and the builder gets to decide where things go. As such I'd have thought the appropriate split in this case is to declare the exe as private, and then it'll automatically be installed into the $libexec dir (which the package builder gets to choose, with the obvious default). |
|
@dcoutts You have a point there. So what would you suggest instead? I think just having a boolean flag is kind of meh, how about a new type of section "private-executable" or "internal-executable" or something like that? Though looking at how GNU handles this (https://www.gnu.org/prep/standards/html_node/Directory-Variables.html) it seems like a package author is meant to be able to install executables into sub-directories of
|
|
@dcoutts ping. |
|
@dcoutts ping again! |
|
@DanielG sorry, don't always notice github notifications (+ holidays). Yes, I'd say either we add a new section type, or probably easier, we add a field to the existing exe type to say that it's a private exe (much like we have non-buildable sections). As for a subdir of $libexec, I'd suggest we actually do this automatically. Then as far as I can see there would be no need to control it manually. So just as we have a $libsubdir (such that the final libdir becomes $libdir/$libsubdir and by default the $libsubdir contains the package id to avoid clashes) then we should just follow the same pattern with $libexecdir/$libexecsubdir. The existing Do you agree, would that remove any need for the package author to control a libexec subdir? The package builder still gets to choose of course, and by default we arrange (like libdir) so that nothing can clash between packages. |
|
Ok so here's another shot at this, I added The default value for the new I'm not sure the changes I made in |
|
Also I'm not sure if |
|
There's still one failing test from integration-tests2: Not sure how to fix that, any ideas? |
|
The error message suggests that you are passing |
|
That's what I was afraid of. There doesn't seem to be any mechanism for backwards compatibility in the Setup.hs interface, am I missing something or is this really the first backwards incompatible change there? |
|
A sensible BC fallback is to act as if this patch did not exist, right? This can probably be done by simply not passing the flag, right? Look at |
|
Ah, that's exactly what I was looking for. |
|
Ok, that should do it. I also added a check to make sure the spec version is correct. |
|
@23Skidoo any chance this could still go into 2.0? |
|
Bump on this. |
|
This needs to be updated before I can consider it for 2.0. |
|
@23Skidoo done. This rebases cleanly onto 2.0 with |
|
Nice. I'll take a look later today or tomorrow. |
|
@23Skidoo any news? |
|
Sorry, I was ill last week. Will try to look into this tomorrow. |
|
Ping @23Skidoo |
Second case seems to be dead code that can be only executed when |
|
Merged into 2.0, added a changelog note and documentation. |
|
@DanielG Thanks for your contribution! Can you please also rebase this patchset against |
I use executables installed into '$libexecdir' with great effect in ghc-mod and cabal-helper but so far I've been using an ugly hack in Setup.hs so I figured why not get this upstreamed since it's relatively straightforward.
Now in #708 the request is for a boolean field "Is-Helper-Executable" but I figured having support for specifying an arbitrary path while using the
PathTemplatevariables is a lot more flexible and just seems like the consistent thing to do since there aren't any other such boolean fields anywhere in the PackageDescription apart from say 'buildable'.I've added a check to make sure packages that end up on hackage don't have absolute paths in 'install-dir' which seems like a reasonable restriction.
I haven't tested the bits in PrettyPrint yet and I'd appreciate feedback on what is a sensible thing to do there since I just copied what is being done for 'main-is' but I'm not sure if that makes any sense.