Skip to content

[Bug] - [gen-build-spec command raises an error when the build tool is not supported] #1302

Closed

Description

@behnazh-w

Description

When attempting to generate a build spec with Macaron and the provided purl type does not correspond to a supported build tool, Macaron raises an exception instead of gracefully handling the unsupported tool.

Steps to Reproduce

run_macaron.sh analyze -purl pkg:maven/org.jetbrains.kotlin/kotlin-stdlib@1.9.25
run_macaron.sh gen-build-spec -purl pkg:maven/org.jetbrains.kotlin/kotlin-stdlib@1.9.25 --database output/macaron.db

Expected Behavior

Exit gracefully when build tool is not supported.

Actual Behavior

The resulting error traceback is as follows:

  File "/.venv/lib64/python3.12/site-packages/macaron/build_spec_generator/common_spec/core.py", line 384, in gen_generic_build_spec
    ECOSYSTEMS[purl.type.upper()].value(base_build_spec_dict).resolve_fields(purl)
  File "/.venv/lib64/python3.12/site-packages/macaron/build_spec_generator/common_spec/maven_spec.py", line 122, in resolve_fields
    patched_build_commands = patch_commands(
                             ^^^^^^^^^^^^^^^
  File "/.venv/lib64/python3.12/site-packages/macaron/build_spec_generator/build_command_patcher.py", line 164, in patch_commands
    patch_cli_commands = _patch_commands(
                         ^^^^^^^^^^^^^^^^
  File "/.venv/lib64/python3.12/site-packages/macaron/build_spec_generator/build_command_patcher.py", line 89, in _patch_commands
    if cli_parser.is_build_tool(cmds[0]):

Debug Information

Macaron 0.20.0

Activity

  1. added
    bug
    build_spec_generation
    on Feb 16, 2026
  2. self-assigned this
    on Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugbuild_spec_generation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions