Build.distでビルドできなかったのでプルリクを作成した

背景

2023/06時点、ラズパイ上でのGentooが起動するGenPi64をゼロからイメージ作成するBuild.Distはイメージ作成に失敗する。

私が成功するまで3つ程、ハードルがあったのでプルリクを作成したい。 その時のメモ。

原因

parsers/rawcommand/rawcommand、シェルのヒアドキュメントの箇所で、本来、タブであるべき所が空白になってしまっている。

画面上は分かりにくいがgit pullすると確認できる。 また全てのシェルスクリプトがNGという訳ではなく、他のシェルスクリプトはタブになっていた。

この問題に起因すると思われるイシュー

issueで挙がってないか確認

過去の経緯を軽く確認

https://raw.githubusercontent.com/GenPi64/Build.Dist/master/parsers/rawcommand/rawcommand 空白かもしれない。タブの方が良い。

下記のコミットで入った模様 https://github.com/GenPi64/Build.Dist/commit/cb0d1350503827f5099c5998e24edd65f341121f

Jul 22, 2022 2022/07/22 から。

gitで core.whitespace の設定が入っていないだろうか?

既に近いプルリクがある

Jan 14 2023 poole by jlpoolen · Pull Request #185 · GenPi64/Build.Dist

そのコメントで causes the written file to have all leading whitespace omitted. This change shouldn’t be necessary.と答えてる方がいる。

cat <<- EOF > filename
causes the written file to have all leading whitespace omitted.
This change shouldn't be necessary.
https://linuxize.com/post/bash-heredoc/

いや、bashのヒアドキュメントの場合、タブは削除されるけど、空白は削除されないような… 参照先リンクを見てみる。

Appending a minus sign to the redirection operator <<-,
will cause all leading tab characters to be ignored.
This allows you to use indentation when writing here-documents in shell scripts.
Leading whitespace characters are not allowed, only tab.

エディタ上で空白とタブが見分けが付きにくいからなぁ。 あとプルリク側も空白を全て消すのではなく、タブだったらな、とも思う。

一旦、コメントを残す。

時間がたったプルリクへのコメントで申し訳ない。 このファイルの問題かと思って、このコメントに辿り着きました。 参考のURL( https://linuxize.com/post/bash-heredoc/ )のコメントを見ると下記のように書いてありました。

Appending a minus sign to the redirection operator <<-,
will cause all leading tab characters to be ignored.
This allows you to use indentation when writing here-documents in shell scripts.
Leading whitespace characters are not allowed, only tab.

この記述方法はタブは消してくれるのですが、スペースは消してくれないようです。 ただしタブは消してくれます。 例えば他のヒアドキュメント、例えば Build.Dist/parsers/emerge/emerge はタブです。

私にはコミットでは空白を全て消しているように見えました。 ですがタブに変更する事で動作もできます。

英文で一旦コメントした

プルリク出した

change white space to tabs by exampleuser · Pull Request #205 · GenPi64/Build.Dist