Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 240227 - econf should set the executable bit on ./configure when necessary
Summary: econf should set the executable bit on ./configure when necessary
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: future-eapi
  Show dependency tree
 
Reported: 2008-10-06 09:14 UTC by Pacho Ramos
Modified: 2013-03-29 10:27 UTC (History)
0 users

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


Attachments
ebuild.sh.patch (ebuild.sh.patch,834 bytes, patch)
2008-10-06 09:17 UTC, Pacho Ramos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2008-10-06 09:14:45 UTC
Hi!

Currently portage dies when configure script is not executable or it's not present. The problem is that, as seen in a lot of ebuilds and some eclasses like games.eclass, this is being workarounded for running configure when script is present and simply skipping configure when it's not.

You will also see (a "grep" run in PORTDIR will show you a lot of examples) that some ebuilds are manually adding +x permission to configure script.

I suggest make portage not simply die when configure script is missing, with the attached patch applied to /usr/lib/portage/bin/ebuild.sh portage will:

1. If configure script doesn't have executable permission, it will run chmod +x for adding it to the script. This would allow drop a lot of repeated "chmods" from some ebuilds in the tree. Anyway, a message will be shown saying:
" * econf: configure is not executable: fixing it..."

allowing gentoo maintainers to send this problem upstream when possible

2. If configure script is not found, portage will simply skip configure stage. This is better because, commonly, apps without configure script simply don't need it, they are not missing it by error (anyway, if app needs configure script and it's not available, it usually fails to ebuild and gentoo maintainer will see it). This will allow a lot of ebuilds (and some eclass) to drop workarounds for this (see, for example, opera.ebuild or simply run "grep -r "true" /usr/portage/" and you will see a lot of ebuilds running "true" simply for skipping configure. This iss why I think that portage behavior should be modified

I attach the patch now. I am using it since end of august and seems to work fine for me

Thanks a lot for considering this :-)

Reproducible: Always
Comment 1 Pacho Ramos gentoo-dev 2008-10-06 09:17:15 UTC
Created attachment 167433 [details, diff]
ebuild.sh.patch

This is the patch, maybe it has some errors or things could be made simpler, feel free to improve it if you want, as I am not an expert of bash scripting :-(
Comment 2 Zac Medico gentoo-dev 2008-10-06 19:21:49 UTC
This sort of change requires an EAPI bump since we don't want ebuild authors relying on new behavior in ebuilds that might be installed by an older version of portage.
Comment 3 Pacho Ramos gentoo-dev 2008-10-07 08:52:14 UTC
OK, thanks for the information
Comment 4 Pacho Ramos gentoo-dev 2008-10-07 08:54:02 UTC
The suggestion is also to skip configure if script is not found
Comment 5 Bo Ørsted Andresen 2008-10-07 09:43:17 UTC
(In reply to comment #4)
> The suggestion is also to skip configure if script is not found

That's just silly. Don't call econf if you don't want it to run.
Comment 6 Pacho Ramos gentoo-dev 2008-10-07 10:14:20 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > The suggestion is also to skip configure if script is not found
> 
> That's just silly. Don't call econf if you don't want it to run.
> 

I suggest not calling econf when no configure is found, but I suggest that this should be made directly by ebuild.sh (like original comment and patch do) instead of requiring (like currently) that each ebuild do it, this would allow to drop some repeated commands from some ebuilds

(yes, I know that my last modification in summary can cause confusions because it's wrong, I modify it a bit for explaining it better. Sorry for the inconvenience)
Comment 7 Pacho Ramos gentoo-dev 2008-10-07 10:30:37 UTC
Well, the patch is not doing exactly the same, it makes econf to return if doesn't found configure instead of simply dying. Maybe would be better that configure script were detected before calling econf, but I don't know what is the responsible of calling it :-/

Maybe in:
src_compile() {
        if [ "${EAPI:-0}" == 0 ] ; then
                [ -x ./configure ] && econf
        elif [ -x "${ECONF_SOURCE:-.}/configure" ] ; then
                econf
        fi
        if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
                emake || die "emake failed"
        fi
}
Comment 8 Bo Ørsted Andresen 2008-10-07 12:34:35 UTC
(In reply to comment #7)
> Maybe would be better that configure script were detected before calling
> econf, but I don't know what is the responsible of calling it :-/

By default src_compile calls it in eapi 0 and 1 and src_configure in eapi 2. None of those default functions call econf unless they detected an executable configure script though. So what you're uncountering is most likely to be an eclass. Said eclass could easily make the econf conditional on the configure script being executable too. The question in that case is if making it unconditional was intentional because it's really required in all intended uses cases or if it's an eclass bug.
Comment 9 Pacho Ramos gentoo-dev 2008-10-07 16:49:51 UTC
(In reply to comment #8)
> By default src_compile calls it in eapi 0 and 1 and src_configure in eapi 2.
> None of those default functions call econf unless they detected an executable
> configure script though. So what you're uncountering is most likely to be an
> eclass. Said eclass could easily make the econf conditional on the configure
> script being executable too. The question in that case is if making it
> unconditional was intentional because it's really required in all intended uses
> cases or if it's an eclass bug.
> 

You are true, sorry a lot, the ebuild I was trying was forcing "econf" execution (silly me!) Sorry for the inconvenience
Comment 10 Pacho Ramos gentoo-dev 2013-03-29 10:27:08 UTC
This is probably  not needed as only a small set of packages need this