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

Failure to build out of source from a not clean source #76115

Closed
xdegaye mannequin opened this issue Nov 3, 2017 · 12 comments
Closed

Failure to build out of source from a not clean source #76115

xdegaye mannequin opened this issue Nov 3, 2017 · 12 comments
Labels
3.7 (EOL) end of life build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Nov 3, 2017

BPO 31934
Nosy @brettcannon, @vstinner, @xdegaye
PRs
  • bpo-31934: Abort when building out of a not clean source tree #4255
  • [3.6] bpo-31934: Abort when building out of a not clean source tree (… #4340
  • [2.7] bpo-31934: Abort when building out of a not clean source tree (… #4342
  • 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 2017-11-08.16:25:49.006>
    created_at = <Date 2017-11-03.14:10:57.948>
    labels = ['type-bug', '3.7', 'build']
    title = 'Failure to build out of source from a not clean source'
    updated_at = <Date 2017-11-08.16:25:49.005>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2017-11-08.16:25:49.005>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-08.16:25:49.006>
    closer = 'vstinner'
    components = ['Build']
    creation = <Date 2017-11-03.14:10:57.948>
    creator = 'xdegaye'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31934
    keywords = ['patch']
    message_count = 12.0
    messages = ['305486', '305492', '305521', '305524', '305655', '305853', '305862', '305864', '305870', '305871', '305874', '305875']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'vstinner', 'xdegaye']
    pr_nums = ['4255', '4340', '4342']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31934'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 3, 2017

    The error message when building out of a not clean source tree:

    renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7
    renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7
    gcc -pthread -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.7m.a -lpthread -ldl -lutil -lm
    gcc: error: Programs/_testembed.o: No such file or directory
    make[1]: *** [Makefile:707: Programs/_testembed] Error 1

    @xdegaye xdegaye mannequin added 3.7 (EOL) end of life build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Nov 3, 2017
    @brettcannon
    Copy link
    Member

    What's "unclean" in this case? I mean you can always re-run Make after making changes and the build succeeds, so I'm not quite sure what leads to this state.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 3, 2017

    When you build out of the source tree and this source tree has been built previously (by running 'make' in the source tree), then you get the error msg printed in msg305486 when you try to build *out* of this not clean source tree. The solution is to run 'make clean' in the source tree first.

    The reason that one must use a clean source tree is that otherwise 'make' finds an existing Programs/_testembed.o file in the source tree as the prerequisite to the Programs/_testembed target, but cannot build this target since Programs/_testembed.o does not exist locally.

    It is not obvious from the error message to understand the reason for the build failure and one can waste quite some time finding the solution.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 3, 2017

    To build out of the 'src' source tree (a subdirectory of the current directory) in a 'build' subdirectory:

    $ ls -ld src
    drwxr-xr-x 21 xavier xavier 4.0K Nov  3 23:50 src/
    $ mkdir build
    $ cd build
    $ $(cd ../src && pwd)/configure && make

    This is useful when you build for multiple platform configurations. For example on Android one can build for multiple API versions and multiple architectures (x86_64, armv7, aarch64, ...).

    @vstinner
    Copy link
    Member

    vstinner commented Nov 6, 2017

    Note for myself: Xavier proposed PR 4255 fix :-)

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 8, 2017

    New changeset 0de9285 by xdegaye in branch 'master':
    bpo-31934: Abort when building out of a not clean source tree (GH-4255)
    0de9285

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 8, 2017

    New changeset 0c4785b by xdegaye in branch '3.6':
    [3.6] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (bpo-4340)
    0c4785b

    @vstinner
    Copy link
    Member

    vstinner commented Nov 8, 2017

    I tested manually the commit 0c4785b merged into Python 3.6: it works as expected ;-)

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 8, 2017

    I also tested the 2.7 and 3.6 PRs before submitting them.
    Thanks for testing and for your reviews Victor :-)

    @vstinner
    Copy link
    Member

    vstinner commented Nov 8, 2017

    I also tested the 2.7 and 3.6 PRs before submitting them.

    Oh, I don't trust anyone, including myself :-) Since there is no automated, I chose to ("double") test manually your PRs.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 8, 2017

    Oh I understand, there is no practical way to test that feature except manually.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 8, 2017

    New changeset fbdd3ee by xdegaye in branch '2.7':
    [2.7] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (bpo-4342)
    fbdd3ee

    @vstinner vstinner closed this as completed Nov 8, 2017
    @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
    3.7 (EOL) end of life build The build process and cross-build type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants