oracle/graal · error · RuntimeError

Native Image benchmarks do not support additional options, b

Error message

Native Image benchmarks do not support additional options, besides the file name, with --bundle-create: {arg}

What it means

Raised while scanning extra image build arguments for --bundle-create: the value after --bundle-create= may only be a bundle file name, not a comma-separated option list. A comma in the bundle spec means someone tried to pass extra bundle options (e.g. '...nib,--compress') which the benchmark harness cannot support, so it fails fast with RuntimeError.

Source

Thrown at sdk/mx.sdk/mx_sdk_benchmark.py:543

            mx.copyfile(cached_bundle_path, bundle_copy_path)
            return bundle_copy_path

        return None

    def get_bundle_create_path_if_present(self) -> Path | None:
        """
        Scans the image build arguments and looks for ``--bundle-create``

        :return: Absolute path of the bundle's ``.output`` directory if ``--bundle-create`` was given, otherwise ``None``
        """
        bundle_create_arg = "--bundle-create="

        for arg in self.extra_image_build_arguments:
            if arg.startswith(bundle_create_arg):
                bundle_spec = arg[len(bundle_create_arg):]

                if "," in bundle_spec:
                    raise RuntimeError(
                        f"Native Image benchmarks do not support additional options, besides the file name, with --bundle-create: {arg}")

                assert bundle_spec.endswith(
                    BUNDLE_EXTENSION), f"--bundle-create path must end with {BUNDLE_EXTENSION}, was {bundle_spec}"
                bundle_path = Path(bundle_spec[:-len(BUNDLE_EXTENSION)] + ".output")

                return bundle_path.absolute()
            elif arg == "--bundle-create":
                return self.output_dir / f"{self.final_image_name}.output"

        return None


class BenchOutStream:
    """
    Writes incoming data to both the given text file and callable output stream.

    Is callable itself and can also be passed to the ``print`` function.

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Remove everything after the comma: pass only the bundle path, e.g. --bundle-create=/path/mybench.nib.
  2. Put other native-image options as separate entries in extra_image_build_arguments, not inside --bundle-create.
  3. Keep the .nib extension — a follow-up assert requires it.

Example fix

# before
extra_image_build_arguments=['--bundle-create=/tmp/b.nib,--create-sbom']

# after
extra_image_build_arguments=['--bundle-create=/tmp/b.nib', '--create-sbom']
Defensive patterns

Strategy: validation

Validate before calling

bundle_args = [a for a in extra_image_build_arguments if a.startswith('--bundle-create=')]
for a in bundle_args:
    spec = a.split('=', 1)[1]
    assert ',' not in spec, f'options not allowed in --bundle-create: {a}'
    assert spec.endswith('.nib'), f'bundle must end with .nib: {spec}'

Try / catch

try/except RuntimeError around the benchmark launch; on this message, strip the comma-suffix from --bundle-create and retry once.

Prevention

When it happens

Trigger: Running a native-image benchmark with extra_image_build_arguments containing e.g. '--bundle-create=/tmp/b.bundles/mybench.nib,overwrite' — any ',' after the '=' triggers it during get_image_output_dir / bundle scanning.

Common situations: Copy-pasting a --bundle-create invocation from native-image docs (where comma-separated bundle options are legal) into mx benchmark extra args; CI configs that bundle images for later replay.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/3cee910f192addab. Report an issue: GitHub.