Cargo profiles, outside build-script inputs, and tighter package bounds
Cargo workspaces imported without configuration now build closer to Cargo:
- The
devprofile, and thetestprofile for test targets, apply from the root manifest and Cargo configuration, including per-package overrides,package."*", andbuild-override. A package withopt-level = 3compiles optimized, its build script seesOPT_LEVEL=3, and procedural macros stay unoptimized as in Cargo. - A workspace member's build script can read files outside its package
through
build_script_dataoncargo_workspace. A change to one reruns the script. A script that names an untracked path withrerun-if-changedfails and prints thestruo.tomlto add, instead of caching output that could go stale. - A package no longer includes the local packages nested inside it, its
targetdirectory, or, at the workspace root,.git. Runningcargo buildnext to Struo keeps the cache warm, andstruo query affected-testsmaps root files to the root package's tests. - Build scripts that depend on
cc,cmake, orautotoolsreceiveNUM_JOBS=4and reserve four CPU slots, so native builds such asprotobuf-srccompile in parallel.build_script_jobschanges the count. - Integration tests link to their package's binaries instead of copying them, and each test binary is stored once.
.struo/writes its own.gitignore.
See the Rust guide. The Getting Started guide now has a section on building Struo from source.