Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install/build on Windows 10 not working #18055

Closed
jasonwilliams opened this issue Aug 12, 2017 · 23 comments
Closed

Install/build on Windows 10 not working #18055

jasonwilliams opened this issue Aug 12, 2017 · 23 comments

Comments

@jasonwilliams
Copy link
Contributor

@jasonwilliams jasonwilliams commented Aug 12, 2017

Hi all i've just reformated my machine.
I followed the instructions on the readme, (including installing Visual Studio 2017)
and now i get

PS G:\workspace\servo> .\mach.bat build --dev
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26430.16
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
looking for rustc at G:\workspace\servo\.servo\rust\599be0d18f4c6ddf36366d2a5a2ca6dc65886896\rustc-nightly-x86_64-unknown\rustc\bin\rustc.exe
Downloading Rust compiler...
Download failed (404): Not Found - https://s3.amazonaws.com/rust-lang-ci/rustc-builds/599be0d18f4c6ddf36366d2a5a2ca6dc65886896/rustc-nightly-x86_64-unknown.tar.gz
PS G:\workspace\servo>

any idea why?

@jdm
Copy link
Member

@jdm jdm commented Aug 12, 2017

It is no longer detecting it as an msvc environment for some reason (rustc-nightly-x86_64-unknown.tar.gz).

@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 12, 2017

Deleted Visual Studio and then reinstalled it,
The only difference this time was i started it up before installing, its working now

@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 12, 2017

