Open Bug 1618758 Opened 6 years ago Updated 3 years ago

checking for the target C compiler... not found

Categories

(Firefox Build System :: General, defect, P3)

75 Branch
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: miguelp12, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4068.5 Safari/537.36

Steps to reproduce:

I used the latest version of Mozilla-builder
and download the Mozilla source - desktop.
after that, I run ./mach bootstrap and ./mach build.
But I face the issues.
I am working on windows 10

Actual results:

Steps to reproduce:

i was trying to build firefox using: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites
when i reached to the ./mach build i faced the issue below

Actual results:

$ ./mach build
 0:04.13 Clobber not needed.
 0:04.16 Adding make options from None
    MOZ_OBJDIR=c:/mozilla-source/mozilla-central/obj-i686-pc-mi
    OBJDIR=c:/mozilla-source/mozilla-central/obj-i686-pc-mingw3
 0:04.39 c:\mozilla-build\mozmake\mozmake.EXE -f client.mk -s c
 0:05.19 cd c:/mozilla-source/mozilla-central/obj-i686-pc-mingw
 0:05.31 c:/mozilla-source/mozilla-central/configure
 0:06.88 Reexecuting in the virtualenv
 0:07.51 checking for vcs source checkout... hg
 0:08.13 checking for a shell... C:/mozilla-build/msys/bin/sh.e
 0:10.65 checking for host system type... i686-pc-mingw32
 0:10.65 checking for target system type... i686-pc-mingw32
 0:10.78 checking for a shell... C:/mozilla-build/msys/bin/sh.e
 0:12.81 checking for host system type... i686-pc-mingw32
 0:12.81 checking for target system type... i686-pc-mingw32
 0:13.09 checking for vcs source checkout... hg
 0:13.09 checking whether cross compiling... no
 0:13.35 checking for the target C compiler... not found
 0:13.38 DEBUG: _cc: Trying cl
 0:13.38 DEBUG: _cc: Trying clang-cl
 0:13.38 DEBUG: _cc: Trying gcc
 0:13.38 DEBUG: _cc: Trying clang
 0:13.38 ERROR: Cannot find the target C compiler
 0:14.30 *** Fix above errors and then restart with\
 0:14.30                "c:/mozilla-build/mozmake/mozmake.EXE -

Expected results:

There is something wrong with the current version build on windows 10?
Thank you.

If you re-run ./mach bootstrap, does it successfully install clang, and if so, where?

Group: firefox-core-security
Component: Untriaged → General
Flags: needinfo?(miguelp12)
Product: Firefox → Firefox Build System

Hi Gijs. Thank you for your reply.

This is the result when I used ./mach bootstrap

`0 files updated, 0 files merged, 0 files removed, 0 files unresolved

This wizard will guide you through configuring Mercurial for an optimal
experience contributing to Mozilla projects.

The wizard makes no changes without your permission.

To begin, press the enter/return key.

Will you be submitting commits to Mozilla (Yn)? y
Commits to Mozilla projects are typically sent to Phabricator. This is the
preferred code review tool at Mozilla.
Phabricator installation instructions are here
http://moz-conduit.readthedocs.io/en/latest/phabricator-user.html

If you would like to clone the mozilla-unified Mercurial repository, please
enter the destination path below.

Destination directory for Mercurial clone (leave empty to not clone):

Source code can be obtained by running

hg clone https://hg.mozilla.org/mozilla-unified

Or, if you prefer Git, by following the instruction here to clone from the
Mercurial repository:

https://github.com/glandium/git-cinnabar/wiki/Mozilla:-A-git-workflow-for-Gecko-development

Installing Stylo and NodeJS packages requires a checkout of mozilla-central
(or mozilla-unified). Once you have such a checkout, please re-run ./mach bootstrap` from the checkout directory.

That's the latest message.
How can I install Style and NodeJs?
Thanks.

Flags: needinfo?(miguelp12)

