xtask test-csharp: source mapping verification fails when nuget.org is unreachable

Abierto
#714 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
csharp, rust

Línea de trabajo

Comienza en xtask/src/tasks/bindings/csharp.rs alrededor de las líneas 506–514 y reprodúcelo con cargo xtask test-csharp --release --nuget-dir

mientras api.nuget.org no sea accesible. Lee bindings/csharp/nuget.config y la validación NU1101 existente para comprender las opciones de manejo disponibles. Se considera completado cuando la verificación se comporte como está documentado en entornos con red restringida, sin ocultar fallos de restore no relacionados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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:

  1. Accept NU1301 as evidence that external resolution is blocked (though this is weaker — it proves unreachability, not that source mapping works).
  2. 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.
  3. 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}"
    ));
}
Lenguaje dominante
Rust
Estrellas
375
Forks
81
Merge medio
1 d 11 h
PR fusionados (30 d)
78

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

  • Sin Dockerfile ni archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/regorus

Todos los issues de microsoft/regorus

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.