Skip to content

Commit

Permalink
Remove IDF_DEFAULT (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaerki authored Jan 30, 2025
1 parent a26c219 commit d13969c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
18 changes: 1 addition & 17 deletions src/mpbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"mimxrt": ARM_BUILD_CONTAINER,
"renesas-ra": ARM_BUILD_CONTAINER,
"samd": ARM_BUILD_CONTAINER,
"esp32": "espressif/idf",
"esp32": "espressif/idf:v5.2.2",
"esp8266": "larsks/esp-open-sdk",
"unix": "gcc:12-bookworm", # Special, doesn't have boards
}
Expand Down Expand Up @@ -54,8 +54,6 @@ def get_build_container(board: Board, variant: Optional[str] = None) -> str:
raise MpbuildNotSupportedException(f"{board.name}-{variant}") from e


IDF_DEFAULT = "v5.2.2"

nprocs = multiprocessing.cpu_count()


Expand All @@ -65,7 +63,6 @@ def docker_build_cmd(
extra_args: List[str] = [],
do_clean: bool = False,
build_container_override: str | None = None,
idf: str = IDF_DEFAULT,
docker_interactive: bool = True,
) -> str:
"""
Expand All @@ -87,11 +84,6 @@ def docker_build_cmd(
else get_build_container(board=board, variant=variant)
)

if port.name == "esp32" and not build_container_override:
if not idf:
idf = IDF_DEFAULT
build_container += f":{idf}"

variant_param = "BOARD_VARIANT" if board.physical_board else "VARIANT"
variant_cmd = "" if variant is None else f" {variant_param}={variant}"

Expand Down Expand Up @@ -139,7 +131,6 @@ def build_board(
variant: Optional[str] = None,
extra_args: List[str] = [],
build_container_override: Optional[str] = None,
idf: Optional[str] = IDF_DEFAULT,
mpy_dir: str | Path | None = None,
) -> None:
"""
Expand Down Expand Up @@ -168,18 +159,13 @@ def build_board(
print(f"Sorry, builds are not supported for the {port} port at this time")
raise SystemExit()

if port != "esp32" and idf != IDF_DEFAULT:
print("An IDF version can only be specified for ESP32 builds")
raise SystemExit()

do_clean = bool(extra_args and extra_args[0].strip() == "clean")
build_cmd = docker_build_cmd(
board=_board,
variant=variant,
extra_args=extra_args,
do_clean=do_clean,
build_container_override=build_container_override,
idf=idf,
)

title = "Build" if do_clean else "Clean"
Expand Down Expand Up @@ -207,13 +193,11 @@ def build_board(
def clean_board(
board: str,
variant: Optional[str] = None,
idf: Optional[str] = IDF_DEFAULT,
mpy_dir: Optional[str] = None,
) -> None:
build_board(
board=board,
variant=variant,
mpy_dir=mpy_dir,
idf=idf,
extra_args=["clean"],
)
6 changes: 1 addition & 5 deletions src/mpbuild/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typer

from . import __app_name__, __version__, OutputFormat
from .build import build_board, clean_board, IDF_DEFAULT
from .build import build_board, clean_board
from .list_boards import print_boards
from .check_images import check_images
from .completions import list_ports, list_boards, list_variants_for_board
Expand Down Expand Up @@ -42,10 +42,6 @@ def build(
Optional[str],
typer.Argument(help="Board variant", autocompletion=_complete_variant),
] = None,
idf: Annotated[
Optional[str],
typer.Option(help="esp32 port only: select IDF version to build with"),
] = IDF_DEFAULT,
extra_args: Annotated[
Optional[List[str]], typer.Argument(help="additional arguments to pass to make")
] = None,
Expand Down

0 comments on commit d13969c

Please sign in to comment.