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

Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots #63305

Closed
elibendersky mannequin opened this issue Sep 27, 2013 · 23 comments
Closed

Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots #63305

elibendersky mannequin opened this issue Sep 27, 2013 · 23 comments
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@elibendersky
Copy link
Mannequin

elibendersky mannequin commented Sep 27, 2013

BPO 19106
Nosy @gvanrossum, @loewis, @ncoghlan, @pitrou, @benjaminp, @ezio-melotti
Files
  • touch.diff
  • 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-10-08.13:07:43.405>
    created_at = <Date 2013-09-27.15:25:57.367>
    labels = ['type-bug', 'build']
    title = 'Prepare .hgtouch and Tools/hg/hgtouch.py to run on the\tbots'
    updated_at = <Date 2013-10-08.13:07:43.404>
    user = 'https://bugs.python.org/elibendersky'

    bugs.python.org fields:

    activity = <Date 2013-10-08.13:07:43.404>
    actor = 'eli.bendersky'
    assignee = 'eli.bendersky'
    closed = True
    closed_date = <Date 2013-10-08.13:07:43.405>
    closer = 'eli.bendersky'
    components = ['Build']
    creation = <Date 2013-09-27.15:25:57.367>
    creator = 'eli.bendersky'
    dependencies = []
    files = ['31920']
    hgrepos = []
    issue_num = 19106
    keywords = ['patch']
    message_count = 23.0
    messages = ['198482', '198485', '198489', '198490', '198684', '198695', '198696', '198697', '198699', '198703', '198707', '198709', '198771', '198774', '198775', '198776', '198779', '198782', '198783', '198785', '198786', '198787', '199200']
    nosy_count = 8.0
    nosy_names = ['gvanrossum', 'loewis', 'ncoghlan', 'pitrou', 'benjamin.peterson', 'ezio.melotti', 'eli.bendersky', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue19106'
    versions = ['Python 3.4']

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Sep 27, 2013

    Background: we'd like to enable running 'make touch' on the bots before 'make -jN', to avoid problems with scripts that auto-generate code for the Python build (bootstrapping). pydev thread: https://mail.python.org/pipermail/python-dev/2013-September/128992.html

    A couple of issues are prerequisites:

    1. Fix the asdl dependencies in .hgtouch:

    Include/ast.h: Parser/Python.asdl Parser/asdl.py Parser/asdl_c.py
    Python/Python-ast.c: Include/ast.h

    The file Include/ast.h is not, in fact, auto-generated. But Include/Python-ast.h *is*, and it does not appear in this file.

    1. Make sure 'hg touch' itself runs on Python 2.4 because that's what some bots have (and other older systems like RHEL 5)

    @elibendersky elibendersky mannequin self-assigned this Sep 27, 2013
    @elibendersky elibendersky mannequin added build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Sep 27, 2013
    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Sep 27, 2013

    .hgtouch fixed in ac19ff225280 (I specified the issue number incorrectly so this one wasn't notified).

    Curiously, make touch seems to think there's still things to do even after the first round of "touching":

    $ touch Parser/asdl_c.py 
    $ make touch
    hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
    Touching Include/Python-ast.h
    Touching Python/Python-ast.c
    $ make touch
    hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
    Touching Python/Python-ast.c

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Sep 27, 2013

    Ooh, I think that's because the "# try processing all rules in topological order" in do_touch doesn't actually topo-sort.

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Sep 27, 2013

    The problem in this case is different, actually. It's the comparison:

            if o_time <= i_time:
                # generated file is older, touch
                need_touch = True

    In check_rule. The script is pretty quick so when it touches both Python-ast.h and .c they get the same stat time exactly. In the next run, then, this comparison succeeds and .c is touched again.

    I'm not sure what's the right way to go about this? Changing the comparison to < may theoretically miss cases in which the input was updated an epsilon after it auto-generated its output, and the change will go unnoticed. A different solution would be to introduce a micro-wait between each 'touch' to make sure that transitive dependencies don't need to be revisited in the future.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Sep 30, 2013

    I see two solutions, both involving to track the newest timestamp that needs to pass.
    a) touch the file to have a time stamp in the future. make might complain, though.
    b) sleep until a second has passed, then touch (actually, sleep of 100ms multiple times until the time stamp is new enough)

    The key issue is that hg touch should use the same comparison as make. So if make thinks that something need to be done, hg touch should touch the files.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Sep 30, 2013

    Here is a patch that backdates outputs 1s after their youngest input (and sleeps if necessary to avoid producing files in the future).

    With that, I get

    lap-le:3k loewis$ touch Parser/asdl_c.py ;date;make touch;date
    Mo 30 Sep 2013 15:29:21 CEST
    hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
    Touching Include/Python-ast.h
    Touching Python/Python-ast.c
    Mo 30 Sep 2013 15:29:23 CEST
    lap-le:3k loewis$ ls -lT Parser/asdl_c.py Include/Python-ast.h Python/Python-ast.c
    -rw-r--r-- 1 loewis admin 19489 30 Sep 15:29:22 2013 Include/Python-ast.h
    -rwxr-xr-x 1 loewis admin 43732 30 Sep 15:29:21 2013 Parser/asdl_c.py
    -rw-r--r-- 1 loewis admin 228785 30 Sep 15:29:23 2013 Python/Python-ast.c

    BTW, I think the Python-ast.c issue could be solved by just having Python-ast.c depend on the same inputs as Python-ast.h; the C file isn't actually depending on the H file.

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Sep 30, 2013

    LGTM

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 30, 2013

    New changeset 477246839224 by Martin v. Löwis in branch '3.3':
    Issue bpo-19106: Touch generated files to be 1s newer than their youngest source.
    http://hg.python.org/cpython/rev/477246839224

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 30, 2013

    New changeset 86eff5c4e698 by Martin v. Löwis in branch '3.3':
    Issue bpo-19106: Add buildbottouch target.
    http://hg.python.org/cpython/rev/86eff5c4e698

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Sep 30, 2013

    I have now updated the master.cfg to make buildbottouch a separate build step.

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Sep 30, 2013

    With your fix, make touch now behaves as expected. Also, I can see the step added to the bots (e.g. http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%203.x/builds/2597/steps/shell/logs/stdio)

    Thanks, I think the issue is resolved then. We should now be able to have modern Python code in scripts that generate code such as asdl[_c].py because bots and people will only old versions of Python don't ever need to run them.

    Should we add a note about this to the dev guide?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Sep 30, 2013

    "make touch" (or "hg touch") certainly should be mentioned. Details of the buildbot configuration need not.

    Publishing the buildbot configuration file might be useful, except that it also contains all the builder passwords, which should not be published. If that is done, it should be the "life" configuration file (rather than a static copy created now). It might be easiest to publish it through a symlink on buildbot.python.org.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 1, 2013

    New changeset 56ed149e597a by Eli Bendersky in branch 'default':
    Mention 'make touch' in the devguide.
    http://hg.python.org/devguide/rev/56ed149e597a

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Oct 1, 2013

    I've updated the devguide about make touch.

    As for the buildbot configuration, I agree we shouldn't document a static snapshot and also there's the passwords problem.

    I was talking to Antoine about this the other day, and maybe there's sense to create an "infrastructure" section in the devguide that will explain how to log into the buildbot server and look at the configuration. This should be enough for folks who really need to figure it out and is also safe w.r.t. getting out of date and exposing passwords.

    Also, IMHO bpo-15964 can be closed.

    @pitrou
    Copy link
    Member

    pitrou commented Oct 1, 2013

    I was talking to Antoine about this the other day, and maybe there's
    sense to create an "infrastructure" section in the devguide that
    will explain how to log into the buildbot server and look at the
    configuration.

    IMHO it would make more sense to create a separate "infrastructure
    guide". There's no need to bloat the devguide with such information,
    which could quickly become quite complicated.

    @pitrou pitrou changed the title Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots Oct 1, 2013
    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Oct 1, 2013

    I'm not sure a separate document is right here because that's one more repository to have. The devguide already contains sections for somewhat more esoteric things like compiler internals guide, coverity scans. Besides, section 18 already has some material about the buildbots.

    But I don't feel strongly enough about this to argue :)

    @pitrou
    Copy link
    Member

    pitrou commented Oct 1, 2013

    I'm not sure a separate document is right here because that's one
    more repository to have. The devguide already contains sections for
    somewhat more esoteric things like compiler internals guide,
    coverity scans. Besides, section 18 already has some material about
    the buildbots.

    Well, ideally the more esoteric things wouldn't really be there.
    Perhaps other people have different opinions?

    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Oct 1, 2013

    On Tue, Oct 1, 2013 at 7:00 AM, Antoine Pitrou <report@bugs.python.org>wrote:

    Antoine Pitrou added the comment:

    > I'm not sure a separate document is right here because that's one
    > more repository to have. The devguide already contains sections for
    > somewhat more esoteric things like compiler internals guide,
    > coverity scans. Besides, section 18 already has some material about
    > the buildbots.

    Well, ideally the more esoteric things wouldn't really be there.

    I still see the current situation better than the previous one, where this
    was scattered around PEPs, Wikis and just random web pages. Having it all
    in the same repository is not ideal from a taxonomical point of view,
    perhaps, but as a single collection of "everything related to the
    development *of* Python" it's not too bad since keeping it in a single
    place makes it easier to maintain and review; mostly, there's a somewhat
    smaller chance that things will be forgotten and rot.

    To put it differently, maintaining the devguide is kind-of a chore for devs
    as it is; splitting it into multiple topical repositories will just make
    the burden higher so we'll end up not maintaining it at all :)

    Perhaps other people have different opinions?

    @elibendersky elibendersky mannequin changed the title Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots Oct 1, 2013
    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Oct 1, 2013

    +nick,guido,benjamin: in case you're interested in the discussion that takes place in the most recent messages of this issue

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Oct 1, 2013

    Documenting the pydotorg setup is a field of ongoing discussions. If you ask three people involved, you get three answers where this should be documented, with no chance for consensus.

    From an infrastructure point of view, it is up to the infrastructure head (i.e. Noah Kantrowitz) to rule on where this should be documented. I can see the python-dev view, to, although the documentation might be as short as "ask Noah".

    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented Oct 1, 2013

    Where to document the infrastructure setup (including the buildbots) is up to Noah/infrastructure-sig, as the devguide just covers CPython development, while the PSF infrastructure team covers a lot more than that.

    A pointer from the devguide docs to the appropriate infrastructure docs would make sense, but it isn't the right home for the docs themselves.

    The interim solution I use is "ask on python-dev" or "ask on python-committers" :)

    @pitrou
    Copy link
    Member

    pitrou commented Oct 1, 2013

    I still see the current situation better than the previous one, where
    this
    was scattered around PEPs, Wikis and just random web pages. Having it
    all
    in the same repository is not ideal from a taxonomical point of view,
    perhaps, but as a single collection of "everything related to the
    development *of* Python" it's not too bad since keeping it in a
    single
    place makes it easier to maintain and review;

    Well, precisely, it's putting everything in a single collection that
    I find bad, because it could become dreadful for beginner contributors.

    The devguide is primarily meant to ensure contributors don't get lost,
    even though it can serve as a reminder for core developers too.

    @pitrou pitrou changed the title Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots Prepare .hgtouch and Tools/hg/hgtouch.py to run on the bots Oct 1, 2013
    @elibendersky
    Copy link
    Mannequin Author

    elibendersky mannequin commented Oct 8, 2013

    I think this issue can be closed, since Martin's touch step runs on the bots successfully, and the ASDL dependencies in .hgtouch were fixed.

    @elibendersky elibendersky mannequin closed this as completed Oct 8, 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 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants