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

.github/zephyr: switch to python 3.10 on windows #9468

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

LaurentiuM1234
Copy link
Contributor

Zephyr commit b3b8360f3993 ("west: runners: Add west rtt command with pyocd implementation") adds some functionality to the west commands making use of the pipe ("|") operator for function return type hinting. As per PEP 604 1, this operator can be used for writing union types starting from python 3.10. Since the SOF windows builds use python 3.8 this leads to the CI failing.

To fix this, switch to using python 3.10. This is not a problem for Linux CI jobs as they already use python 3.10.

The following is a snippet of a failed windows CI job regarding this:

File "D:\a\sof\sof\workspace\zephyr\scripts/west_commands\runners\core.py", line 780, in ZephyrBinaryRunner

def get_rtt_address(self) -> int | None:

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Zephyr commit b3b8360f3993 ("west: runners: Add `west rtt` command
with pyocd implementation") adds some functionality to the
west commands making use of the pipe ("|") operator for
function return type hinting. As per PEP 604 [1], this operator
can be used for writing union types starting from python 3.10.
Since the SOF windows builds use python 3.8 this leads to
the CI failing.

To fix this, switch to using python 3.10. This is not a
problem for Linux CI jobs as they already use python 3.10.

The following is a snippet of a failed windows CI job
regarding this:

File "D:\a\sof\sof\workspace\zephyr\scripts/west_commands\runners\core.py",
line 780, in ZephyrBinaryRunner

    def get_rtt_address(self) -> int | None:

    TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

[1]: https://peps.python.org/pep-0604/

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
@LaurentiuM1234
Copy link
Contributor Author

LaurentiuM1234 commented Sep 12, 2024

No breakage so far on the windows build jobs run on this PR.

I'm a bit concerned about https://sof-ci.01.org/sofpr/PR9469/build7967/build/firmware_community/tgl.log from #9469.

@marc-hb does the Intel CI build job use a different, internal workflow script which still uses an older python version? It seems like it still continues to use python 3.8.

Also, the PR exposing this issue is #9372, which does a Zephyr hash bump. The failing windows CI build job logs can be found there.

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb does the Intel CI build job use a different, internal workflow script which still uses an older python version? It seems like it still continues to use python 3.8.

Unfortunately yes. This is tracked in internal issues 351 and 606

@marc-hb
Copy link
Collaborator

marc-hb commented Sep 12, 2024

adds some functionality to the west commands making use of the pipe ("|") operator for function return type hinting. As per PEP 604 1, this operator can be used for writing union types starting from python 3.10

Maybe there is a somewhat equivalent way to do this in 3.8? This could buy a little bit of time...

My 2 cents.

@kv2019i kv2019i merged commit 76e650e into thesofproject:main Sep 13, 2024
45 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants