rake -P output is ambiguous with prereq namespaces
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- ruby
- 領域
- build-system, cli
調査の方向性
rake -P/--prereqs の出力エントリポイントから開始し、issue に示されている Rakefile を再現します。tool:run と tool:run2 の namespaced prerequisite がどのように解決されるかを追跡し、その後、両方について表示される prerequisite が完全修飾され、曖昧でないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
When tasks are in a namespace, their pre-reqs "inherit" the namespace prefix.
Given the following rakefile:
task :setup do
puts "global setup, oops"
end
namespace :tool do
task :setup do
puts "setting up"
end
task run: :setup do
puts "running"
end
task run2: 'tool:setup' do
puts "running a second way"
end
end
The both tasks run and run2 have the same pre-req (setup). However, task run omits the namespace, while run2 is explicit with its pre-req's namespace. Both forms work as expected:
$ rake tool:run
setting up
running
$ rake tool:run2
setting up
running a second way
However, when the pre-req tree is printed, rake is not clear about what the pre-reqs' full names are.
$ rake -P
rake setup
rake tool:run
setup # <--- This is ambiguous!
rake tool:run2
tool:setup
rake tool:setup
The expectation is that rake -P prints the "fully resolved" pre-reqs and is thus clear about what task will actually be run. In the example above, it is not clear what tool:run's pre-req is. Is it the "global" setup, task as it appears in the -P output? Or is it in fact tool:setup because it is namespaced?
To be clear, rake's invocation behavior matches my expectations: tool:run invokes tool:setup, not setup. But this behavior is not evident in rake's --prereqs output.
- 主要言語
- Ruby
- スター
- 2.5k
- フォーク
- 650
- 平均マージ
- 6分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/rake のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
palladius/rails8-app-on-gcp#145 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
rubocop/rubocop-rspec#2236 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
riscv/riscv-unified-db#2624 · リアクション 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100