C# setup loses evaluated or namespaced NoWarn suppressions
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Bereich
- build-system, cli
Rechercherichtung
Start in lean/components/docker/lean_runner.py at set_up_csharp_options and see how it collects NoWarn and merges it with the CLI's own suppressions. Build the three repro projects from the issue (conditional Debug/Release groups, an ExtraNoWarn property reference, and a namespaced Project element) and compare dotnet build -c Release against the command the CLI generates for each. Done means the generated command keeps the Release suppression, resolves property references, matches namespaced elements, and still includes the CLI's required codes.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
LeanRunner.set_up_csharp_options in lean/components/docker/lean_runner.py reads the first NoWarn XML element without evaluating MSBuild conditions or property references, then exports the resulting warning codes as a global property. Valid project suppressions can therefore disappear and make a warnings-as-errors build fail.
Reproduction
Use a C# SDK project with these properties:
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn Condition="'$(Configuration)' == 'Debug'">CS0618</NoWarn>
<NoWarn Condition="'$(Configuration)' == 'Release'">CS0168</NoWarn>
</PropertyGroup>
Include a method containing an unused local:
public void Example() { int unused; }
A normal dotnet build -c Release succeeds. The Release build command generated by set_up_csharp_options instead passes NoWarn=MSB3277%3BCS0618, overriding the Release suppression and failing with CS0168.
Two other forms reproduce the same loss of suppressions:
<ExtraNoWarn>CS0168</ExtraNoWarn><NoWarn>$(ExtraNoWarn);CS0618</NoWarn>: the generated property contains the literal tokenExtraNoWarnrather thanCS0168.- A project with
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"and<NoWarn>CS0168</NoWarn>: the unqualified element lookup misses the suppression.
Verified with .NET SDK 10.0.101: ordinary SDK builds succeed for all three cases, while commands generated by both master and the property-escaping change fail with CS0168. This is pre-existing and independent of property escaping.
Required result
Retain the project's effective warning suppressions for the selected build configuration, including evaluated property references and supported XML namespaces, while retaining the CLI's required suppressions. A literal, unconditional NoWarn in a non-namespaced project is a workaround for these cases.
- Vorherrschende Sprache
- Python
- Sterne
- 335
- Forks
- 172
- Ø Merge
- 6 Std. 54 Min.
- Gemergte PRs (30 T.)
- 37
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus QuantConnect/lean-cli
-
priority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
QuantConnect/lean-cli#792 ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
QuantConnect/lean-cli#786 ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
QuantConnect/lean-cli#785 ·
Maintainer antworten meist innerhalb von 1 Tag
-
A partially written live command result aborts polling with JSONDecodeErrorEvtl. vergeben @pcbeingused333 hat das vor 3 Tagen übernommen. Offenpriority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
QuantConnect/lean-cli#784 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Container lookup failures during result polling are masked by UnboundLocalErrorEvtl. vergeben @pcbeingused333 hat das vor 5 Tagen übernommen. Offenpriority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
QuantConnect/lean-cli#783 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in QuantConnect/lean-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Maintainer antworten meist innerhalb von 4 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
pimutils/vdirsyncer#1242 ·
-
backlog
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
sagemathinc/sagebrush#2768 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
vllm-project/vllm-ascend#23791 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
briandconnelly/context-audit#33 ·
Maintainer antworten meist innerhalb von 1 Tag