Skip to content

[bug] Unable to pass multiple values to the --bundles option when using the tauri build command #4231

@rnza0u

Description

@rnza0u

Describe the bug

Hi everyone .

I'm having an issue while trying to generate different bundle types for Linux (deb and appimage).

This command works fine and generates an AppImage bundle:

tauri build --bundles appimage --target x86_64-unknown-linux-gnu

This command also works fine and generates a .deb bundle:

tauri build --bundles deb --target x86_64-unknown-linux-gnu

The bundles option should be able to take multiple parameters, as says the documentation. But when i try this command:

tauri build --bundles appimage deb --target x86_64-unknown-linux-gnu

It fails with the following error:

error: Found argument 'deb' which wasn't expected, or isn't valid in this context

Also tried with:

tauri build --bundles appimage --bundles deb --target x86_64-unknown-linux-gnu

This time it worked, but it only generated an appimage bundle, the second occurrence of the --bundles option was apparently silently ignored.

After looking at the source code, it seems that the error originates from the Clap arguments parser.

The bundles member of the Clap derived struct apparently has a correct type (Option<Vec<String>>) but Clap does not want to parse more than one value and consider it as an error.

NOTE: this problem might affect other options when using the CLI, not only this one.

Thanks !

Reproduction

Launch the tauri build command with multiple values for the --bundles option.

Expected behavior

It should generate bundles based on each value provided with the --bundles option.

Platform and versions

Using CLI version 1.0.0-rc.10 on Linux.

Stack trace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions