Repository navigation
Conversation
…helpers Parses Cargo.lock v3/v4 (TOML), enumerates workspace members from Cargo.toml, and derives per-member dependency kinds, feeding the lockfile-vs-metadata source decision.
Single crate, virtual workspace, and members+default-members enumeration over fixtures, registered in the unit-tests suite.
The primed variant is needed by the Cargo strategy's lockfile-first read path.
Prefer a present, parsable Cargo.lock over cargo metadata for full analysis, and require it for static analysis (with explicit fatals), keeping cargo metadata as the dynamic fallback.
Complete LockfileSpec (dependency-kind analysis, source decision, golden conversions) plus dynamic-mode analysis wiring specs, with their fixtures and test-suite registration.
analyzeProjectStaticOnly produces real results from a parsable Cargo.lock and fatals with distinct diagnostics for missing/unparseable lockfiles.
…llback suite Integration fixtures run against local workspaces; the new suite covers the cargo-metadata fallback when Cargo.lock is absent.
…naryAnalysis field origin/master added a 4th field (enableGoBinaryAnalysis) to StrategyConfig after this feature branched, leaving the static-analysis test harness using the stale 3-arg positional constructor. Add the field (False: Go-binary analysis is irrelevant to Cargo static analysis and opt-in) so unit-tests compiles. Part of the Cargo.lock-first feature.
…static path, fallback test coverage
Conflict: Strategy.Cargo export list — keep the branch's submodule re-export structure, add master's discoverVisitor. Also drop an unused Data.Bifunctor import and an unshadowed 'min' binding in Strategy.Cargo.Lock surfaced by the rebuild.
…ease mismatch in lockfile kind matching
…ree members in lockfile analysis
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.
Summary
fossa analyzefor Rust workspaces now prefers parsingCargo.lockdirectly over shelling out tocargo metadata, falling back to the metadata path when the lockfile is missing or unparseable. This removes a Rust-toolchain dependency from the common case and makes results reflect exactly what is pinned.How it works
Strategy.Cargo.Lock): for each workspace member manifest found via the shared walk, decide between the lockfile andcargo metadata— lockfile when present and parseable, metadata otherwise (missing/unparseable lock, or analysis needs the toolchain). One warning surfaces the fallback reason.parseCargoLock(v3/v4) → member enumeration →analyzeManifests(kinds from each member's[dependencies]/[build-dependencies]/[dev-dependencies], incl.workspace = trueinheritance) →lockfileToMetadata, which produces the sameCargoMetadatashape the existing graph builder consumes.0.12prod +0.11build) now labels each lockfile entry by the requirement that matches the resolved version (Cargo caret/tilde/comparator semantics), falling back to the union when no requirement matches (drifted lockfile).dependenciesentries that reference a package absent from the lockfile are omitted with a warning instead of producing a phantom vertex.useGitBackedCargoLocatorsfromStrategyConfigon both dynamic and static-only paths.analyze/buildGraphand the metadata path are untouched;Strategy.Cargore-exports keep the old API surface.Known gaps (documented, follow-ups)
excludeand out-of-tree member paths are not honored by the lockfile walk.Testing
disambig,compat_unify,drifted,versionlessfixtures), static-only wiring.cabal buildclean; fourmolu/hlint clean.