xtask test-csharp: source mapping verification fails when nuget.org is unreachable
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 346
- Forks
- 75
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 15
Description
Problem
The source mapping verification in cargo xtask test-csharp (in xtask/src/tasks/bindings/csharp.rs) expects dotnet restore to fail with NU1101 (package not found) to confirm that Microsoft.Regorus cannot be resolved from external sources via package source mapping.
However, in environments where api.nuget.org is unreachable (e.g., air-gapped CI, restricted networks, corporate proxies), the restore fails with NU1301 (unable to load service index) instead. The verification then treats this as an unexpected failure and aborts.
Expected Behavior
The verification should handle the case where the external source is unreachable. Possible approaches:
- Accept
NU1301as evidence that external resolution is blocked (though this is weaker — it proves unreachability, not that source mapping works). - Add a CLI flag or environment variable (e.g.,
--skip-source-mapping-verifyorREGORUS_SKIP_SOURCE_MAPPING_VERIFY) to allow skipping the verification in environments where it cannot succeed. - Allow the nuget.org URL in
bindings/csharp/nuget.configto be overridden (e.g., via an environment variable or additional CLI option) so users can point it at a reachable mirror.
Reproduction
Run cargo xtask test-csharp --release --nuget-dir <dir> in an environment where https://api.nuget.org/v3/index.json is not accessible.
Relevant Code
xtask/src/tasks/bindings/csharp.rs, lines 506–514:
// Ensure the failure is specifically NU1101 for Microsoft.Regorus, not an
// unrelated error (e.g. network outage).
"Source mapping verification failed: dotnet restore failed, but not for the \
expected reason. Expected NU1101 for Microsoft.Regorus to confirm external \
resolution is blocked.\nstdout:\n{stdout}\nstderr:\n{stderr}"
));
}
Contributor guide
No contributing guide indexed for this repository
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 in xtask/src/tasks/bindings/csharp.rs around lines 506–514 and reproduce with cargo xtask test-csharp --release --nuget-dir
while api.nuget.org is unreachable. Read bindings/csharp/nuget.config and the existing NU1101 validation to understand the available handling options. Done means the verification behaves as documented in restricted-network environments without masking unrelated restore failures.Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, rust
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100