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

Windows tail-call CI does not run the test cases #131678

Open
chris-eibl opened this issue Mar 24, 2025 · 5 comments
Open

Windows tail-call CI does not run the test cases #131678

chris-eibl opened this issue Mar 24, 2025 · 5 comments
Labels
3.14 new features, bugs and security fixes infra CI, GitHub Actions, buildbots, Dependabot, etc. OS-unsupported OS-windows type-bug An unexpected behavior, bug, or error

Comments

@chris-eibl
Copy link
Contributor

chris-eibl commented Mar 24, 2025

Excerpts from here #131526 (comment):

See e.g. https://github.com/python/cpython/actions/runs/14006628024/job/39221297660 and https://github.com/python/cpython/actions/runs/13954576580/job/39062383429#step:4:326.

After building, no more output can be seen.

This is interesting, because

- name: Native Windows (debug)
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
shell: cmd
run: |
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.5
set PlatformToolset=clangcl
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
set LLVMInstallDir=C:\Program Files\LLVM
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3

clearly ./PCbuild/rt.bat is invoked. Maybe the reason is, because it is not used with backslashes like in

The question then is, why ./PCbuild/build.bat is working ...

Linked PRs

@chris-eibl
Copy link
Contributor Author

comment from @Fidget-Spinner #131526 (comment)

CI uses cmd instead if powershell, could that make a difference?

@chris-eibl
Copy link
Contributor Author

comment from @zooba #131526 (comment)

CI uses cmd instead if powershell, could that make a difference?

It probably requires call PCbuild\build.bat ... to handle someone calling exit in the batch file. In Cmd, if the entire block is a batch file, then exit will break out of the top-level one, not the nested one, unless you use call.

@chris-eibl
Copy link
Contributor Author

Yeah, I remember that pitfall having exit in a batch file that is not invoked via call. But then here

.\\PCbuild\\build.bat
-e -d -v
-p "${ARCH}"
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
shell: bash
- name: Display build info # FIXME(diegorusso): remove the `if`
if: inputs.arch != 'arm64'
run: .\\python.bat -m test.pythoninfo
- name: Tests # FIXME(diegorusso): remove the `if`
if: inputs.arch != 'arm64'
run: >-
.\\PCbuild\\rt.bat
-p "${ARCH}"
-d -q --fast-ci
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
shell: bash

should be affected, too? But as @Fidget-Spinner noted, reusable-windows.yml uses shell: bash whereas tail-call.yml uses shell: cmd. And in a cmd prompt I definitely get an error for forward slashes.

It's still not clear for me, why ./PCbuild/build.bat is called called correctly, but as @zooba notes, there are many exits in it!

@picnixz picnixz added OS-windows OS-unsupported infra CI, GitHub Actions, buildbots, Dependabot, etc. labels Mar 24, 2025
@picnixz picnixz added type-bug An unexpected behavior, bug, or error 3.14 new features, bugs and security fixes labels Mar 24, 2025
@zooba
Copy link
Member

zooba commented Mar 24, 2025

Those are separate run: elements. Each one of those is likely implemented by writing the contents of run: into randomly_named.bat and doing cmd /C .\randomly_named.bat, which then means any further batch files are nested within it. But because build.bat is the last one that runs, you don't notice if it exits all the way.

In the other file, there are two batch files in the same run: step, so you do notice if one exits the whole step early.

@chris-eibl
Copy link
Contributor Author

Kudos to @zooba: prepending call fixes the issue: https://github.com/python/cpython/actions/runs/14044831663/job/39323183797?pr=131690
And reveals #131691, which I haven't noticed so far, because I only ran the full test suite for release or PGO builds ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes infra CI, GitHub Actions, buildbots, Dependabot, etc. OS-unsupported OS-windows type-bug An unexpected behavior, bug, or error
Projects
Status: No status
Development

No branches or pull requests

3 participants