C# setup loses evaluated or namespaced NoWarn suppressions
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 領域
- build-system, cli
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 335
- 分支
- 172
- 平均合併
- 6 小時 54 分鐘
- 30 天內合併 PR
- 37
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
QuantConnect/lean-cli 的其他 Issue
-
priority:P2
難度 2/5 1-3 小時 新手友好度 75/100
QuantConnect/lean-cli#792 ·
維護者通常 1 天內回覆
-
priority:P2
難度 2/5 1-3 小時 新手友好度 74/100
QuantConnect/lean-cli#786 ·
維護者通常 1 天內回覆
-
priority:P2
難度 2/5 1-3 小時 新手友好度 72/100
QuantConnect/lean-cli#785 ·
維護者通常 1 天內回覆
-
A partially written live command result aborts polling with JSONDecodeError可能已有人在做 @pcbeingused333 於 3 天前認領。 未關閉priority:P2
難度 2/5 1-3 小時 新手友好度 72/100
QuantConnect/lean-cli#784 ·
維護者通常 1 天內回覆
-
Container lookup failures during result polling are masked by UnboundLocalError可能已有人在做 @pcbeingused333 於 5 天前認領。 未關閉priority:P2
難度 2/5 1-3 小時 新手友好度 80/100
QuantConnect/lean-cli#783 ·
維護者通常 1 天內回覆
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
pimutils/vdirsyncer#1242 ·
-
backlog
難度 2/5 1-3 小時 新手友好度 78/100
sagemathinc/sagebrush#2768 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
vllm-project/vllm-ascend#23791 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
briandconnelly/context-audit#33 ·
維護者通常 1 天內回覆