Skip to content

The install functions copy N executables N times #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bos opened this issue May 24, 2012 · 6 comments
Closed

The install functions copy N executables N times #518

bos opened this issue May 24, 2012 · 6 comments

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(Imported from Trac #525, reported by np on 2009-03-17)

The patch:

Fri Aug 24 17:27:49 CEST 2007 Duncan Coutts <duncan@…>
  • Only create includes and bin dirs if necessary For includes, don't list the include dir in the package registration info unless we're actually going to install some include files. So we should create fewer pointless empty directories. See bug improve usage info #97.
in particular this hunk:
    -GHC.installExe verbosity binPref buildPref pkg_descr
    +withExe pkg_descr $ _ ->
    +  GHC.installExe verbosity binPref buildPref pkg_descr
introduced a bug in the case of packages with multiple executables (notable h4sh has 42 executables, leading to 1764 calls to cp/strip).

The withExe is performed twice, once here and once in Dist.Simple.GHC.

I attach a simple patch that fixes this problem by using hasExes insted of withExe.

Doing the same with 'withLib' in case of future multiple libraries
and renaming 'withExe' to 'withExes' would be nice also use these patches as you wish.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by np on 2009-03-17)

Patch bundle on top of cabal-1.6 (but commute nicely to cabal-HEAD)

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-03-17)

Oh that's exciting, thanks for spotting it.

In the HEAD branch I think we should fix it by having GHC.installExe take the individual exe to install as a parameter. That's more useful that having it do all of them in a batch.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by np on 2009-03-18)

I agree. I think the original purpose of doing it in batch was to do once things like making the directory.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @simonmar on 2009-03-18)

I pushed these patches to the GHC 6.10 branch of Cabal.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-03-26)

In the end we decided to only push the first patch with the actual fix. The other patches which try and make the API nicer/clearer we'll leave off for the 1.6.x branch since they change the API. In the development branch we'll do something similar as mentioned in comment:2.

Lowering the priority as the fix is now in the 1.6 branch. We can keep this ticket open for the fix to be done properly in the development branch. Setting the milestone for the next major version.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-03-27)

Should now be fixed in Cabal HEAD. The code there now does this all quite differently.

@bos bos closed this as completed May 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant