`skip android build`: `--show-bin-path` result read from merged stdout+stderr, so a SwiftPM deprecation warning can be used as the bin path
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- android, swift
- 領域
- build-system
調査の方向性
skipstone/Sources/SkipBuild/Commands/AndroidCommand.swiftでbinPathCmdの検索箇所と、AndroidTestCommand.swiftのcaptureLineヘルパーの周辺を読みます。--show-bin-pathの呼び出しでlaunchToolがstderrをどう扱うかを追い、SwiftPMの非推奨警告が出ている状態で、該当するAndroidのビルドまたはテストのフローを実行します。binパスがstdoutから取得され、警告によってビルドが無効な出力ディレクトリを使うことがなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
skip android build (via the Gradle buildAndroidSwiftPackage… step) determines the .so output directory by running swift build --show-bin-path … --build-system native and taking the last non-empty line of the output. That output is read through launchTool(...), which defaults to includeStdErr: true, so stdout and stderr are merged.
SwiftPM prints a deprecation warning on stderr for --build-system native:
warning: '--build-system native' has been deprecated and will be removed in a future release; please report an issue at https://github.com/swiftlang/swift-package-manager/issues if you are unable to adopt the default build system.
When that stderr line happens to arrive after the stdout path line, lines.last is the warning sentence, Skip uses it as buildOutputFolder, and the build then fails trying to open it (NSCocoaErrorDomain Code=260, file not found). It is an ordering race: the same commit passes and fails on consecutive runs with the same warning present.
Where
skipstone/Sources/SkipBuild/Commands/AndroidCommand.swift(~L986–1016 onmain@ 1.9.21):binPathCmd→launchTool(swiftCmd, arguments:…, env:)→binPath = lines.last.skipstone/Sources/SkipBuild/Commands/AndroidTestCommand.swift:captureLine(...)is documented as "the last non-empty stdout line" but also callslaunchToolwith the defaultincludeStdErr: true; it is used for--show-bin-path(harness and--build-tests).
The --show-bin-path lookup was introduced in skiptools/skipstone#245 (swiftbuild support). The stdout/stderr output shape of --show-bin-path with --build-system native is visible in swiftlang/swift-build#1363.
Versions
- Skip 1.9.8 (Homebrew, invoked by Gradle) and 1.9.12 (Package.resolved), macOS, Skip Fuse app.
- The code is unchanged on
mainat 1.9.21 (3dfa66f).
Suggested fix
- Pass
includeStdErr: falsefor the--show-bin-pathinvocations (and incaptureLine), and/or - pick the last line that is an absolute path to an existing directory instead of
lines.last.
Workaround we use
Retry the Gradle assemble once when the log contains both Code=260 and adopt the default build system.
- 主要言語
- Swift
- スター
- 3.3k
- フォーク
- 115
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
skiptools/skip のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement project
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
skiptools/skip#673 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
fxios-coreexperience
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mozilla-mobile/firefox-ios#36661 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
manaflow-ai/cmux#45713 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
playback
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信