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

Broken makefile depends for profile-opt target #72829

Closed
nascheme opened this issue Nov 8, 2016 · 6 comments
Closed

Broken makefile depends for profile-opt target #72829

nascheme opened this issue Nov 8, 2016 · 6 comments
Labels
build The build process and cross-build type-feature A feature request or enhancement

Comments

@nascheme
Copy link
Member

nascheme commented Nov 8, 2016

BPO 28643
Nosy @brettcannon, @nascheme, @gpshead, @vstinner, @duggelz
PRs
  • bpo-28643: Record profile-opt build progress with stamp files #4223
  • Files
  • profile-opt-stamp.txt
  • 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 2018-07-16.17:56:54.772>
    created_at = <Date 2016-11-08.19:56:35.229>
    labels = ['type-feature', 'build']
    title = 'Broken makefile depends for profile-opt target'
    updated_at = <Date 2018-07-16.17:56:54.771>
    user = 'https://github.com/nascheme'

    bugs.python.org fields:

    activity = <Date 2018-07-16.17:56:54.771>
    actor = 'nascheme'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-16.17:56:54.772>
    closer = 'nascheme'
    components = ['Build']
    creation = <Date 2016-11-08.19:56:35.229>
    creator = 'nascheme'
    dependencies = []
    files = ['45398']
    hgrepos = []
    issue_num = 28643
    keywords = ['patch']
    message_count = 6.0
    messages = ['280342', '280354', '305443', '305661', '305664', '321750']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'nascheme', 'gregory.p.smith', 'vstinner', 'dgreiman']
    pr_nums = ['4223']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue28643'
    versions = []

    @nascheme
    Copy link
    Member Author

    nascheme commented Nov 8, 2016

    I notice that after running "make" then running "make install", the build will go through the whole compile/profile/compile process again. This is really infuriating behaviour, given the extremely long make time for the profiled optimized build.

    The problem appears to me to be that the "profile-opt" target does not have proper dependencies. I think changing it to:

    profile-opt: $(BUILDPYTHON)

    should fix it. If my "make install" ever finishes, maybe I will test it. ;-)

    @nascheme nascheme added build The build process and cross-build type-feature A feature request or enhancement labels Nov 8, 2016
    @nascheme
    Copy link
    Member Author

    nascheme commented Nov 8, 2016

    Okay, my initial idea was wrong (I blame years of not having to look at Makefiles). I think the attached patch works. It uses a "stamp" file to record the fact that the profiled build is complete.

    The fix is sub-optimal because changing some source code and re-running "make" will not rebuild as needed. That would require proper dependencies in the Makefile, rather than treating "make" as an imperative scripting language (e.g. recursively calling make to sequence things). Given that the profile optimised build is unlikely to be used during development, I guess that's not so bad.

    @nascheme
    Copy link
    Member Author

    nascheme commented Nov 2, 2017

    New changeset 4e38d71 by Neil Schemenauer in branch 'master':
    bpo-28643: Record profile-opt build progress with stamp files (bpo-4223)
    4e38d71

    @vstinner
    Copy link
    Member

    vstinner commented Nov 6, 2017

    Oh, I had this bug and I'm quite sure that I reported it, but I cannot find it anymore :-)

    @nascheme
    Copy link
    Member Author

    nascheme commented Nov 6, 2017

    The previous behavior nearly drove me to drink. At least on my machine (and I have a relatively fast one), the profile-opt build takes a long time. After running "make" and checking things over, running "make install" will cause the whole process (make clean, make with -fprofile-generate, run unit tests, make clean, make with -fprofile-use) to happen again. The profile-opt build is significantly faster so I like to use it. Maybe I'm an odd duck in that I usually compile Python myself rather than using distro packaged versions.

    Current behavior is much better I think. You have to know to manually remove "profile-run-stamp" if you want the -fprofile-generate + unittest to run again. "make clean" does not remove it. I don't know if that should be documented somewhere besides in the Makefile.

    @nascheme
    Copy link
    Member Author

    Closing this as the current makefile works much better in this regard, at least based on my experience.

    @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 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants