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

TestsMSI/build_msi.yml GHA workflow stopped passing #121879

Closed
webknjaz opened this issue Jul 16, 2024 · 8 comments
Closed

TestsMSI/build_msi.yml GHA workflow stopped passing #121879

webknjaz opened this issue Jul 16, 2024 · 8 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@webknjaz
Copy link
Contributor

webknjaz commented Jul 16, 2024

Bug report

Bug description:

While working on something else, I tripped the conditional that made https://github.com/python/cpython/blob/f589f26/.github/workflows/build_msi.yml start and the workflow run failed. I asked @hugovk to trigger a manual run to make sure it wasn't related to my pull request. Turned out, it currently fails on main and 3.13:

The last successes recorded were seen about a month ago:

It looks like there are several failures in the logs. The first one seems to be related to missing (or misplaced/corrupted?) blurb (but there seem to be more, maybe related to free-treading — it was hard to judge from the build log):

  py -3.12 -m pip install -U blurb
  Requirement already satisfied: blurb in c:\hostedtoolcache\windows\python\3.12.4\x64\lib\site-packages (1.2.0)
  py -3.12 -m blurb merge -f "D:\a\cpython\cpython\PCbuild\arm64\NEWS.txt"
  Traceback (most recent call last):
    File "<frozen runpy>", line 198, in _run_module_as_main
    File "<frozen runpy>", line 88, in _run_code
    File "C:\hostedtoolcache\windows\Python\3.12.4\x64\Lib\site-packages\blurb\__main__.py", line 6, in <module>
      blurb.main()
      ^^^^^^^^^^
  AttributeError: module 'blurb' has no attribute 'main'

cc @zooba — I understand you're maintaining this workflow, so I'm tagging you for visibility

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

@webknjaz webknjaz added the type-bug An unexpected behavior, bug, or error label Jul 16, 2024
@webknjaz
Copy link
Contributor Author

So there's a small difference in Python runtime:

-   WARNING: The script blurb.exe is installed in 'C:\hostedtoolcache\windows\Python\3.12.3\x64\Scripts' which is not on PATH.
+   WARNING: The script blurb.exe is installed in 'C:\hostedtoolcache\windows\Python\3.12.4\x64\Scripts' which is not on PATH.

And blurb itself got updated:

- Successfully installed Jinja2-3.1.4 MarkupSafe-2.1.5 Pygments-2.18.0 alabaster-0.7.16 babel-2.15.0 blurb-1.1.0 certifi-2024.6.2 charset-normalizer-3.3.2 colorama-0.4.6 docutils-0.21.2 idna-3.7 imagesize-1.4.1 packaging-23.2 python-docs-theme-2024.4 requests-2.32.3 snowballstemmer-2.2.0 sphinx-7.3.7 sphinx-notfound-page-1.0.0 sphinxcontrib-applehelp-1.0.8 sphinxcontrib-devhelp-1.0.6 sphinxcontrib-htmlhelp-2.0.5 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.7 sphinxcontrib-serializinghtml-1.1.10 sphinxext-opengraph-0.7.5 urllib3-2.2.1
+ Successfully installed Jinja2-3.1.4 MarkupSafe-2.1.5 Pygments-2.18.0 alabaster-0.7.16 babel-2.15.0 blurb-1.2.0 certifi-2024.7.4 charset-normalizer-3.3.2 colorama-0.4.6 docutils-0.21.2 idna-3.7 imagesize-1.4.1 packaging-23.2 python-docs-theme-2024.6 requests-2.32.3 snowballstemmer-2.2.0 sphinx-7.3.7 sphinx-notfound-page-1.0.0 sphinxcontrib-applehelp-1.0.8 sphinxcontrib-devhelp-1.0.6 sphinxcontrib-htmlhelp-2.0.5 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.7 sphinxcontrib-serializinghtml-1.1.10 sphinxext-opengraph-0.7.5 urllib3-2.2.2

@webknjaz
Copy link
Contributor Author

webknjaz commented Jul 16, 2024

Apparently, the new version of blurb was only released lask week and the previous one was released from a different repository (core-workflow) like 2 years ago. No tags preserved so it's rather difficult to make a comparison of changes in Git since the previous release isn't marked. Here's the blurb wheel diff, though:

$ python -Im pip_wheel_diff 'blurb == 1.1.0' 'blurb == 1.2.0'
Collecting blurb==1.1.0
  Using cached blurb-1.1.0-py3-none-any.whl (22 kB)
Saved /tmp/tmpjtjbccgo/blurb-1.1.0-py3-none-any.whl

