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

fix esp32 builds #27561

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Dec 2, 2024

Description

Since f2d585a attempting to build marlin for esp32 based boards under windows results in the error.

'CC' is not recognized as an internal or external command, operable program or batch file.

The issue is

                # Skip '*-elf-g++' (crosstool-NG)
                if not gpath.stem.endswith('-elf-g++'):
                    gccpath = str(gpath.resolve())
                    break

But esp32 uses .platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g++

Under Linux it defaults back to g++, and most systems have this compiler so it does not error.
But under windows it defaults to CC, and windows does not have a stock compiler installed.

The fix is to also check for esp32, if "xtensa32" is in the path it is a esp32 so don't skip this *-elf-g++

                # Skip '*-elf-g++' (crosstool-NG) except for xtensa32
                if not "xtensa32" not in str(gpath) and gpath.stem.endswith('-elf-g++'):
                    gccpath = str(gpath.resolve())
                    break

Requirements

use a ESP32 based board eg
#define MOTHERBOARD BOARD_MKS_TINYBEE

Benefits

Builds as expected

Related Issues

  • Build error using mks tinybee board #27553
  • @thisiskeithb thisiskeithb linked an issue Dec 2, 2024 that may be closed by this pull request
    1 task
    @thinkyhead
    Copy link
    Member

    Good catch, thanks! Is the capitalized "CC" being derived from environment variable $CC or somewhere else?

    @thinkyhead thinkyhead merged commit 94bd6d5 into MarlinFirmware:bugfix-2.1.x Dec 3, 2024
    64 checks passed
    @ellensp ellensp deleted the fix-esp32-build branch December 4, 2024 00:00
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    Build error using mks tinybee board
    2 participants