C# host paths containing a comma fail the compiler's PathMap parsing

オープン 初心者向け
#778 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, python
領域
build-system, cli

調査の方向性

LeanRunner.set_up_csharp_options から始めます。場所は lean/components/docker/lean_runner.py で、ここで PathMap の値がホストのコンパイルルートから組み立てられます。MSBuild がその値を受け取る方法を読み、dotnet build Lib.csproj "-p:PathMap=/src=/work/a%2Cb" またはカンマを含むパスにあるプロジェクトで再現してください。変更内容は、PathMap 文字列を構築する前に、ホストパス内のコンパイラのマッピング区切り文字をエスケープすることです。完了とは、/work/a,b/Algorithm の下にある C# プロジェクトがビルドされ、PathMap が /LeanCLI をその正確なパスにマップすることです。

索引モデルが issue の本文から書いたものです。

説明

priority:P2

Problem

LeanRunner.set_up_csharp_options (lean/components/docker/lean_runner.py) sets the MSBuild property PathMap=/LeanCLI=<host compile root>. MSBuild hands it to the C# compiler as /pathmap:. The compiler splits that option's value into mappings on , (and each mapping on =), and reads a literal comma only when it is doubled (,,). A host path with a comma, such as /work/a,b/Algorithm, is therefore not a valid pathmap.

Reproduction

With https://github.com/QuantConnect/lean-cli/pull/777 applied (which escapes the value for MSBuild), put a C# project under /work/a,b/Algorithm and run lean backtest on it. Or build any SDK project directly:

dotnet build Lib.csproj "-p:PathMap=/src=/work/a%2Cb"

The build fails with CSC : error CS8101: The pathmap option was incorrectly formatted. Without that pull request, MSBuild already rejects the same path earlier (MSB1006), so these paths have never built.

Required result

A C# project whose host compile root contains a comma builds, and its PathMap maps /LeanCLI to that exact path. Suggestion: double the compiler's separators in the host path before it goes into the PathMap value.

主要言語
Python
スター
335
フォーク
172
平均マージ
6時間 54分
マージ済み PR(30日)
37

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QuantConnect/lean-cli のほかの issue

QuantConnect/lean-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。