[notice] A new release of pip is available: 23.1.2 -> 24.1.2
[notice] To update, run: python3.11 -m pip install --upgrade pip
Collecting blurb==1.2.0
  Using cached blurb-1.2.0-py3-none-any.whl (19 kB)
Saved /tmp/tmpvsdc3ao3/blurb-1.2.0-py3-none-any.whl

[notice] A new release of pip is available: 23.1.2 -> 24.1.2
[notice] To update, run: python3.11 -m pip install --upgrade pip
Only in /tmp/tmpv3hs9vhq/v2: blurb
diff -r /tmp/tmpv3hs9vhq/v1/blurb.dist-info/entry_points.txt /tmp/tmpv3hs9vhq/v2/blurb.dist-info/entry_points.txt
2,3c2
< blurb=blurb:main
< 
---
> blurb = blurb.blurb:main
Only in /tmp/tmpv3hs9vhq/v2/blurb.dist-info: licenses
Only in /tmp/tmpv3hs9vhq/v1/blurb.dist-info: LICENSE.txt
diff -r /tmp/tmpv3hs9vhq/v1/blurb.dist-info/METADATA /tmp/tmpv3hs9vhq/v2/blurb.dist-info/METADATA
1c1
< Metadata-Version: 2.1
---
> Metadata-Version: 2.3
3c3
< Version: 1.1.0
---
> Version: 1.2.0
5,11c5,10
< Home-page: https://github.com/python/core-workflow/tree/master/blurb
< Author: Larry Hastings
< Author-email: larry@hastings.org
< Maintainer: Python Core Developers
< Maintainer-email: core-workflow@mail.python.org
< Requires-Python: >=3.7
< Description-Content-Type: text/x-rst
---
> Project-URL: Changelog, https://github.com/python/blurb/blob/main/README.md#changelog
> Project-URL: Homepage, https://github.com/python/blurb
> Project-URL: Source, https://github.com/python/blurb
> Author-email: Larry Hastings <larry@hastings.org>
> Maintainer-email: Python Core Developers <core-workflow@mail.python.org>
> License-File: LICENSE.txt
14a14,32
> Classifier: Programming Language :: Python :: 3.8
> Classifier: Programming Language :: Python :: 3.9
> Classifier: Programming Language :: Python :: 3.10
> Classifier: Programming Language :: Python :: 3.11
> Classifier: Programming Language :: Python :: 3.12
> Classifier: Programming Language :: Python :: 3.13
> Requires-Python: >=3.8
> Provides-Extra: tests
> Requires-Dist: pyfakefs; extra == 'tests'
> Requires-Dist: pytest; extra == 'tests'
> Requires-Dist: pytest-cov; extra == 'tests'
> Description-Content-Type: text/markdown
> 
> # blurb
> 
> [![PyPI version](https://img.shields.io/pypi/v/blurb.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/blurb)
> [![GitHub Actions](https://github.com/python/blurb/actions/workflows/test.yml/badge.svg)](https://github.com/python/blurb/actions)
> [![Codecov](https://codecov.io/gh/python/blurb/branch/main/graph/badge.svg)](https://codecov.io/gh/python/blurb)
> [![Python discussions](https://img.shields.io/badge/Discourse-join_chat-brightgreen.svg)](https://discuss.python.org/)
16,23c34
< blurb
< =====
< 
< .. image:: https://img.shields.io/pypi/v/blurb.svg
<     :target: https://pypi.org/project/blurb/
< 
< Overview
< --------
---
> ## Overview
26c37
< of the scourge of ``Misc/NEWS`` conflicts.
---
> of the scourge of `Misc/NEWS` conflicts.
28c39
< The core concept: split ``Misc/NEWS`` into many
---
> The core concept: split `Misc/NEWS` into many
30,31c41,42
< in sorted order, reconstitute the original ``Misc/NEWS`` file.
< After that, ``Misc/NEWS`` could be deleted from the CPython
---
> in sorted order, reconstitute the original `Misc/NEWS` file.
> After that, `Misc/NEWS` could be deleted from the CPython
33c44
< a release).  When checking in a change to CPython, the checkin
---
> a release).  When committing a change to CPython, the commit
38c49
< It's designed  to be run inside a valid CPython (git) repo,
---
> It's designed  to be run inside a valid CPython (Git) repo,
41,43c52,55
< You can install **blurb** from PyPI using ``pip``.  Alternatively,
< simply add ``blurb`` to a directory on your path.
< **blurb**'s only dependency is Python 3.7+.
---
> You can install **blurb** from PyPI using `pip`.  Alternatively,
> simply add `blurb` to a directory on your path.
> 
> **blurb**'s only dependency is Python 3.8+.
46,47c58
< Files used by blurb
< -------------------
---
> ## Files used by blurb
49c60
< **blurb** uses a new directory tree called ``Misc/NEWS.d``.
---
> **blurb** uses a new directory tree called `Misc/NEWS.d`.
51c62
< modifying ``Misc/NEWS``.
---
> modifying `Misc/NEWS`.
53c64
< Under ``Misc/NEWS.d`` you'll find the following:
---
> Under `Misc/NEWS.d` you'll find the following:
56,57c67,68
<   named for the exact version number, with the extension ``.rst``.
<   Example: ``Misc/NEWS.d/3.6.0b2.rst``.
---
>   named for the exact version number, with the extension `.rst`.
>   Example: `Misc/NEWS.d/3.6.0b2.rst`.
59,61c70,72
< * The ``next`` directory, which contains subdirectories representing
<   the various ``Misc/NEWS`` categories.  Inside these subdirectories
<   are more ``.rst`` files with long, uninteresting, computer-generated
---
> * The `next` directory, which contains subdirectories representing
>   the various `Misc/NEWS` categories.  Inside these subdirectories
>   are more `.rst` files with long, uninteresting, computer-generated
63c74
<   ``Misc/NEWS.d/next/Library/2017-05-04-12-24-06.gh-issue-25458.Yl4gI2.rst``
---
>   `Misc/NEWS.d/next/Library/2017-05-04-12-24-06.gh-issue-25458.Yl4gI2.rst`
66,67c77
< blurb subcommands
< -----------------
---
> ## blurb subcommands
70c80
< (called ``blurb``), but provides a diverse set of functionality
---
> (called `blurb`), but provides a diverse set of functionality
74,77c84,87
< If you're a CPython core developer, you probably don't need to use
< anything except ``blurb add``--and you don't even need to specify
< the ``add`` part.
< (If no subcommand is specified, **blurb** assumes you meant ``blurb add``.)
---
> If you're a CPython contributor, you probably don't need to use
> anything except `blurb add` — and you don't even need to specify
> the `add` part.
> (If no subcommand is specified, **blurb** assumes you meant `blurb add`.)
83,84c93
< blurb help
< ~~~~~~~~~~
---
> ### blurb help
86c95
< **blurb** is self-documenting through the ``blurb help`` subcommand.
---
> **blurb** is self-documenting through the `blurb help` subcommand.
89c98
< third argument, it prints help on that subcommand (e.g. ``blurb help release``).
---
> third argument, it prints help on that subcommand (e.g. `blurb help release`).
92,93c101
< blurb add
< ~~~~~~~~~
---
> ### blurb add
95c103
< ``blurb add`` adds a new Misc/NEWS entry for you.
---
> `blurb add` adds a new `Misc/NEWS` entry for you.
98c106
< in the correct place, and stages it in ``git`` for you.
---
> in the correct place, and stages it in Git for you.
100c108
< The template for the ``blurb add`` message looks like this::
---
> The template for the `blurb add` message looks like this:
129,130c137,138
< * Add the GitHub issue number for this checkin to the
<   end of the ``.. gh-issue:`` line.
---
> * Add the GitHub issue number for this commit to the
>   end of the `.. gh-issue:` line.
132,135c140,143
< * Uncomment the line with the relevant ``Misc/NEWS`` section for this entry.
<   For example, if this should go in the ``Library`` section, uncomment
<   the line reading ``#.. section: Library``.  To uncomment, just delete
<   the ``#`` at the front of the line.
---
> * Uncomment the line with the relevant `Misc/NEWS` section for this entry.
>   For example, if this should go in the `Library` section, uncomment
>   the line reading `#.. section: Library`.  To uncomment, just delete
>   the `#` at the front of the line.
137c145
< * Finally, go to the end of the file, and enter your NEWS entry.
---
> * Finally, go to the end of the file, and enter your `NEWS` entry.
139c147
<   simple ReST markup.
---
>   simple reST markup.
141,142c149,150
< When ``blurb add`` gets a valid entry, it writes it to a file
< with the following format::
---
> When `blurb add` gets a valid entry, it writes it to a file
> with the following format:
146c154
< For example, a file added by ``blurb add`` might look like this::
---
> For example, a file added by `blurb add` might look like this::
150c158
< ``<section>`` is the section provided in the checkin message.
---
> `<section>` is the section provided in the commit message.
152,153c160,161
< ``<datetime>`` is the current UTC time, formatted as
< ``YYYY-MM-DD-hh-mm-ss``.
---
> `<datetime>` is the current UTC time, formatted as
> `YYYY-MM-DD-hh-mm-ss`.
155c163
< ``<nonce>`` is a hopefully-unique string of characters meant to
---
> `<nonce>` is a hopefully-unique string of characters meant to
163c171
< * All entries in ``Misc/NEWS`` will be sorted by time.
---
> * All entries in `Misc/NEWS` will be sorted by time.
166,167c174,175
<   between the filenames generated for two developers checking in,
<   even if they check in at the exact same second.
---
>   between the filenames generated for two developers committing,
>   even if they commit in at the exact same second.
170c178
< Finally, ``blurb add`` stages the file in git for you.
---
> Finally, `blurb add` stages the file in git for you.
173,174c181
< blurb merge
< ~~~~~~~~~~~
---
> ### blurb merge
176,177c183,184
< ``blurb merge`` recombines all the files in the
< ``Misc/NEWS.d`` tree back into a single ``NEWS`` file.
---
> `blurb merge` recombines all the files in the
> `Misc/NEWS.d` tree back into a single `NEWS` file.
179,181c186,188
< ``blurb merge`` accepts only a single command-line argument:
< the file to write to.  By default it writes to
< ``Misc/NEWS`` (relative to the root of your CPython checkout).
---
> `blurb merge` accepts only a single command-line argument:
> the file to write to.  By default, it writes to
> `Misc/NEWS` (relative to the root of your CPython checkout).
183,186c190,193
< Splitting and recombining the existing ``Misc/NEWS`` file
< doesn't recreate the previous ``Misc/NEWS`` exactly.  This
< is because ``Misc/NEWS`` never used a consistent ordering
< for the "sections" inside each release, whereas ``blurb merge``
---
> Splitting and recombining the existing `Misc/NEWS` file
> doesn't recreate the previous `Misc/NEWS` exactly.  This
> is because `Misc/NEWS` never used a consistent ordering
> for the "sections" inside each release, whereas `blurb merge`
189,190c196,197
< wheras the original hand-edited file occasionally had lines
< > 80 columns.  Finally, **blurb** strictly uses ``gh-issue-<n>:`` to
---
> wheras the original hand-edited file occasionally had lines >
> 80 columns.  Finally, **blurb** strictly uses `gh-issue-<n>:` to
192c199
< the legacy approach to ``Misc/NEWS`` required using ``Issue #<n>:``.
---
> the legacy approach to `Misc/NEWS` required using `Issue #<n>:`.
195,196c202
< blurb release
< ~~~~~~~~~~~~~
---
> ### blurb release
198c204
< ``blurb release`` is used by the release manager as part of
---
> `blurb release` is used by the release manager as part of
205,206c211,212
<   the ``Misc/NEWS.d/next`` directory into ``Misc/NEWS.d/<version>.rst``.
< * Runs ``blurb merge`` to produce an updated ``Misc/NEWS`` file.
---
>   the `Misc/NEWS.d/next` directory into `Misc/NEWS.d/<version>.rst`.
> * Runs `blurb merge` to produce an updated `Misc/NEWS` file.
208c214
< One hidden feature: if the version specified is ``.``, ``blurb release``
---
> One hidden feature: if the version specified is `.`, `blurb release`
214,215c220
< blurb split
< ~~~~~~~~~~~
---
> ### blurb split
217,219c222,224
< ``blurb split`` only needs to be run once per-branch, ever.
< It reads in ``Misc/NEWS``
< and splits it into individual ``.rst`` files.
---
> `blurb split` only needs to be run once per-branch, ever.
> It reads in `Misc/NEWS`
> and splits it into individual `.rst` files.
224c229
< ``<version>`` is the version number of Python where the
---
> `<version>` is the version number of Python where the
226,227c231,232
< with an abbreviation: ``a`` for alphas, ``b`` for betas,
< and ``rc`` for release candidates.
---
> with an abbreviation: `a` for alphas, `b` for betas,
> and `rc` for release candidates.
229c234
< The individual ``<version>.rst`` files actually (usually)
---
> The individual `<version>.rst` files actually (usually)
231c236
< single line containing ``..`` by itself.
---
> single line containing `..` by itself.
234,236c239,241
< we'll run ``blurb split`` on each active branch,
< remove ``Misc/NEWS`` from the repo entirely,
< never run ``blurb split`` ever again,
---
> we'll run `blurb split` on each active branch,
> remove `Misc/NEWS` from the repo entirely,
> never run `blurb split` ever again,
242,243c247
< The "next" directory
< --------------------
---
> ## The "next" directory
245,246c249,250
< You may have noticed that ``blurb add`` adds news entries to
< a directory called ``next``, and ``blurb release`` combines those
---
> You may have noticed that `blurb add` adds news entries to
> a directory called `next`, and `blurb release` combines those
256,258c260,262
< backwards, you automatically pick up the NEWS entry too.  You
< don't need to touch anything up--the system will already do
< the right thing.  If NEWS entries were already written to the
---
> backwards, you automatically pick up the `NEWS` entry too.  You
> don't need to touch anything up — the system will already do
> the right thing.  If `NEWS` entries were already written to the
262,263c266
< Changelog
< ---------
---
> ## Changelog
265,266c268,280
< 1.1.0
< ~~~~~
---
> ### 1.2.0
> 
> - Replace spaces with underscores in news directory.
> - Drop support for Python 3.7.
> - Remove `blurb split` command.
> - Replace `gh-issue-NNNN:` with `gh-NNNN:` in the output.
> - Accept GitHub issues numbered only 32426 or above.
> - Improve error checking when parsing a Blurb.
> - Loosen README check for CPython forks.
> - Move code from `python/core-workflow` to own `python/blurb` repo.
> - Deploy to PyPI via Trusted Publishers.
> 
> ### 1.1.0
269c283,284
<   If "gh-issue" is in the metadata, then the filename will contain "gh-issue-<number>" instead of "bpo-".
---
>   If "gh-issue" is in the metadata, then the filename will contain
>   "gh-issue-<number>" instead of "bpo-".
271,272c286
< 1.0.7
< ~~~~~
---
> ### 1.0.7
275,278c289,292
< - Use the ``-f`` flag when adding **blurb** files to a ``git``
<   checkin.  This forces them to be added, even when the files
<   might normally be ignored based on a ``.gitignore`` directive.
< - Explicitly support the ``-help`` command-line option.
---
> - Use the `-f` flag when adding **blurb** files to a Git
>   commit.  This forces them to be added, even when the files
>   might normally be ignored based on a `.gitignore` directive.
> - Explicitly support the `-help` command-line option.
281,282c295
< Copyright
< ---------
---
> ## Copyright
286d298
< 
diff -r /tmp/tmpv3hs9vhq/v1/blurb.dist-info/WHEEL /tmp/tmpv3hs9vhq/v2/blurb.dist-info/WHEEL
2c2
< Generator: flit 3.7.1
---
> Generator: hatchling 1.25.0
Only in /tmp/tmpv3hs9vhq/v1: blurb.py

@hugovk
Copy link
Member

hugovk commented Jul 16, 2024

Ten days ago we made the first release of blurb in over two years, and there were a lot of changes:

https://pypi.org/project/blurb/#history

No tags preserved so it's rather difficult to make a comparison of changes in Git since the previous release isn't marked.

There were no tags to preserve: https://github.com/python/core-workflow/tags

But we can compare a version-bumping commit with the new tag:

https://github.com/python/blurb/compare/a2e8eeca0c72343fb30e67aaf33a6f0c1db440b1..v1.2.0

@webknjaz
Copy link
Contributor Author

@hugovk yep, that was about to be my next step :)

In the diff, it's visible that __init__.py is created under blurb only exposes a version. And blurb.py was moved one level deeper, without adjusting the imports in __main__.py.

The test are not able to catch this because they invoke the console script via blurb which is linked correctly, while python -m blurb used in CPython goes through the __main__.py entry-point and hits code paths that aren't covered.

webknjaz added a commit to webknjaz/python--blurb that referenced this issue Jul 16, 2024
When `blurb` was being restructured, the import paths moved to deeper levels of the project layout. It was updated in the console scripts so invoking just the `blurb` command worked but `python -m blurb` didn't. This resulted in breaking the MSI installer smoke testing workflow in CPython's CI [[1]].

Blurb's own CI never invokes said interface, so it had no chance of catching the regression.

This patch corrects the import but does not make an attempt to improve testing.

[1]: python/cpython#121879
@webknjaz
Copy link
Contributor Author

I sketched python/blurb#22 right in the browser as a hotfix.

@webknjaz
Copy link
Contributor Author

@hugovk I'm leaving this to you now to take over the problem and perhaps cut a hotfix release whenever you get to your computer tomorrow..

@webknjaz
Copy link
Contributor Author

N.B. Don't close this issue right after merging the PR. Make a release, and trigger the affected workflow on both branches manually to see if this was the only issue first.

@hugovk
Copy link
Member

hugovk commented Jul 18, 2024

blurb 1.2.1 released, and workflows triggered and passed ✅:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants