Skip to content

sdkgen_rust: default output_dir writes OUTSIDE the project directory (<project>/../baml_sdk) #4376

Description

@BenSpex

With no output_dir set, the rust generator writes to <project>/../baml_sdk — a sibling of the project root, outside the project directory entirely.

For a repo-rooted BAML project (baml.toml at the repo root, baml_src/ beside it) that means baml generate creates a directory in the repo's parent — outside version control, outside the container build context, and in a shared checkout, potentially beside somebody else's project.

output_dir = "crates" works fine and is what we use, so this is a default-value report rather than a blocker.

Suggestion

Default to a path inside the project (e.g. ./baml_sdk). A generator writing outside its own project on the default path is surprising in a way that is easy to not notice: it succeeds, and the artifact is simply somewhere unexpected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions