gyp: Environment variable "SYSTEMROOT" required to be set to valid path

I am attempting to build Chromium from a tarball on Windows.
I've followed most of the build instructions, excluding checking out the code.

However, when I execute gyp to set up my project, the following error occurs: Environment variable "SYSTEMROOT" required to be set to valid path
python build\gyp_chromium -Dtarget_arch=x64 --toplevel-dir=src/ -depth .

Open in new window


I've tried using both cmd.exe and the Developer Command Prompt for Visual Studio.
The problem described in this issue seems to match my symptoms but none of the suggestions solved my problem.

I've found a number of other forum threads about this issue but none of the suggestions in those solved my problem either.
LVL 1
bejhanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
How did you get rid of SYSTEMROOT environment variable in Windows?
It is present there for ages and usually is set to C:\WINDOWS\
0
bejhanAuthor Commented:
The environment variable does exist though. Both command prompt and the Python console confirm it's value to be "C:\WINDOWS\".

The issue I referenced in my original post suggests that the problem may not be directly related to SYSTEMROOT.
0
gheistCommented:
If you copy instead of storytelling the authentic error messages it helps to better understand your problem.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

bejhanAuthor Commented:
Sorry I should've provided more details in my original post.

My Linux team is using the latest stable CentOS Chromium package (version 45.0.2454.85).
I need the same version for my Windows team but I cannot find this exact version on the Windows Chromium snapshots page.
Therefore, I decided to extract the tarball from the CentOS source package and build it on Windows 7.

I performed the following steps in an attempt to build from the tarball:

1.


I installed depot_tools following the steps on this page.

2.


I installed Visual Studio 2015 Community. The build instructions indicate that Visual Studio 2013 Update 4 must be used but I've seen multiple forum posts indicating people have been able to build with Visual Studio 2015. Therefore, I'm assuming that this means that Visual Studio 2013 Update 4 is the lowest supported version.

3.


I installed the Windows 8.1 SDK to the default install location.

4.


I set environment variables:
DEPOT_TOOLS_WIN_TOOLCHAIN=0
GYP_MSVS_VERSION=2015
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\8.1

5.


I attempted to set up the project by executing gyp:
python build\gyp_chromium -Dtarget_arch=x64 --toplevel-dir=src/ -depth .

Open in new window


This is when I get the SYSTEMROOT error:
C:\Chromium\chromium-45.0.2454.85\src>python build\gyp_chromium -Dtarget_arch=x6
4 --toplevel-dir=src/  --depth .
Updating projects from gyp files...
Traceback (most recent call last):
  File "build\gyp_chromium", line 323, in <module>
    gyp_rc = gyp.main(args)
  File "C:\Chromium\chromium-45.0.2454.85\src\tools\gyp\pylib\gyp\__init__.py",
line 538, in main
    return gyp_main(args)
  File "C:\Chromium\chromium-45.0.2454.85\src\tools\gyp\pylib\gyp\__init__.py",
line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "C:\Chromium\chromium-45.0.2454.85\src\tools\gyp\pylib\gyp\generator\ninj
a.py", line 2384, in GenerateOutput
    pool.map(CallGenerateOutputForConfig, arglists)
  File "C:\Chromium\depot_tools\python276_bin\lib\multiprocessing\pool.py", line
 250, in map
    return self.map_async(func, iterable, chunksize).get()
  File "C:\Chromium\depot_tools\python276_bin\lib\multiprocessing\pool.py", line
 554, in get
    raise self._value
Exception: Environment variable "SYSTEMROOT" required to be set to valid path

Open in new window


I also attempted to check out from the Chromium repository and follow the build instructions exactly because I thought it may be specifically a problem with building from tarball but I encountered the same error.
0
gheistCommented:
Python 2.7.6 pops up in errors - are you using exactly Python 2.7.6 ?
0
bejhanAuthor Commented:
Yes I am.

C:\Chromium\chromium-45.0.2454.85\src>python --version
Python 2.7.6

Open in new window


A lot of forum posts I've read are indicating the "gclient sync" and "gclient runhooks" must be executed to solve this. I do not have a .gclient file in my tarball but I will try this on checked out code to see if it solves the problem there.
0
gheistCommented:
Chromium for windows is called Chrome... It comes with pepper-flash, but rest is same.
0
bejhanAuthor Commented:
Chromium is actually the open-source base of Chrome.

I must use Chromium because it is impossible to support a complex web application when your browser version is constantly changing (i.e. Chrome automatically updates). As well, I need the ability to patch bugs in the browser when customers report them since Google is not usually quick enough.
0
bejhanAuthor Commented:
Running "gclient sync" and "gclient runhooks" on the checked out code causes the SYSTEMROOT error, so this is definitely a problem with my environment (rather than problem with the tarball I am trying to build).

I am going to install Visual Studio 2013 Update 4 to see if the problem is Visual Studio 2015, though I suspect this is more so a problem with the depot_tools configuration.
0
bejhanAuthor Commented:
Installing Visual Studio 2013 Update 4 and setting GYP_MSVS_VERSION environment variable to 2013 solved my problem.

I guess I should've taken the statement indicating Visual Studio 2013 Update 4 is the only version that works more literally. I wonder how others built using Visual Studio 2015.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gheistCommented:
Only supportable browser version is "latest"
You should probably look into firefox ESX instead for more or less fixed version.
0
bejhanAuthor Commented:
Only supportable browser version is "latest"
That is true for most web applications, because you do not have control over the web browser your visitors are using.
However, my web application is used in an industrial setting where we have complete control over the client. Therefore, we standardize on a version of Chromium and only allow upgrade once we have tested a newer version and corrected any found issues.
0
bejhanAuthor Commented:
I found my own solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.