Bug 2331345 - esptool fails to build with Python 3.14: AssertionError: assert 'usage: __main__.py [-h]' in 'espefuse.py v4.8.1\nusage: python3 -m espefuse [-h]\n [--chip {auto,esp32,esp32c2,esp32c3,e... --extend-efuse-table EXTEND_EFUSE_TABLE\
Summary: esptool fails to build with Python 3.14: AssertionError: assert 'usage: __mai...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: esptool
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karolina Surma
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-12-10 11:29 UTC by Karolina Surma
Modified: 2025-01-21 09:10 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-01-21 09:10:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github espressif esptool issues 1054 0 None open Python 3.14: new argparse output shows module name instead of __main__.py - causing 3 tests to fail 2025-01-20 09:56:24 UTC

Description Karolina Surma 2024-12-10 11:29:32 UTC
esptool fails to build with Python 3.14.0a2.

_________________ TestMultipleCommands.test_multiple_cmds_help _________________

self = <test_espefuse.TestMultipleCommands object at 0x7fc49cbcc410>

    def test_multiple_cmds_help(self):
        if arg_chip == "esp32c2":
            command1 = (
                f"burn_key_digest {S_IMAGES_DIR}"
                "/ecdsa256_secure_boot_signing_key_v2.pem"
            )
            command2 = (
                f"burn_key BLOCK_KEY0 {IMAGES_DIR}/128bit_key "
                "XTS_AES_128_KEY_DERIVED_FROM_128_EFUSE_BITS"
            )
        elif arg_chip == "esp32":
            command1 = f"burn_key_digest {S_IMAGES_DIR}/rsa_secure_boot_signing_key.pem"
            command2 = f"burn_key flash_encryption {IMAGES_DIR}/256bit"
        else:
            command1 = f"burn_key_digest BLOCK_KEY0 \
            {S_IMAGES_DIR}/rsa_secure_boot_signing_key.pem SECURE_BOOT_DIGEST0"
            command2 = f"burn_key BLOCK_KEY0 \
            {S_IMAGES_DIR}/rsa_public_key_digest.bin SECURE_BOOT_DIGEST0"
    
>       self.espefuse_py(
            f"-h {command1} {command2}",
            check_msg="usage: __main__.py [-h]",
        )

test/test_espefuse.py:1955: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/test_espefuse.py:144: in espefuse_py
    output = self._run_command(full_cmd, check_msg, ret_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_espefuse.TestMultipleCommands object at 0x7fc49cbcc410>
cmd = '/usr/bin/python3 -m espefuse --chip esp32 --virt --path-efuse-file /tmp/tmp5doua2or -d --do-not-confirm -h burn_key_d...ing_key.pem burn_key flash_encryption /builddir/build/BUILD/esptool-4.8.1-build/esptool-4.8.1/test/images/efuse/256bit'
check_msg = 'usage: __main__.py [-h]', ret_code = 0

    def _run_command(self, cmd, check_msg, ret_code):
        try:
            p = subprocess.Popen(
                cmd.split(),
                shell=False,
                stdin=subprocess.PIPE,
                stdout=subprocess.PIPE,
                universal_newlines=True,
            )
            output, _ = p.communicate()
            returncode = p.returncode
            if check_msg:
>               assert check_msg in output
E               AssertionError: assert 'usage: __main__.py [-h]' in 'espefuse.py v4.8.1\nusage: python3 -m espefuse [-h]\n                           [--chip {auto,esp32,esp32c2,esp32c3,e... --extend-efuse-table EXTEND_EFUSE_TABLE\n                        CSV file from ESP-IDF (esp_efuse_custom_table.csv)\n'

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08351976-esptool/

For all our attempts to build esptool with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/esptool/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2024-12-10 12:46:41 UTC
Watch out if this also fails with Python 3.13.1. Some of the output changes for argparse were backported.


Note You need to log in before you can comment on or make changes to this bug.