Skip to content
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

Build Python outside the source directory #57366

Closed
vstinner opened this issue Oct 12, 2011 · 7 comments
Closed

Build Python outside the source directory #57366

vstinner opened this issue Oct 12, 2011 · 7 comments
Labels
build The build process and cross-build

Comments

@vstinner
Copy link
Member

BPO 13157
Nosy @loewis, @pitrou, @vstinner, @merwok
Files
  • build.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-01-03.02:04:49.354>
    created_at = <Date 2011-10-12.12:06:06.434>
    labels = ['build']
    title = 'Build Python outside the source directory'
    updated_at = <Date 2013-01-03.02:04:49.352>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2013-01-03.02:04:49.352>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-01-03.02:04:49.354>
    closer = 'vstinner'
    components = ['Build']
    creation = <Date 2011-10-12.12:06:06.434>
    creator = 'vstinner'
    dependencies = []
    files = ['23386']
    hgrepos = []
    issue_num = 13157
    keywords = ['patch']
    message_count = 7.0
    messages = ['145392', '145425', '145434', '145436', '145440', '145529', '178897']
    nosy_count = 7.0
    nosy_names = ['loewis', 'pitrou', 'vstinner', 'eric.araujo', 'rpetrov', 'neologix', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'works for me'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue13157'
    versions = ['Python 3.3']

    @vstinner
    Copy link
    Member Author

    It is no more possible to build Python outside its source directory. Try using:

    cd <python sources directory>
    mkdir release
    cd release
    ../configure
    make

    Attached patch should fix this issue.

    @vstinner vstinner added the build The build process and cross-build label Oct 12, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 12, 2011

    New changeset 1811c4e5527f by Victor Stinner in branch 'default':
    Issue bpo-13157: Fix building Python outside its source tree
    http://hg.python.org/cpython/rev/1811c4e5527f

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Oct 12, 2011

    Which is platform with broken VPATH support and/or make ?

    @vstinner
    Copy link
    Member Author

    Which is platform with broken VPATH support and/or make ?

    Well, my commit is maybe useless...

    I tried to have two builds at the same time:

    • debug in Python source code (e.g. ~/python)
    • release in a subdirectory in the Python source code (e.g. ~/python/release)

    If I compile in debug mode before building in release mode, the build of the release mode fails because make finds some objects in source tree (and so think that it doesn't need to build them).

    I tried to avoid completly VPATH to support this use case, but I'm not sure that it is possible (at least, it doesn't work: it fails to build pgen in the release).

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Oct 12, 2011

    I wonder why you are not stopped by:
    configure: error: source directory already configured; run "make distclean" there first.
    (for sure you remove some files but not all)

    Applied patch is save but I cannot understand what actually is resolved.
    Note that someone already report as bug(?) attempt to build outside when first project is compiled in source.

    @merwok
    Copy link
    Member

    merwok commented Oct 14, 2011

    Building outside of the source directory was supported, if the source directory was clean. In practice, the source directory could be unclean as long as a few files were not there (Parser/*.o, Modules/_testembed), so it was quite annoying. If the patch allows people to build inside the source directory and in other directories without cleaning, I’m +1!

    @vstinner
    Copy link
    Member Author

    vstinner commented Jan 3, 2013

    I don't have this issue anymore (but I also don't build Python outside the source directory anymore), I already applied my patch, so I consider that the issue can be closed. If someone has a similar problem, it's maybe better to open a new issue.

    @vstinner vstinner closed this as completed Jan 3, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants