0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MozillaBuild Packageを使うときはPATHからCygwinを外そう

Posted at

自分メモ

Windows用の MozillaBuild Package はMSYS2環境上に構築されており、環境変数PATHCygwin64が含まれていると問題が生じる。

例えば mozilla-builld/msys2/etc/bash.bashrc には下記の行がある。

if [[ -n "$(command -v getent)" ]] && id -G | grep -q "$(getent -w group 'S-1-16-12288' | cut -d: -f2)"

MSYS2にはgetentは存在しないので実行されず済むわけだが、PATHCygwin64が含まれていると、MSYS2上でCygwinのgetentが実行されてしまい、fatal errorとなる。

実害は無いけれども、エラーメッセージは見たくないので、下記の対策を取った。

*** mozilla-build/msys2/etc/profile.d/profile-mozilla.sh

  if test -n "$MOZILLABUILD"; then
    # $MOZILLABUILD should always be set by start-shell.bat.
    echo "MozillaBuild Install Directory: ${MOZILLABUILD}"
    mozillabuild_unix=$(cygpath -u "$MOZILLABUILD")
    mozillabuild_unix=${mozillabuild_unix%/} # Remove trailing slash
+   PATH=`echo -n $PATH | awk -v RS=: -v ORS=: '$0 !~ /.\/*[Cc]ygwin64/' | sed 's/:$//'` # Remove Cygwin64 from $PATH
    PATH="$mozillabuild_unix/bin:$mozillabuild_unix/kdiff3:$mozillabuild_unix/python3:$mozillabuild_unix/python3/Scripts:$PATH"
  

なお、このことは Matrix の Thunderbird Developers ルームで話したけれど、誰からもコメントはありませんでした :<

おまけ -- minttyではなくWindows Terminalを使う場合の例

{
    "commandline": "%SystemRoot%\\System32\\cmd.exe /c C:\\mozilla-build\\start-shell.bat -where %HOME%\\source\\mozilla",
    "hidden": false,
    "icon": "C:\\mozilla-build\\msys2\\msys2.ico",
    "name": "MozillaBuild",
    "startingDirectory": "%HOME%\\source\\mozilla",
    "tabTitle": "MozillaBuild"
},

%HOME%\\source\\mozillamozilla-central がチェックアウトされている想定です。

環境変数 USE_MINTTY の値を 0 とするのをお忘れなく。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?