Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 432620 - dobin: automatic support of EXEEXT
Summary: dobin: automatic support of EXEEXT
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
: 579042 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-08-24 18:27 UTC by kinzo.x.beato
Modified: 2018-08-08 14:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kinzo.x.beato 2012-08-24 18:27:34 UTC
When I was trying to emerge sdl-image to my mingw32 root, emerge failed with message like "dobin showimage failed", because mingw32-gcc creates binaries with .exe suffix. So Portage need feature of checking CHOST variable and adding corresponding suffixes to binaries when doing dobin function.
Comment 1 SpanKY gentoo-dev 2012-08-24 18:51:54 UTC
we can't blanket assume the argument to dobin implicitly ends with an .exe as we might be installing a shell script, but there probably should be a bit more intelligence here.

similarly (but to a lesser degree), we might hit scaling problems with libraries due to .so vs .dll, although the prefix guys already have that with .dylib and such ...
Comment 2 SpanKY gentoo-dev 2016-04-13 14:15:46 UTC
*** Bug 579042 has been marked as a duplicate of this bug. ***
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-07-21 19:19:41 UTC
TL;DR: no, I doubt this will happen.


First of all, this is against the direction PMS is taking. We'd rather make things simpler, more predictable, free of unnecessary magic. Compare e.g. with removing dohtml. Adding extra magic like this to dobin is inconsistent with this policy.

Right now dobin is simple: take X and put it in $bindir/X.

With this change, dobin starts to mean: take X or X.exe, or... It starts being less predictable. It starts being confusing. It starts introducing corner cases that need to be considered. It starts introducing multiple ways of doing the same thing.

What will 'dobin X' do if there is both X and X.exe? Even if you define a good behavior for this case, note that it will be different for systems with .exe and for systems without suffix.

Furthermore, if we add suffix magic to dobin, we need the same for doexe. Then for consistency we should also add it to dolib*. Since libraries differ both in prefixes and suffixes, soon enough we have half of multilib.eclass in the PMS.

Finally, all those new functions need data. For consistency with existing libdir logic, this data should be provided by profiles. Which means we need to add a significant amount of data to profiles, and I don't even know if we have enough diverse profiles for this.

To summarize, please don't add all this complexity. Especially for a corner-case of cross-compiling to a rare target. This is much better solved with explicit suffix getter for ebuilds (i.e. "dobin foo$(get_exeext)") which will at least make it reliable and predictable.

That said, I wouldn't oppose strongly to adding such getters to PMS. However, as noted above for consistency they should cover all the related cases (i.e. library prefixes and suffixes as well -- and probably versions too). But the question still holds -- do we want all that complexity for a rare use case?
Comment 4 Benda Xu gentoo-dev 2016-07-22 02:55:02 UTC
I think it is possible to override dobin in a mingw32 profile.
Comment 5 Ulrich Müller gentoo-dev 2018-08-08 14:16:04 UTC
No progress. Closing per comment #3.