(In reply to miguel from comment #2)

Hi Gijs. Thank you for your reply.

This is the result when I used ./mach bootstrap

`0 files updated, 0 files merged, 0 files removed, 0 files unresolved

This wizard will guide you through configuring Mercurial for an optimal
experience contributing to Mozilla projects.

The wizard makes no changes without your permission.

To begin, press the enter/return key.

Will you be submitting commits to Mozilla (Yn)? y
Commits to Mozilla projects are typically sent to Phabricator. This is the
preferred code review tool at Mozilla.
Phabricator installation instructions are here
http://moz-conduit.readthedocs.io/en/latest/phabricator-user.html

If you would like to clone the mozilla-unified Mercurial repository, please
enter the destination path below.

Destination directory for Mercurial clone (leave empty to not clone):

Source code can be obtained by running

hg clone https://hg.mozilla.org/mozilla-unified

Or, if you prefer Git, by following the instruction here to clone from the
Mercurial repository:

https://github.com/glandium/git-cinnabar/wiki/Mozilla:-A-git-workflow-for-Gecko-development

Installing Stylo and NodeJS packages requires a checkout of mozilla-central
(or mozilla-unified). Once you have such a checkout, please re-run ./mach bootstrap` from the checkout directory.

That's the latest message.
How can I install Style and NodeJs?
Thanks.

(In reply to miguel from comment #0)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4068.5 Safari/537.36

Steps to reproduce:

I used the latest version of Mozilla-builder
and download the Mozilla source - desktop.
after that, I run ./mach bootstrap and ./mach build.
But I face the issues.
I am working on windows 10

Actual results:

Steps to reproduce:

i was trying to build firefox using: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites
when i reached to the ./mach build i faced the issue below

Actual results:

$ ./mach build
 0:04.13 Clobber not needed.
 0:04.16 Adding make options from None
    MOZ_OBJDIR=c:/mozilla-source/mozilla-central/obj-i686-pc-mi
    OBJDIR=c:/mozilla-source/mozilla-central/obj-i686-pc-mingw3
 0:04.39 c:\mozilla-build\mozmake\mozmake.EXE -f client.mk -s c
 0:05.19 cd c:/mozilla-source/mozilla-central/obj-i686-pc-mingw
 0:05.31 c:/mozilla-source/mozilla-central/configure
 0:06.88 Reexecuting in the virtualenv
 0:07.51 checking for vcs source checkout... hg
 0:08.13 checking for a shell... C:/mozilla-build/msys/bin/sh.e
 0:10.65 checking for host system type... i686-pc-mingw32
 0:10.65 checking for target system type... i686-pc-mingw32
 0:10.78 checking for a shell... C:/mozilla-build/msys/bin/sh.e
 0:12.81 checking for host system type... i686-pc-mingw32
 0:12.81 checking for target system type... i686-pc-mingw32
 0:13.09 checking for vcs source checkout... hg
 0:13.09 checking whether cross compiling... no
 0:13.35 checking for the target C compiler... not found
 0:13.38 DEBUG: _cc: Trying cl
 0:13.38 DEBUG: _cc: Trying clang-cl
 0:13.38 DEBUG: _cc: Trying gcc
 0:13.38 DEBUG: _cc: Trying clang
 0:13.38 ERROR: Cannot find the target C compiler
 0:14.30 *** Fix above errors and then restart with\
 0:14.30                "c:/mozilla-build/mozmake/mozmake.EXE -

Expected results:

There is something wrong with the current version build on windows 10?
Thank you.

(In reply to miguel from comment #2)

Hi Gijs. Thank you for your reply.

This is the result when I used ./mach bootstrap

0 files updated, 0 files merged, 0 files removed, 0 files unresolved
================================================================================
This wizard will guide you through configuring Mercurial for an optimal
experience contributing to Mozilla projects.

The wizard makes no changes without your permission.

To begin, press the enter/return key.

Will you be submitting commits to Mozilla (Yn)?  y
Commits to Mozilla projects are typically sent to Phabricator. This is the
preferred code review tool at Mozilla.
Phabricator installation instructions are here
http://moz-conduit.readthedocs.io/en/latest/phabricator-user.html


If you would like to clone the mozilla-unified Mercurial repository, please
enter the destination path below.

Destination directory for Mercurial clone (leave empty to not clone):

Source code can be obtained by running

    hg clone https://hg.mozilla.org/mozilla-unified

Or, if you prefer Git, by following the instruction here to clone from the
Mercurial repository:

    https://github.com/glandium/git-cinnabar/wiki/Mozilla:-A-git-workflow-for-Gecko-development


Installing Stylo and NodeJS packages requires a checkout of mozilla-central
(or mozilla-unified). Once you have such a checkout, please re-run
./mach bootstrap from the checkout directory.

That's the latest message.
How can I install Style and NodeJs?
Thanks.

How did you download the source code? It doesn't look like it's a git or mercurial local checkout/repository.

Flags: needinfo?(miguelp12)

I did try to clone the repository using this command
"hg clone https://hg.mozilla.org/mozilla-central"

But it shows error

$ hg clone https://hg.mozilla.org/mozilla-central test
applying clone bundle from https://hg.cdn.mozilla.net/mozilla-central/5e69563343eb5bb7b8dfaaacc1e634e57d4583a0.zstd-max.hg
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: An existing connection was forcibly closed by the remote host

So I visit https://hg.mozilla.org/mozilla-central and download the zip file for the source code and run './mach bootstrap'
Do we have to clone?

Flags: needinfo?(miguelp12)
Priority: -- → P3

I think the build instructions should suggest hg bundles first. I have never succeeded hg clone.

hg clone does use bundles. That's right there in comment 5 "applying clone bundle". The url that follows is exactly what you get on https://hg.cdn.mozilla.net/. The problem is that mercurial itself is not very good with flaky networks when it takes too long to apply the bundle. It should either retry with HTTP Range requests or buffer the download to memory or disk. Either way, that'd be something to file on https://bz.mercurial-scm.org/. One thing you can try is hg clone --stream. It will download more data, but it should do so more steadily.

Hi. Thank you for your reply.
Now, I am going to build mozillla-esr52 and It shows the same error.
I used https://firefox-source-docs.mozilla.org/contributing/mercurial_bundles.html to clone.
However, ./mach bootstrap doesn't download clang and there is no error message.

Could you help me why this happened? I am working on windows 10 and using the latest version of Mozilla-build.
Also, I installed Visual Studio 2019.

Thank you.

Similarly, if you want to work on the look-and-feel of Firefox for Android,
you want "Firefox for Android Artifact Mode".

To work on the Gecko technology platform, you would need to opt to full,
non-artifact mode. Gecko is Mozilla's web rendering engine, similar to Edge,
Blink, and WebKit. Gecko is implemented in C++ and JavaScript. If you
want to work on web rendering, you want "Firefox for Desktop", or
"Firefox for Android".

If you don't know what you want, start with just Artifact Mode of the desired
platform. Your builds will be much shorter than if you build Gecko as well.
But don't worry! You can always switch configurations later.

You can learn more about Artifact mode builds at
https://developer.mozilla.org/en-US/docs/Artifact_builds.

Your choice:
2
info: updating existing rustup installation

Your version of Mercurial (5.1.2) is sufficiently modern.
Your version of Python (2.7.16) is new enough.
Mozilla recommends a number of changes to Mercurial to enhance your
experience with it.

Would you like to run a configuration wizard to ensure Mercurial is
optimally configured?

  1. Yes
  2. No

Please enter your reply: 1
================================================================================
Ensuring https://hg.mozilla.org/hgcustom/version-control-tools is up to date at c:/Users/LiuWe/.mozbuild\version-control-tools
pulling from https://hg.mozilla.org/hgcustom/version-control-tools
searching for changes
no changes found
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
================================================================================
This wizard will guide you through configuring Mercurial for an optimal
experience contributing to Mozilla projects.

The wizard makes no changes without your permission.

To begin, press the enter/return key.

Will you be submitting commits to Mozilla (Yn)?
Commits to Mozilla projects are typically sent to Phabricator. This is the
preferred code review tool at Mozilla.
Phabricator installation instructions are here
http://moz-conduit.readthedocs.io/en/latest/phabricator-user.html


Your system should be ready to build Firefox for Desktop!

This is the result when I run ./mach bootstrap.

Hi Masatoshi.
Thank you for your reply. So we need to copy the bootstrap folder from the mozilla-central and copy that into the current repository?
Thank you.

(In reply to miguel from comment #12)

Hi Masatoshi.
Thank you for your reply. So we need to copy the bootstrap folder from the mozilla-central and copy that into the current repository?
Thank you.

esr52 is just really old and I don't know what the requirements would be to get the right toolchain to build it - why would you want to build esr52 rather than current mozilla-central?

It looks like esr52 didn't offer to install/download clang - it looks like this was added in https://bugzilla.mozilla.org/show_bug.cgi?id=1314355 . I doubt copying bootstrap folders from mozilla-central would help, and I'm not sure that esr52 compiles with clang on Windows.

If you've got VS 2019 installed, perhaps you didn't install the C/C++ compiler parts, or they're not in your $PATH environment variable?

On the whole, I'd advise using mozilla-central and using mach bootstrap there, on a local hg working directory, for which you can manually download a bundle (see comment #6 ) if calling hg clone doesn't work reliably, or you can try hg clone --stream as per comment #8.

Why do you persist in building the outdated esr52 tree? It is no longer supported and Bugzilla would be not an appropriate place to ask the question about unsupported branches.

FWIW,

  1. The esr52 branch would not work with VS2019. Even VS2017 was not supported until Firefox 55.
  2. Clang-cl support is even newer. So ./mach bootstrap won't care about installing clang-cl at all on the esr52 branch.
  3. You will have to install an old MozillaBuild and run one of start-shell-msvc*.bat, I guess.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.