Now im getting "linking with 'link.exe' failed: exit code: 1181

 Downloading vcpkg v0.2.2
   Compiling bitflags v0.7.0
   Compiling utf8-ranges v1.0.0
   Compiling bytes v0.3.0
   Compiling libc v0.2.23
   Compiling fnv v1.0.5
   Compiling futures v0.1.13
   Compiling bit-vec v0.4.3
   Compiling rustc-demangle v0.1.4
   Compiling winapi-build v0.1.1
   Compiling signpost v0.1.0 (https://github.com/pcwalton/signpost.git#7ed71250)
   Compiling thread_profiler v0.1.3
   Compiling string_cache_shared v0.3.0
   Compiling sha1 v0.2.0
   Compiling browserhtml v0.1.17 (https://github.com/browserhtml/browserhtml?branch=crate#7c66ae9a)
   Compiling vcpkg v0.2.2
   Compiling itoa v0.3.1
   Compiling procedural-masquerade v0.1.2
   Compiling libloading v0.4.0
   Compiling atomic_refcell v0.1.0
   Compiling xi-unicode v0.1.0
   Compiling binary-space-partition v0.1.2
   Compiling webrender v0.48.0 (https://github.com/servo/webrender#b13a3b8f)
   Compiling mp3-metadata v0.2.3
   Compiling mozjs_sys v0.0.0 (https://github.com/servo/mozjs#834ce35c)
   Compiling unicode-xid v0.0.4
   Compiling cfg-if v0.1.2
   Compiling stable_deref_trait v1.0.0
   Compiling antidote v1.0.0
error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX64
\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc658
86896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "G:\\workspace\\servo
\\target\\debug\\build\\libloading-de37c52285a1604b\\build_script_build-de37c52285a1604b.0.o" "G:\\workspace\\servo\\tar
get\\debug\\build\\libloading-de37c52285a1604b\\build_script_build-de37c52285a1604b.1.o" "G:\\workspace\\servo\\target\\
debug\\build\\libloading-de37c52285a1604b\\build_script_build-de37c52285a1604b.2.o" "G:\\workspace\\servo\\target\\debug
\\build\\libloading-de37c52285a1604b\\build_script_build-de37c52285a1604b.3.o" "/OUT:G:\\workspace\\servo\\target\\debug
\\build\\libloading-de37c52285a1604b\\build_script_build-de37c52285a1604b.exe" "G:\\workspace\\servo\\target\\debug\\bui
ld\\libloading-de37c52285a1604b\\build_script_build-de37c52285a1604b.crate.allocator.o" "/OPT:REF,NOICF" "/DEBUG" "/LIBP
ATH:G:\\workspace\\servo\\target\\debug\\deps" "/LIBPATH:G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2
ca6dc65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "G:\\workspac
e\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\
rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-fea3b8e184e1df3d.rlib" "G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6dd
f36366d2a5a2ca6dc65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\l
iballoc_system-058d58cb421f5e8b.rlib" "G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc65886896-alt\
\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-fe3de5e3203d0aa1.rlib"
"G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\
\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-f7f12fe5ecb2d652.rlib" "G:\\workspace\\servo\\.servo\
\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-p
c-windows-msvc\\lib\\liblibc-f9b6746fcd9c7b46.rlib" "G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6d
c65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-621bd639
76abf689.rlib" "G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc65886896-alt\\rustc-nightly-x86_64-p
c-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_unicode-93e1e206ca42a735.rlib" "G:\\workspace\\
servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rus
tlib\\x86_64-pc-windows-msvc\\lib\\libunwind-96ac3b0b3df9422b.rlib" "G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6dd
f36366d2a5a2ca6dc65886896-alt\\rustc-nightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\l
ibcore-2b4203a5432bc171.rlib" "G:\\workspace\\servo\\.servo\\rust\\599be0d18f4c6ddf36366d2a5a2ca6dc65886896-alt\\rustc-n
ightly-x86_64-pc-windows-msvc\\rustc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-b987567ad2b2a65a.r
lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "shell32.lib" "msvcrt.lib"
  = note: LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'


@jdm
Copy link
Member

@jdm jdm commented Aug 12, 2017

@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 13, 2017

Just tried the solutions mentioned in there, its gone back to not knowing the architecture again :(

@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 13, 2017

When i print out the host_triple() i get x86_64-unknown

@jdm looks like ive found the bug,
https://github.com/servo/servo/blob/master/python/servo/util.py#L41
This env variable is not set for me, should it be??

Edit:
Just set the environment variable PLATFORM: X64 and it got further
We should update the readme

@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 13, 2017

Ok in the end i selected Desktop Development with C++ option and it works now

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 17, 2017

I have done previous steps and I get the same problem :(

PS C:\Users\Tiger\Desktop\servo> ./mach.bat build --dev
Error in script usage. The correct usage is:
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" [option]
  or
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" [option] store
  or
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" [option] [version number]
  or
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" [option] store [version number]
where [option] is: x86 | amd64 | arm | x86_amd64 | x86_arm | amd64_x86 | amd64_arm
where [version number] is either the full Windows 10 SDK version number or "8.1" to use the windows 8.1 SDK
:
The store parameter sets environment variables to support
  store (rather than desktop) development.
:
For example:
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" x86_amd64
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" x86_arm store
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" x86_amd64 10.0.10240.0
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" x86_arm store 10.0.10240.0
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" x64 8.1
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" x64 store 8.1
:
Please make sure either Visual Studio or C++ Build SKU is installed.
looking for rustc at C:\Users\Tiger\Desktop\servo\.servo\rust\13d94d5fa8129a34f5c77a1bcd76983f5aed2434\rustc-nightly-x86_64-unknown\rustc\bin\rustc.exe
Downloading Rust compiler...
Download failed (404): Not Found - https://s3.amazonaws.com/rust-lang-ci/rustc-builds/13d94d5fa8129a34f5c77a1bcd76983f5aed2434/rustc-nightly-x86_64-unknown.tar.gz
@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 17, 2017

@tigercosmos select the windows 10 SDK in the individual components, and try again.
let me know if that works.

The readme needs a serious update

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 17, 2017

I have installed windows 10 SDK, and try two version SDK. Still not work. I think the problem is not SDK.

@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 18, 2017

@tigercosmos I think ill take a screenshot of what i have installed, when im back on my windows machine, and we can go through the differences.

On top of visual studio, i think i also downloaded http://landinghub.visualstudio.com/visual-cpp-build-tools

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 18, 2017

@Jayflux I have intalled Visual C++ 2015 Build Tools at the beginning.

The issue:

Download failed (404): Not Found - https://s3.amazonaws.com/rust-lang-ci/rustc-builds/13d94d5fa8129a34f5c77a1bcd76983f5aed2434/rustc-nightly-x86_64-unknown.tar.gz

This problem can fixed by modify function host_triple() and host_platform() in \python\servo\util.py as:

def host_platform():
    os_type = platform.system().lower()
    if os_type == "linux":
        os_type = "unknown-linux-gnu"
    elif os_type == "darwin":
        os_type = "apple-darwin"
    elif os_type == "android":
        os_type = "linux-androideabi"
    elif os_type == "windows":
        os_type = "pc-windows-msvc"
    elif os_type == "freebsd":
        os_type = "unknown-freebsd"
    else:
        os_type = "unknown"
    return os_type

def host_triple():
    os_type = host_platform()
    cpu_type = platform.machine().lower()
    if cpu_type in ["i386", "i486", "i686", "i768", "x86"]:
        cpu_type = "i686"
    elif cpu_type in ["x86_64", "x86-64", "x64", "amd64"]:
        cpu_type = "x86_64"
    elif cpu_type == "arm":
        cpu_type = "arm"
    else:
        cpu_type = "unknown"

    return "{}-{}".format(cpu_type, os_type)

Then, it can find rustc file correctly. But there are some build error while compiling other files. Still debug..

@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Aug 18, 2017

@tigercosmos i had this problem, i had to set PLATFORM: X64 in my environment variables.
Im not sure why it needs this env.

Could you check that its set? I think at one point VC would set this but its not being set now and its a manual process.
Or at least this was the case for me anyway

https://github.com/servo/servo/blob/master/python/servo/util.py#L57

@larsbergstrom

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 18, 2017

@Jayflux I think the pc-windows-msvc check in the script is the problem. It have not been set by VC as default. It doesn't make sense to set it manually. Maybe it should be removed.

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 18, 2017

When I pass rustc download issue. There's a problem at:
https://github.com/servo/servo/blob/master/python/servo/bootstrap.py#L224

Installing missing MSVC dependencies...
Downloading moztools-0.0.1-5...
Downloading moztools-0.0.1-5: 100.0%
Extracting moztools-0.0.1-5...done
Error running mach:

    ['build', '-d', '-v']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

WindowsError: [Error 5] ?????

  File "C:\Users\Tiger\Desktop\servo\python\servo\build_commands.py", line 233, in build
    self.ensure_bootstrapped(target=target)
  File "C:\Users\Tiger\Desktop\servo\python\servo\command_base.py", line 587, in ensure_bootstrapped
    Registrar.dispatch("bootstrap", context=self.context)
  File "C:\Users\Tiger\Desktop\servo\python\_virtualenv\Lib\site-packages\mach\registrar.py", line 123, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "C:\Users\Tiger\Desktop\servo\python\_virtualenv\Lib\site-packages\mach\registrar.py", line 90, in _run_command_handler
    result = fn(**kwargs)
  File "C:\Users\Tiger\Desktop\servo\python\servo\bootstrap_commands.py", line 54, in bootstrap
    return bootstrap.bootstrap(self.context, force=force)
  File "C:\Users\Tiger\Desktop\servo\python\servo\bootstrap.py", line 256, in bootstrap
    return bootstrapper(context, force=force)
  File "C:\Users\Tiger\Desktop\servo\python\servo\bootstrap.py", line 227, in windows_msvc
    os.rename(extracted_path, package_dir(package))
@tigercosmos tigercosmos mentioned this issue Aug 18, 2017
0 of 5 tasks complete
@shinglyu
Copy link
Member

@shinglyu shinglyu commented Aug 19, 2017

As @tigercosmos points out to me: our AppVeyor CI seems to use VS 2015? https://github.com/servo/servo/blob/master/appveyor.yml#L23 , maybe we should update the README accordingly?

@tigercosmos tigercosmos mentioned this issue Aug 20, 2017
4 of 8 tasks complete
@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 25, 2017

Error again..
Windows10 V1607 + VS2017(Install almost every components) in VM

C:\Users\123\Desktop\servo>mach.bat build -d
Error running mach:

    ['build', '-d']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

WindowsError: [Error 2] 系統找不到指定的檔案。

  File "C:\Users\123\Desktop\servo\python\servo\build_commands.py", line 243, in build
    env = self.build_env(target=target, is_build=True)
  File "C:\Users\123\Desktop\servo\python\servo\command_base.py", line 509, in build_env
    'git', 'rev-parse', '--short', 'HEAD'
  File "C:\Python27\lib\subprocess.py", line 212, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
    startupinfo)
@jdm
Copy link
Member

@jdm jdm commented Aug 27, 2017

That looks like your shell can't find git.

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 27, 2017

@jdm No, the error is caused by vs shell. After launch VS shell by mach.bat, I found it cd to other folder, so it cannot find files. I don't know why.

So I launch VS shell manually and cd to servo then run python mach build -d, this error not happen again.

@shinglyu
Copy link
Member

@shinglyu shinglyu commented Aug 28, 2017

Which exact folder did the vs shell cd'd to? Is it some kind of default directory? Can we force execute a cd to servo using absolute path after we start the vs shell?

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Aug 28, 2017

It will enter C://..../source. Let me check later.
It's possible to force cd to servo in mach.bat, just add cd path/to/servo at the end.

bors-servo added a commit that referenced this issue Oct 16, 2017
fix windows build issue #18055

<!-- Please describe your changes on the following line: -->
With some reasons, the windows and VS environment do not set the `env("PLATFORM")` variable.
So, there's no need to check the variable, and set `os_type` equl to `pc-windows-msvc` as default. Then the script can get correct url to download `rustc`.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #18055 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18145)
<!-- Reviewable:end -->
@jasonwilliams
Copy link
Contributor Author

@jasonwilliams jasonwilliams commented Oct 17, 2017

Thanks for fixing this @tigercosmos, is the windows build readme up to date?

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Oct 17, 2017

Sure. There are another 2 commits related to this issue be merged previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.