Repository navigation
Add Rust foundation template with library and CLI - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Foundry now generates a Rust application with
--template rust(alsorsorrust-foundations). It ships as directly embedded source files, is available in the interactive menu and registry, records Rust project metadata, and prints Cargo startup instructions without invoking Cargo automatically.The Rust 2024 foundation has a thin binary, reusable library, feature-owned domain/service modules, typed validation and I/O errors, an injected output writer, and an executable greeting example. It includes unit, binary integration, and documentation tests, a committed Cargo lockfile, a stable toolchain configuration with rustfmt/Clippy, and a
cargo lintalias. Unsafe code is forbidden; the initial project has no third-party dependencies and builds offline after the Rust toolchain is installed. The documented minimum compiler is Rust 1.85.Generation substitutes crate names in Rust source, Cargo manifests/lockfiles, tests, and docs. Reserved names and digit-leading names receive an
app_prefix so generated library imports and binary names remain valid. Rust/Cargo are included indoctor, and the README documents the module boundaries and extension points.Validation:
make check smoke: formatting, all Foundry tests, vet, binary build, and existing generation/add smoke checks passed.typecompiled and passed all tests asapp_type../scripts/build-release.sh ci: all six Foundry release targets passed.git diff --checkpassed.