Closed Bug 1778312 Opened 3 years ago Closed 3 years ago

ERROR: Cannot find a Visual C++ install for e.g. ATL headers.

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: uioptt24, Unassigned)

Details

Steps to reproduce:

  1. Deploy the compilation environment
  2. Pull Firefox source code
  3. Run and compile
  4. Modified Firefox source code and mozconfig file

Actual results:

I tried to build Firefox on windows. After running ./mach build -v, the error message "ERROR: Cannot find a Visual C++ install for e.g. ATL headers." appeared and the compilation could not continue. I have already deployed the compilation according to the documentation.

Expected results:

It compiles normally after running mach build -v

Steps 3 and 4 should be interchanged.

Hey uioptt24,

Are you following the windows build docs? I think you may not have installed the Visual Studio Build Tools (or you did not select C++ ATL for v143 built tools (x86 and x64 when installing Visual Studio). If you already have Visual Studio installed, you may need to modify the installation to install those components from the Individual components tab.

Let me know if that helps.

(In reply to Alex Hochheiden [:ahochheiden] from comment #2)

Hey uioptt24,

Are you following the windows build docs? I think you may not have installed the Visual Studio Build Tools (or you did not select C++ ATL for v143 built tools (x86 and x64 when installing Visual Studio). If you already have Visual Studio installed, you may need to modify the installation to install those components from the Individual components tab.

Let me know if that helps.

I have installed the ATL components when I installed visual studio. The system I use is the preview version of windows 11, and the version number of visual studio is 17.3.0 Preview2.

Does C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe exist for you?

(In reply to Alex Hochheiden [:ahochheiden] from comment #4)

Does C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe exist for you?

exists, i can find it

Can you open a PowerShell window there, and run vswhere.exe -products "*" -requires "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"?

Look for installationPath: (the value should be something like: C:\Program Files\Microsoft Visual Studio\2022\Community)

Then open <installationPath value here>\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt and copy the version number in there (mine is 14.30.30705)

Then see if <installationPath value here>\VC\Tools\MSVC\<copied version number here> exists?

Mine is: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\

If yes, in that directory go deeper into bin, then twice deeper into the folder corresponding to your system architecture (eg: x64 or x86).

Ending up with something like: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64

There, does cl.exe exist? (eg: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64\cl.exe)

(In reply to Alex Hochheiden [:ahochheiden] from comment #6)

Can you open a PowerShell window there, and run vswhere.exe -products "*" -requires "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"?

Look for installationPath: (the value should be something like: C:\Program Files\Microsoft Visual Studio\2022\Community)

Then open <installationPath value here>\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt and copy the version number in there (mine is 14.30.30705)

Then see if <installationPath value here>\VC\Tools\MSVC\<copied version number here> exists?

Mine is: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\

If yes, in that directory go deeper into bin, then twice deeper into the folder corresponding to your system architecture (eg: x64 or x86).

Ending up with something like: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64

There, does cl.exe exist? (eg: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64\cl.exe)

cl.exe also exists, the directory where it is located is D:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\bin\Hostx64\x64, I modified the installation path of visual studio.

Does D:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\atlmfc\include exist?

If yes, in your mozilla-unified source directory, can you add export VC_PATH="D:/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.33.31517" to your mozconfig file? (You may have to create it, just a simple text file called mozconfig with no file extension).

Then try ./mach configure again.

(In reply to Alex Hochheiden [:ahochheiden] from comment #8)

Does D:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\atlmfc\include exist?

If yes, in your mozilla-unified source directory, can you add export VC_PATH="D:/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.33.31517" to yourmozconfigfile? (You may have to create it, just a simple text filled calledmozconfig` with no file extension).

Then try ./mach configure again.

D:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\atlmfc\include this path also exists, I will test adding export VC_PATH="D:/Microsoft Visual Studio/2022/Preview/VC/ Tools/MSVC/14.33.31517", I will reply you with the result.

(In reply to Alex Hochheiden [:ahochheiden] from comment #8)

Does D:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\atlmfc\include exist?

If yes, in your mozilla-unified source directory, can you add export VC_PATH="D:/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.33.31517" to your mozconfig file? (You may have to create it, just a simple text file called mozconfig with no file extension).

Then try ./mach configure again.

The previous problem has been successfully solved, and now I have encountered a new problem

0:46.70 warning: the following packages contain code that will be rejected by a future version of Rust: midir v0.7.0 (https://github.com/mozilla/midir.git?rev=4c11f0ffb5d6a10de4aff40a7b81218b33b94e6f#4c11f0ff)
0:46.70 note: to see what the problems were, use the option --future-incompat-report, or run cargo report future-incompatibilities --id 3
0:46.70 mozmake[4]: Leaving directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented/toolkit/library/rust'
0:46.70 mozmake[3]: Leaving directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:46.70 mozmake[2]: *** [C:/mozilla-source/mozilla-unified/config/recurse.mk:34: compile] Error 2
0:46.70 mozmake[2]: Leaving directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:46.70 mozmake[1]: *** [C:/mozilla-source/mozilla-unified/config/rules.mk:361: default] Error 2
0:46.70 mozmake[1]: Leaving directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:46.70 mozmake: *** [client.mk:63: build] Error 2
0:46.70 498 compiler warnings present.

The actual error message is likely much earlier in the log.

(In reply to Mike Hommey [:glandium] from comment #11)

The actual error message is likely much earlier in the log.

How can I check the log?

You can increase the scrollback buffer size of your terminal (https://www.top-password.com/blog/change-screen-buffer-size-in-windows-command-prompt/)

Or run ./mach show-log after ./mach build.

(In reply to Mike Hommey [:glandium] from comment #13)

You can increase the scrollback buffer size of your terminal (https://www.top-password.com/blog/change-screen-buffer-size-in-windows-command-prompt/)

Or run ./mach show-log after ./mach build.

Here is what the show-log command returns

$ ./mach show-log
0:01.10 C:/Users/zhang/.mozbuild/mozmake/mozmake.exe -j8 -C C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented
0:01.12 mozmake[1]: warning: -j8 forced in submake: resetting jobserver mode.
0:01.24 mozmake[1]: Entering directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:01.46 mozmake[2]: Entering directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:01.61 C:/Users/zhang/.mozbuild/mozmake/mozmake.exe recurse_pre-export
0:01.75 mozmake[3]: Entering directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:01.75 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.process_install_manifest --track install_dist_include.track dist/include _build_manifests/install/dist_include
0:01.77 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.process_install_manifest --track install_dist_public.track dist/public _build_manifests/install/dist_public
0:01.79 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.process_install_manifest --track install_dist_private.track dist/private _build_manifests/install/dist_private
0:01.81 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.process_install_manifest --track install_dist_xpi-stage.track dist/xpi-stage _build_manifests/install/dist_xpi-stage
0:01.85 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.process_install_manifest --track install__tests.track _tests _build_manifests/install/_tests
0:01.89 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.process_install_manifest --track install_dist_bin.track dist/bin _build_manifests/install/dist_bin
0:02.31 Elapsed: 0.00s; From dist/public: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
0:02.35 Elapsed: 0.00s; From dist/private: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
0:02.53 Elapsed: 0.17s; From dist/xpi-stage: Kept 0 existing; Added/updated 94; Removed 0 files and 0 directories.
0:04.14 Elapsed: 1.74s; From _tests: Kept 0 existing; Added/updated 1234; Removed 0 files and 0 directories.
0:05.58 Elapsed: 3.15s; From dist/bin: Kept 0 existing; Added/updated 2625; Removed 0 files and 0 directories.
0:08.23 Elapsed: 5.96s; From dist/include: Kept 0 existing; Added/updated 6803; Removed 0 files and 0 directories.
0:08.24 mozmake[3]: Leaving directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:08.32 mozmake[2]: Leaving directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:08.48 mozmake[2]: Entering directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:08.48 ./buildid.h.stub
0:08.48 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.file_generate C:/mozilla-source/mozilla-unified/build/variables.py buildid_header buildid.h .deps/buildid.h.pp .deps/buildid.h.stub
0:08.49 ./source-repo.h.stub
0:08.50 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.file_generate C:/mozilla-source/mozilla-unified/build/variables.py source_repo_header source-repo.h .deps/source-repo.h.pp .deps/source-repo.h.stub
0:10.52 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe C:/mozilla-source/mozilla-unified/config/nsinstall.py -R -m 644 'buildid.h' 'dist/include'
0:10.88 C:/Users/zhang/.mozbuild/mozmake/mozmake.exe recurse_export
0:11.03 mozmake[3]: Entering directory 'C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/instrumented'
0:11.03 ./application.ini.stub
0:11.05 C:/mozilla-source/mozilla-unified/obj-x86_64-w64-mingw32/_virtualenvs/build/Scripts/python.exe -m mozbuild.action.file_generate C:/mozilla-source/mozilla-unified/python/mozbuild/mozbuild/action/preprocessor.py generate build/application.ini build/.deps/application.ini.pp build/.deps/application.ini.stub C:/mozilla-source/mozilla-unified/build/application.ini.in -DGRE_MILESTONE=104.0a1 -DMAR_CHANNEL_ID= -DMOZ_APPUPDATE_HOST=aus5.mozilla.org -DMOZ_APP_BASENAME=Mercury -DMOZ_APP_ID=org.mozilla.mercury -DMOZ_APP_PROFILE=Mercury -DMOZ_APP_REMOTINGNAME=mercury-default -DMOZ_APP_VENDOR=Alex313031 -DMOZ_APP_VERSION=104.0a1 -DMOZ_BUILD_APP_IS_BROWSER=1 -DMOZ_CRASHREPORTER_URL=https://crash-reports.mozilla.com -DMOZ_PROFILE_MIGRATOR=1 -DTOPOBJDIR=C:/mozilla-source/mozilla-uni:

It should show further down if you press arrow keys, return or spacebar.

(In reply to Mike Hommey [:glandium] from comment #15)

It should show further down if you press arrow keys, return or spacebar.

Is there any way to scroll through the log files quickly? The log file has too much content.

Pressing h should show you how you can move around.

(In reply to Mike Hommey [:glandium] from comment #17)

Pressing h should show you how you can move around.

The log content is very large, how should I extract them all and send them here? Or what should I focus on in the log?

Try this: ./mach build 2>&1 | tee log.txt. That should create a file called log.txt in your mozilla-unified directory with the entire console output of that command in it, while still letting you see the output to the console at the same time. Then just upload that whole log here as an attachment.

(Just make sure you wait for the command execution to finish before uploading the log)

(In reply to Alex Hochheiden [:ahochheiden] from comment #19)

Try this: ./mach build 2>&1 | tee log.txt. That should create a file called log.txt in your mozilla-unified directory with the entire console output of that command in it, while still letting you see the output to the console at the same time. Then just upload that whole log here as an attachment.

(Just make sure you wait for the command execution to finish before uploading the log)

This is the log file, please check it out
https://drive.google.com/file/d/1SWDSskbBMr6M-tqPoKfRCEV9mx5cOH6H/view?usp=sharing

It looks like you're doing a PGO build. Can you try doing a normal build first?

(In reply to Mike Hommey [:glandium] from comment #21)

It looks like you're doing a PGO build. Can you try doing a normal build first?

I'll try it later and report back when I try. In addition, there are many linker errors in the log, I don't know if it is a bug in the toolchain.

(In reply to Alex Hochheiden [:ahochheiden] from comment #19)

Try this: ./mach build 2>&1 | tee log.txt. That should create a file called log.txt in your mozilla-unified directory with the entire console output of that command in it, while still letting you see the output to the console at the same time. Then just upload that whole log here as an attachment.

(Just make sure you wait for the command execution to finish before uploading the log)

After I disabled the parameters related to PGO, I can now compile normally. The following warning also appeared during the compilation process. Does the compiler do not support wl and O3 parameters?

lld-link: warning: ignoring unknown argument '-Wl,-O3'

At the same time, I want to report a problem. When I run mach bootstrap, the following error pops up

abort: error: EOF occurred in violation of protocol (_ssl.c:1129)

In addition, I also want to ask, how should I compile the browser with the installation package, or do I need to package it into the installation package myself?

(In reply to Mike Hommey [:glandium] from comment #21)

It looks like you're doing a PGO build. Can you try doing a normal build first?

After I disabled the parameters related to PGO, I can now compile normally.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

Sorry, I was a bit too hasty on closing that (I only read the latest comment 24)

(In reply to uioptt24 from comment #23)

At the same time, I want to report a problem. When I run mach bootstrap, the following error pops up

abort: error: EOF occurred in violation of protocol (_ssl.c:1129)
I think raise a different bug with the corresponding error log and relevant details. (I think since you're trying to do non-standard stuff, include what's in your mozconfig)

In addition, I also want to ask, how should I compile the browser with the installation package, or do I need to package it into the installation package myself?

I think you need to package it yourself, but that's not my area of expertise.

Does the compiler do not support wl and O3 parameters?
https://clang.llvm.org/docs/ClangCommandLineReference.html

lld-link is the linker, but I do see -Wl on there in the list of flags. It might have something to do with how you're specifying them?

(In reply to Alex Hochheiden [:ahochheiden] from comment #25)

Sorry, I was a bit too hasty on closing that (I only read the latest comment 24)

(In reply to uioptt24 from comment #23)

At the same time, I want to report a problem. When I run mach bootstrap, the following error pops up

abort: error: EOF occurred in violation of protocol (_ssl.c:1129)
I think raise a different bug with the corresponding error log and relevant details. (I think since you're trying to do non-standard stuff, include what's in your mozconfig)

In addition, I also want to ask, how should I compile the browser with the installation package, or do I need to package it into the installation package myself?

I think you need to package it yourself, but that's not my area of expertise.

Does the compiler do not support wl and O3 parameters?
https://clang.llvm.org/docs/ClangCommandLineReference.html

lld-link is the linker, but I do see -Wl on there in the list of flags. It might have something to do with how you're specifying them?

Problem solved, thanks for your help

Resolution: INVALID → INACTIVE
You need to log in before you can comment on or make changes to this bug.