Skip to content

Fix ESP32-C2 build: support multiple archive formats in framework extraction#8

Merged
zackees merged 3 commits intomainfrom
copilot/test-esp32c2-fix-build-badge
Mar 26, 2026
Merged

Fix ESP32-C2 build: support multiple archive formats in framework extraction#8
zackees merged 3 commits intomainfrom
copilot/test-esp32c2-fix-build-badge

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

ESP32-C2 CI builds fail with tarfile.ReadError: not an lzma file because framework_esp32.py hardcodes tarfile.open(path, "r:xz") for all framework archives, but pioarduino packages may use .tar.gz or .zip.

Changes

  • src/fbuild/packages/framework_esp32.py: Use tarfile.open(path, "r:*") for auto-detection, add zipfile extraction path, extend magic byte validation to cover gzip and zip formats
# Before (breaks on non-xz archives)
with tarfile.open(archive_path, "r:xz") as tar:
    tar.extractall(temp_dir)

# After (auto-detects compression)
if archive_name.endswith(".zip"):
    with zipfile.ZipFile(archive_path, "r") as zf:
        zf.extractall(temp_dir)
else:
    with tarfile.open(archive_path, "r:*") as tar:
        tar.extractall(temp_dir)
  • tests/esp32c2/esp32c2.ino: Replace LED_BUILTIN (undefined on C2) with explicit GPIO 8
  • tests/unit/packages/test_framework_archive_formats.py: 7 tests covering magic byte validation and extraction for .tar.xz, .tar.gz, .zip, plus a regression test proving "r:xz" fails on .tar.gz

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /usr/bin/python python -m pytest tests/unit/packages/test_framework_archive_formats.py -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

test the esp32c2 and revive the build badge. Whatever problems you find fix them.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 26, 2026 19:02
… tar.gz, zip)

The ESP32-C2 build was failing with "not an lzma file" because
framework_esp32.py hardcoded tarfile.open(archive_path, "r:xz").
Changed to auto-detect format using "r:*" for tar archives and
zipfile for .zip archives. Also added format-aware magic byte
validation and fixed the esp32c2.ino test sketch to use a specific
GPIO pin instead of LED_BUILTIN which may not be defined.

Agent-Logs-Url: https://github.com/FastLED/fbuild/sessions/565e62a0-9fa2-4594-b7b0-0ef03f2489b9

Co-authored-by: zackees <6856673+zackees@users.noreply.github.com>
Copilot AI changed the title [WIP] Test ESP32-C2 and fix build badge issues Fix ESP32-C2 build: support multiple archive formats in framework extraction Mar 26, 2026
Copilot AI requested a review from zackees March 26, 2026 19:06
@zackees zackees marked this pull request as ready for review March 26, 2026 19:42
@zackees zackees merged commit e6f781f into main Mar 26, 2026
@zackees zackees deleted the copilot/test-esp32c2-fix-build-badge branch April 7, 2026 02:28
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.

2 participants