通过代理拉取chromium过程

前提

  • 已经有工作正常的shadowsocks代理。关于shadowsocks的文章很多,这里就不重复了。

  • shadowsocks 本地代理端口 1080

下载安装 depot_tools

参考 Install depot_tools

注意:

设置环境变量

  • DEPOT_TOOLS_WIN_TOOLCHAIN=0
  • GYP_MSVS_VERSION=2017

并重启 cmd shell 生效

拉取代码

windows代理设置

  • 以下命令在 windows cmd 中执行

# for general command line proxy
netsh winhttp set proxy 127.0.0.1:1080

# reset proxy when not needed
netsh winhttp reset proxy

# for python environment variables
set http_proxy=http://127.0.0.1:1080
set https_proxy=https://127.0.0.1:1080
set socks5_proxy=socks5://127.0.0.1:1080

# for git
git config --global http.proxy 'http://127.0.0.1:1080'
git config --global https.proxy 'https://127.0.0.1:1080'

# unset git proxy when not needed
git config --global --unset http.proxy
git config --global --unset https.proxy

参考 Get the code

linux 代理设置

#!/bin/bash 
setenv()
{
    export PATH=/home/caesar/depot_tools:$PATH
    export http_proxy="http://127.0.0.1:1080"
    export https_proxy="https://127.0.0.1:1080"
    export socks5_proxy="socks5://127.0.0.1:1080"
    git config --global http.proxy http://127.0.0.1:1080
    git config --global https.proxy https://127.0.0.1:1080
}

unsetenv()
{
    unset http_proxy
    unset https_proxy
    unset socks5_proxy
    git config --global --unset http.proxy
    git config --global --unset https.proxy
}

References

> THEN, I copied the 10.0.15063.0 to 10.0.14393.0

At that point you are in uncharted territory. You might have better luck if you installed the 10.0.14393.0 SDK. It should side-by-side install with 10.0.15063.0. Old installers can be found here: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive

> I manually added C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin to PATH

That means that you are running a really old version of mc.exe and it apparently doesn't support the -m switch. This tool is supposed to be found, I believe, in "C:\Program Files (x86)\Windows Kits\10\bin\x64".

Before you go too far, try these sanity-check steps:

C:\>"%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64_x86 10.0.14393.0

C:\>where cl
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\cl.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe

C:\>where mc
C:\Program Files (x86)\Windows Kits\10\bin\x64\mc.exe
C:\Program Files (x86)\Windows Kits\10\bin\x86\mc.exe

C:\>set include
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt;



If you have installed VC++ 2015 Update 3, including the C++ development tools (which are not installed by default) and the 10.0.14393.0 SDK, then these steps should work and should give the same results. If the results are different then Chrome will probably not build and it is better to figure out what went wrong rather than trying to hand-patch things together.

I'll update the instructions to mention the SDK installer. It is unfortunate that Microsoft's 10.0.15063.0 SDK is broken (missing header file). I hope they fix it soon.