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
NU1301 as 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-verify or REGORUS_SKIP_SOURCE_MAPPING_VERIFY) to allow skipping the verification in environments where it cannot succeed.
- Allow the nuget.org URL in
bindings/csharp/nuget.config to 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}"
));
}
Problem
The source mapping verification in
cargo xtask test-csharp(inxtask/src/tasks/bindings/csharp.rs) expectsdotnet restoreto fail withNU1101(package not found) to confirm thatMicrosoft.Regoruscannot be resolved from external sources via package source mapping.However, in environments where
api.nuget.orgis unreachable (e.g., air-gapped CI, restricted networks, corporate proxies), the restore fails withNU1301(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:
NU1301as evidence that external resolution is blocked (though this is weaker — it proves unreachability, not that source mapping works).--skip-source-mapping-verifyorREGORUS_SKIP_SOURCE_MAPPING_VERIFY) to allow skipping the verification in environments where it cannot succeed.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 wherehttps://api.nuget.org/v3/index.jsonis not accessible.Relevant Code
xtask/src/tasks/bindings/csharp.rs, lines 506–514: