microsoft / microsoft/component-detection
There is a bug when the tool calls Rust's Cargo Metadata command and there is a space in the path
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 553
- Forks
- 135
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 6
Description
The command I run
. "${Env:RUNNER_TEMP}\sbom-tool.exe" generate -b $MSIXBundleOutput -bc .\ -pn 'AppControl Manager' -ps 'Violet Hansen' -pv $MSIXVersion -nsb 'https://github.com/HotCakeX/Harden-Windows-Security' -V Verbose -gt true -li true -pm true -D true -lto 80
This is one of the workflows where i run that command.
Errors i get which show how the tool is failing when the path contains spaces:
2025-08-29T14:04:51.4800783Z ##[warning]`cargo metadata` failed while processing "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\Cargo.toml". with error: "error: unexpected argument 'Manager\\Cargo.toml' found\n\nUsage: cargo.exe metadata [OPTIONS]\n\nFor more information, try '--help'.\n"
2025-08-29T14:04:51.4839645Z ##[warning]Falling back to cargo.lock processing using "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\Cargo.lock"
2025-08-29T14:04:51.5612294Z ##[information]Discovered Cargo.toml: "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\dism_capabilities\\Cargo.toml"
2025-08-29T14:04:51.6568160Z ##[warning]`cargo metadata` failed while processing "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\dism_capabilities\\Cargo.toml". with error: "error: unexpected argument 'Manager\\eXclude\\dism_capabilities\\Cargo.toml' found\n\nUsage: cargo.exe metadata [OPTIONS]\n\nFor more information, try '--help'.\n"
2025-08-29T14:04:51.6572227Z ##[warning]Fallback failed, could not find Cargo.lock file for "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\dism_capabilities\\Cargo.toml", skipping processing
2025-08-29T14:04:51.6574146Z ##[information]Discovered Cargo.toml: "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\exploit_mitigations\\Cargo.toml"
2025-08-29T14:04:51.8186319Z ##[warning]`cargo metadata` failed while processing "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\exploit_mitigations\\Cargo.toml". with error: "error: unexpected argument 'Manager\\eXclude\\exploit_mitigations\\Cargo.toml' found\n\nUsage: cargo.exe metadata [OPTIONS]\n\nFor more information, try '--help'.\n"
2025-08-29T14:04:51.8190265Z ##[warning]Fallback failed, could not find Cargo.lock file for "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\exploit_mitigations\\Cargo.toml", skipping processing
2025-08-29T14:04:51.8193441Z ##[information]Discovered Cargo.toml: "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\group_policy\\Cargo.toml"
2025-08-29T14:04:51.9118279Z ##[warning]`cargo metadata` failed while processing "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\group_policy\\Cargo.toml". with error: "error: unexpected argument 'Manager\\eXclude\\group_policy\\Cargo.toml' found\n\nUsage: cargo.exe metadata [OPTIONS]\n\nFor more information, try '--help'.\n"
2025-08-29T14:04:51.9123667Z ##[warning]Fallback failed, could not find Cargo.lock file for "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\group_policy\\Cargo.toml", skipping processing
2025-08-29T14:04:51.9126362Z ##[information]Discovered Cargo.toml: "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\ResourceValidator\\Cargo.toml"
2025-08-29T14:04:53.5426804Z ##[warning]`cargo metadata` failed while processing "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\ResourceValidator\\Cargo.toml". with error: "error: unexpected argument 'Manager\\eXclude\\ResourceValidator\\Cargo.toml' found\n\nUsage: cargo.exe metadata [OPTIONS]\n\nFor more information, try '--help'.\n"
2025-08-29T14:04:53.5432125Z ##[warning]Fallback failed, could not find Cargo.lock file for "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\ResourceValidator\\Cargo.toml", skipping processing
2025-08-29T14:04:53.5435228Z ##[information]Discovered Cargo.toml: "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\Rust Interop Library\\Cargo.toml"
2025-08-29T14:04:54.4845074Z ##[warning]`cargo metadata` failed while processing "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\Rust Interop Library\\Cargo.toml". with error: "error: unexpected argument 'Manager\\eXclude\\Rust' found\n\nUsage: cargo.exe metadata [OPTIONS]\n\nFor more information, try '--help'.\n"
2025-08-29T14:04:54.4850964Z ##[warning]Fallback failed, could not find Cargo.lock file for "D:\\a\\Harden-Windows-Security\\Harden-Windows-Security\\AppControl Manager\\eXclude\\Rust Interop Library\\Cargo.toml", skipping processing
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported command from the linked GitHub Actions workflow with a checkout path containing spaces. Trace the component-detection path that invokes Cargo Metadata for the listed Cargo.toml files, then verify that metadata processing succeeds for paths such as AppControl Manager\eXclude\Rust Interop Library\Cargo.toml without triggering the fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100