Closed Bug 1813358 Opened 3 years ago Closed 3 years ago

./mach build fails when running against a repo cloned with a customized SSH domain

Categories

(Firefox Build System :: General, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1793219

People

(Reporter: laonawuli, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Steps to reproduce:

  1. Set up a customized hostname in ~/.ssh/config file, e.g.:
    Host github.com-personal
    AddKeysToAgent yes
    UseKeychain yes
    HostName github.com
    User git
    IdentityFile ~/.ssh/personal.github.key.private

  2. run git clone git@github.com-personal:mozilla/gecko-dev.git # note: the domain name is the hostname inside the SSH config

  3. run rm -rf ~/.mozbuild # clean up the existing build states to get the bug reproduced

  4. run cd gecko-dev

  5. run ./mach bootstrap

  6. run ./mach build

Actual results:

The build failed with the following output:

xkdfdf3@V3PG406J97 ~/f/gecko-dev (master)> ./mach build
0:00.35 Clobber not needed.
Config object not found by mach.
0:00.45 Using Python 3.10.8 from /Users/xkdfdf3/firefox-dev/gecko-dev/obj-aarch64-apple-darwin22.2.0/_virtualenvs/build/bin/python
0:00.45 checking for vcs source checkout... git
0:00.47 checking for a shell... /bin/sh
0:00.51 checking for host system type... aarch64-apple-darwin22.2.0
0:00.51 checking for target system type... aarch64-apple-darwin22.2.0
0:00.70 checking whether cross compiling... no
0:00.80 checking for Python 3... /Users/xkdfdf3/firefox-dev/gecko-dev/obj-aarch64-apple-darwin22.2.0/_virtualenvs/build/bin/python (3.10.8)
0:00.80 checking for git... /opt/homebrew/bin/git
0:00.81 checking for Git version... 2.38.1
0:00.81 checking for sparse checkout... no
0:01.01 WARNING: Unsupported platform. Got: ('hgmo', <mozilla_repo_urls.platforms.hgmo.HgmoPlatform object at 0x105600b50>). Expected: ('hgmo', 'github'). URL: git@github.com-personal:JBrVJxsc/gecko-dev.git
0:01.01 checking for wget... /opt/homebrew/bin/wget
0:01.02 checking for ccache... not found
0:01.02 Using target sysroot in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk
0:01.02 Using host sysroot in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk
0:01.03 checking for the target C compiler... /usr/bin/clang
0:02.91 checking whether the target C compiler can be used... yes
0:02.91 checking the target C compiler version... 14.0.0
0:02.95 checking the target C compiler works... yes
0:02.95 checking for the target C++ compiler... /usr/bin/clang++
0:03.02 checking whether the target C++ compiler can be used... yes
0:03.02 checking the target C++ compiler version... 14.0.0
0:03.06 checking the target C++ compiler works... yes
0:03.06 checking for the host C compiler... /usr/bin/clang
0:03.13 checking whether the host C compiler can be used... yes
0:03.13 checking the host C compiler version... 14.0.0
0:03.17 checking the host C compiler works... yes
0:03.17 checking for the host C++ compiler... /usr/bin/clang++
0:03.23 checking whether the host C++ compiler can be used... yes
0:03.23 checking the host C++ compiler version... 14.0.0
0:03.27 checking the host C++ compiler works... yes
0:03.50 checking for target linker...
0:03.50 DEBUG: Executing: /usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk -mmacosx-version-min=10.12 -Qunused-arguments -std=gnu99 --target=arm64-apple-darwin -Wl,--version
0:03.50 DEBUG: Executing: /usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk -mmacosx-version-min=10.12 -Qunused-arguments -std=gnu99 --target=arm64-apple-darwin -fuse-ld=lld -Wl,--version
0:03.50 ERROR: Failed to find an adequate linker
*** Fix above errors and then restart with "./mach build"

Expected results:

  1. ./mach build should build the source code successfully;
  2. The "Got: ('hgmo', <mozilla_repo_urls.platforms.hgmo.HgmoPlatform object at 0x105600b50>)." part inside the unsupported platform warning is incorrect, it should be the platform unsupported instead of a list of platform being supported.

Feel free to assign the issue to me and I'm working on a fix. Thanks.

I changed the line 25 in third_party/python/mozilla_repo_urls/mozilla_repo_urls/parser.py to raise UnsupportedPlatformError(url_string, parsed_url.platform, _SUPPORTED_PLAFORMS) and it shows the warning message properly now: Unsupported platform. Got: gitlab. So it seems like the giturlparse package thinks the git@github.com-personal:JBrVJxsc/gecko-dev.git is a gitlab URL, I've filed an issue there: https://github.com/nephila/giturlparse/issues/47.

If the maintainer of giturlparse package is not active, we might need to fix it at Firefox end just like the issue here: https://github.com/nephila/giturlparse/issues/43

It looks like the error message issue has been fixed here: https://github.com/mozilla-releng/mozilla-repo-urls/commit/c60cc79ddba99c8e875c60f499e21a15ec5b2601

and also it seems like the bug is inside the mozilla-repo-urls package. I've filed a bug report there: https://github.com/mozilla-releng/mozilla-repo-urls/issues/17

Closing this bug report now.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Duplicate of bug: 1793219
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.