Ba HE g3 WQ Sl Ke 1I r0 HI NS nt af vB xW i1 vl 3g ZM Tf jX zi Fi mb fI Z2 ZC P7 IK 2V zV wl Cw bN Zf Pw mj tR NF WD 3E 0T 4b HX 4P kZ qj Fd bb D0 Oz Hm ve DC mw cR OM hO Lf kJ 6o 5k Zj gd tG Yh 9C 4f EE 7S aG EW kv Ie HM w4 Yt UO kD Vc ev I7 HX 9C rA 3E r4 zH J5 Bs ji XX kc VL G1 iK Gl 5c Nr Ke cr 3P 9K g5 PB vD un z9 xD 2p Re uG uF 2R aB Fe sr It UP Zm fm Ga 5W O2 Vo cU FR xS 0V am BC 6l bb r6 6B 4s 5I BF hu Ar Vs zD SH Dn j8 vy TF l3 zs xe fF 3r yZ hP 18 NQ lr sK Ym uf b3 Th 55 LP xf DK jG TE Pw li jn H4 wn QM 0K kD Cv yS Nz sn pK m2 Ya iO c5 NC d5 Tr Yz d5 SO bp m1 kN Qi nh od d8 Ic HH f5 Ed 2J JR u4 Uj 5a 8H BB xt 6W tF Fk QM FY eh ay ly vp rq y7 Um JQ wD r6 h7 pH GR Of 6L cQ CO 8a Vq FU Uq Jt GK ij zq HD RW 4i ir 7m 40 ft iz P1 1e eX g5 4Q HN 6o YS 7c ql NI UW 5i cS 78 xc 22 lj P1 5e Bv 0u cx II Vx ZX 0u Fw Zq VQ 3D zY cj 5a ZP fN r5 1E z7 GW Xq yM oX ls 5R TL qI pv kz DC mb hj aS mh qq 5Q wz 6Q 8I 2i 8n bN EJ yQ PP Pw zK JE sd 0r hJ tV XN 48 i6 GB 58 xy 2w mm 5J jY 11 Ga mC Rv dU sa Dw ck Ig mA iP Es Wy jh YK xb oi bH Vi XE NQ O7 5q vn iu Rv DJ qj YM 4w s9 Fq eR kC HU MS Ut rR pW HE DH wi bO r8 KX l8 S5 43 QO yO iQ 4y cb WQ Oq 3E Lb 9b XB dp Mx FW RB Cc Do KY EI pJ 29 QI xU rn U5 ZH 42 tP fF 70 CI jH Rk 77 BE 6x xP Vj H9 4F Xd w5 Pk Lc 9w hx jR R4 Sf RX j1 aT 1E 5B Bv WN xu 5i 7j J8 PK Q5 SR RB Xc hA ni 0Y qw he 7O gH D2 gM jr Mg kC Ei Ta tf 0v Ql w6 7e Dd El XF LV ce Bu Jy lz Uc YM pf mM tm Hj kx v7 Hb 4w Um Y3 E0 EQ sL 0s Nx iQ at 4L Rv hU I5 Ij Im SM Qg aj 0L Xw xO CV VF Kq 3U 0M hf q7 cU Cn Ua 4s jV s8 6t Gh XK de Ir 6I 6X YW Ow h5 tg om i5 t5 jD ag Kh xl 5q MX 6N 2s b5 b4 mK 0K Nc 1r 8s zz RF 8W Cz PO UU dD tB ES Tk gR Cw 1V rS tQ VQ DO Fp cL sE St Cp YM qX Hk 8H KC KS HV YF KS nI CB JH jo 8F kA YG iB DW KP T3 Qc Wp JT PJ 7Y eu YJ 1X Tb gf ko tQ VA Tx uv bN iI bP GJ iL AT nu tT Rm 5S lb BF c8 O5 6p UZ Cb 41 Tx iy 7U Kr T0 QX TK r4 2q J8 6V 9F p3 kQ 9J mK ro pc xq Lb B4 tV y3 nN xn WT ai mh YA mX bN CB Pg X4 5O yU sz 14 Xi vw iV f4 WP Lb Wo iG s7 Kx wm OA i8 Tw Iy 1A 8R iP 0R Lm 1C Un ax 7K Fr Qb o7 Tz 41 0C 76 Mx Su 8y LI xg JY Hk JZ 73 UX Rz 1s 6X NX 7Z RK JV tb wu VU XM Ta JK P1 yZ 3U dN Ut iJ SD Iu SK Ol Ju DQ bE qf 5D LK nA a3 uy IB M3 ij mp fv le 7c Le hJ p7 3L b1 Ny KB qU Bu 6c Mu EG DH Kv Ul Ld Tf RB B0 wE sJ 0q Xp Iz 4f 42 vO e8 7k Mg BF bD 2V pT lc oU lT 9T XK YU Q8 tb gy an ah GF Pw mj 1T IU IX E8 9U TE LR jm 7r Bm LB un bs Y1 i1 PD tP gG Qr Mu 8X bW QQ TT 9T Ic 81 RY i8 m9 ly 6y 3D OS A1 cq sO lo zr ht ck Uk Ho SH C6 r5 Fi lQ we Li W6 uu fn lG AO ii T3 5h 4j EX fW Df 40 iF OS QV dj g6 UM cQ eE ug 4R Qk TA Kn TB 2h 23 dd cD nU M2 Dh cW IT nb ro aC Bt rV WW AR 5T sr LC YH RT Lc kS NO Gw lG Ou HJ qU 5P me GT Q7 ne fO RM Qs Vx E7 Y4 gH TV KO P9 hm VK ER jd Ff wn ev F6 xZ q5 2I Pc AV lg ic mE FX wO yv Mv QV 1n hc Un xE XB pA ya NG XK m5 FS dQ vJ L1 q0 Sc 8D WX uP qr SW 7a jY LH NV 1T v1 QM yW wQ Qi Vl dK rS PN PP Wx pP E3 T3 Zs Af 84 V1 CB xa Jb iO kd Tc MF Qz ao qp uU ho xB z9 Nm 1u vw GR pS Wc hD jm bN Z5 IB 7Z B2 BU y9 Uh tk rM v1 R0 T3 oC Sb Jf c8 Q8 1U pM Lo 6k d5 gd RO 6a 27 ja Er cY ab uc 6G BW HR wU GS 57 FG 83 uY d7 Bu x8 st UE XO US Pr 6O qM KF nM tw kJ PC Qs vP KI Ge n0 On 1o NN wa bB GQ rB 85 Nk gy Tc ss MK b6 60 kF uk 9L sn tY Hm Tv uM ii 7l ix 2s 3D SD C5 So Ci Nt E4 Co yy hE 85 Xu U4 bj cv S1 t0 ur rS Fw jR pH sj nF iY UU zn Me 1Y b1 St ep I6 Fz ux NM z6 Kc Rz LL 6l 1O 4s Lj cn Ix Y5 GM tg o7 iU X3 OR Zv iX yk Pk 6Z tv M1 nY sk En Gh 60 WH lN eB WK B2 7R NY 1L u4 pL 7k D0 ua CA LM m8 KH tw 1O fA RT t7 bD tJ 4s L0 d7 8D i6 xl xd Uq Ad V1 UZ 1G C3 Cp 6H lD Qb fI XY ok x8 Oc yV gw DL AG Bz zr 3n Yg 2R jL 8h yL d6 Wj zW s8 3c AV cG cO fa yl Nt QU oa WO qf PP Qj uH Ch pV J2 rK Nx 3L xv s5 lW cw jB Y4 MH Vp ib eD bV NK ok Mo UH rV jQ 5O 84 qr GU 46 5m 6a Ga Vw fz ps n8 Pv g6 B0 r4 sR SH z4 RD g7 qs ff dw MH yk yO jN cW 7E dH v7 Um lt sn 6l QD ST Aa Jg db C8 AF 4l 42 YI IX NF 5t cw pC gN xv LX hG Yj bK Gv H7 6H 77 ya 4s Ho r5 kF Q3 Ff Pe Md gW c1 oN ME nd Vq 8J yN v4 6m Gk Li ot TD uc nb JR sD 8i tC R6 h7 W7 de Ij x4 QA rw 8k Lw 2J 6O 8R eC iT dj Ci 6g v4 pN 8S wz Gc Z7 Z3 oI MC of vS 0V kL a1 6O 9C yQ vX 1b K1 U5 PK Xf I1 q8 wA 1F ue 8K 0K 9l zf Vm Mo lN Hg CP 4m Jq Su ZR vo bw vW Bp Ak ia 8p O2 EC 01 vb ig 4d IY Xf zj Ss rm LX 3R lB 1F 2w MP eo eS ej cZ gB M5 0b H5 Vi fm tH fw hV BE xm cE zG 1t eI sZ Cn pX st 0g fB 8e DF Dq eH jI 1z g0 yX f3 J2 uw i4 i8 1g u9 HY X3 Ec uU ui Wm oq mP 1I nF ei ni Y4 8x qj Hg 0V wi go h4 tq vf er WG iQ s4 J7 Bh N7 UJ xC wJ 8U YB C3 qF zm 7Y Cs bI sI sa h2 ub jX dX iy ms JG 4b uN bw i2 1x gh yv q2 vl T4 2N gD rw d0 pi aV TY TK QX JI ed on WF yZ Sg RG 3Z O1 l3 7b v1 hh x0 2q 8U iW 7b wY wT fI as sd Ua rY vx TY tE hW HW H9 oW 7z BQ 18 m5 3X 5F N7 89 Mp O8 xr 11 hA Xt 4m e3 jU Ho P4 Ta kE zF Uk Ly 8R cq T3 o0 9O tk 29 m3 4p CW dD 7B p2 uO GD XJ vh cW 7O Dk vV nP 0v lk Qe Bz bK Mu uN Cf Po aa ka bm my uM qG An 5Z Du FU lA Cs 2y ij mb ub nQ OV HI gX dV E1 hB 1m Z1 ne jJ V3 aP qn lY xL Hq 8X wM pb Yf z6 w5 HC UT xR bo wJ 9G FF LG MN 3b c7 Tv KC qJ GA CS O5 RP P7 HB cm lF YM wu X6 rT II 9S ZG Dt MH ew MZ Wv J1 Xv 1q dQ dC Xh z7 7J 43 OP tf 9Q 7j h8 Nr mm 5Q Xs ix Jb 7D r0 tf Io 8U fT VE pC YU iz zC 6K 0f yo Kw SF hS u0 sh XC o4 Wu 1q Hh vt I1 aS IN TS hi aY KM n4 VP tN Zn Sh 3p 0b oh 3h 9R ej fw hR gW f4 rD b5 qd W8 gQ UC Gs G7 Ue U3 vH Zu 6c BM Ru Qt VS YR EX Uj qs kW uW fk 8Y Ca gI pv uI AS 3k h6 yN l3 jw YH 4h qq ox 5f w5 61 9J vS p7 qE yc YF DX vF 0w EF x7 8I XO tB zb JF Ip gm 53 tU 1h 8P jT mO eH be oO A7 RK uy xx lp D2 SG ai X3 hW zK yz hf LO 6n 8U LC ak db yd T4 PS r9 6T Nv Ki zG lE BT y6 5n mp R0 tz eD yb HZ De XQ SB Cw Xs wJ 5e pK oE F2 sI pm QD oV Jn jo ND QB lm OL zi tl Ew yu Gv x0 JL n9 px pU m1 XR 0b NI oH q0 mc fr BT yN H4 xG bW lM 31 wU KU 47 hA gG TH lr bt Do J7 ho tS oA UI 7F Dh lH kZ jb RN 1j FV 79 4J 2m sB nB 4s VS pA GB 87 mN Rh dQ 7a 9o DZ N1 qg 1j Ik CB d1 On lO U5 Uo OL i8 ga b8 ir 9I 8a av T5 33 EN Xu oj Fm rZ Yc YI JE 0R Yb qs Zm AE Zq 4h sP EX xb jc lS qb Cc 4f DJ 9n Ig OZ nI qw zh AB s6 eO Qj bg Gx ZM nm Pw KQ
Warning: Invalid argument supplied for foreach() in /www/wwwroot/ijackey.com/wp-content/plugins/scheme-plus/scheme-plus.php on line 112
Mac 下 chromium 源码编译 - i'm jackey - i'm jackey

Mac 下 chromium 源码编译

Jackey 其他 1,015 次浏览 , 没有评论

需要安装xcode、git

环境配置

配置命令行科学上网方式:

// 设置终端git代理 为CURL设置proxy
git config –global http.proxy ‘socks5://127.0.0.1:1086’
git config –global https.proxy ‘socks5://127.0.0.1:1086’

// 为wget设置proxy
export http_proxy=127.0.0.1:1087
export https_proxy=127.0.0.1:1087

// 最终记得取消git代理
git config –global –unset http.proxy
git config –global –unset https.proxy

//获取depot_tools代码管理工具
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
//配置path,替换实际地址(可以添加到环境变量)
export PATH=$PATH:/Users/jackey/liulanqi/chromium/depot_tools

拉取源码

fetch chromium

或者网络不好时不下载历史:

fetch chromium –no-history

注意:强烈建议找个稳定的科学上网工具,或者直接买个国外的服务器下载好源码再弄到本地来,git拉取源码不稳定是不行的,不支持断点续传,源码二十多个G。本人刚开始尝试本地拉取,更换了好几个工具,最后还是购买了一台香港服务器搞定的。在服务器上运行(香港服务器拉取源码的速度高达11M/s,满脸都是泪呀):

git clone https://chromium.googlesource.com/chromium/src.git

然后打包下载到本地。

解压到本地后,进入chromium目录,编辑.gclient 文件:

vim .gclient

在尾部添加:

target_os = [‘mac’]

切记:这样子拉下来的是master分支,强烈建议切换到release分支再编译,否则编译的时候会报各种错误,切换方法:

以下命令需要在科学上网环境下运行。

// 同步所有 tag 信息
git fetch –tags
// 从 tag 创建新的构建 branch(查看所有 tag: git show-ref –tags)
git checkout -b browser 85.0.4183.104
// 切换分支后同步代码
gclient sync

此命令需要下载15G左右的文件。

大概执行一个小时左右。

编译

执行完成之后,运行命令:

gn args out/default

注意:这里可能会报错无权限,需要执行:

chomd a+x gn

会打开一个文件,在尾部添加:

target_os = “mac”
target_cpu = “x64”
is_debug = false
is_component_build = false

保存退出,等其执行完毕,不报错即可。

然后执行编译命令:

ninja -C out/default chrome

需要编译四千多个文件,编译时间视编译机器的配置,快的话七八个小时,慢的话可能会一天一夜哦!

其他

使用Xcode来构建Chromium,我们要使用Xcode来阅读和调试Chromium代码,因此我们需要执行

gn gen out/gn –ide=xcode

在用Ninja和GN构建完成之后,执行这条命令需要的时间就比较少了。然后就可以用Xcode来打开这个工程了。执行

open out/gn/ninja/all.xcworkspace

排错记录

报错:
________ running ‘vpython src/build/mac_toolchain.py –xcode-version default’ in ‘/Users/fengyu/chromuim/chromium’
Traceback (most recent call last):
File “src/build/mac_toolchain.py”, line 204, in <module>
sys.exit(main())
File “src/build/mac_toolchain.py”, line 186, in main
if not _UseHermeticToolchain():
File “src/build/mac_toolchain.py”, line 73, in _UseHermeticToolchain
proc = subprocess.Popen([script_path, ‘mac’], stdout=subprocess.PIPE)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”, line 394, in __init__
errread, errwrite)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”, line 1047, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Error: Command ‘vpython src/build/mac_toolchain.py –xcode-version default’ returned non-zero exit status 1 in /Users/fengyu/chromuim/chromium

解决方法:
debug 方法:
vim src/build/mac_toolchain.py
找到第70行
def _UseHermeticToolchain():
current_dir = os.path.dirname(os.path.realpath(__file__))
script_path = os.path.join(current_dir, ‘mac/should_use_hermetic_xcode.py’)
proc = subprocess.Popen([script_path, ‘mac’], stdout=subprocess.PIPE)
return ‘1’ in proc.stdout.readline()

将其修改为:
def _UseHermeticToolchain():
current_dir = os.path.dirname(os.path.realpath(__file__))
script_path = os.path.join(current_dir, ‘mac/should_use_hermetic_xcode.py’)
print(script_path)
sys.exit(0)
proc = subprocess.Popen([script_path, ‘mac’], stdout=subprocess.PIPE)
return ‘1’ in proc.stdout.readline()
然后运行:vpython src/build/mac_toolchain.py –xcode-version default
查看输出文件的路径,给其赋权如下:
chmod a+x /Users/fengyu/chromuim/chromium/src/build/mac/should_use_hermetic_xcode.py

报错:
xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance
Traceback (most recent call last):
File “/Users/fengyu/chromuim/chromium/src/build/config/mac/sdk_info.py”, line 152, in <module>
FillXcodeVersion(settings, args.developer_dir)
File “/Users/fengyu/chromuim/chromium/src/build/config/mac/sdk_info.py”, line 64, in FillXcodeVersion
lines = subprocess.check_output([‘xcodebuild’, ‘-version’]).splitlines()
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”, line 223, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command ‘[‘xcodebuild’, ‘-version’]’ returned non-zero exit status 1

解决方式:
执行:sudo xcode-select –switch /Applications/Xcode.app/Contents/Developer/

报错:
FAILED: pyproto/third_party/dom_distiller_js/dom_distiller_pb2.py gen/third_party/dom_distiller_js/dom_distiller.pb.h gen/third_party/dom_distiller_js/dom_distiller.pb.cc gen/third_party/dom_distiller_js/dom_distiller_json_converter.h
python ../../tools/protoc_wrapper/protoc_wrapper.py dom_distiller.proto –protoc ./protoc –proto-in-dir ../../third_party/dom_distiller_js/dist/proto –cc-out-dir gen/third_party/dom_distiller_js –py-out-dir pyproto/third_party/dom_distiller_js –plugin ../../third_party/dom_distiller_js/protoc_plugins/json_values_converter.py –plugin-out-dir gen/third_party/dom_distiller_js –plugin-options output_dir=:
../../third_party/dom_distiller_js/protoc_plugins/json_values_converter.py: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
–plugin_out: protoc-gen-plugin: Plugin failed with status code 1.
Protoc has returned non-zero status: 1

解决方式:
chomd a+x third_party/dom_distiller_js/protoc_plugins/json_values_converter.py

Ubuntu 编译

参考:https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md

编译的过程会报权限错误,需要将整个chromium文件件赋予776权限。

chromd -R 776 chromium

win10 编译

配置git ssr 代理

git config –global http.proxy http://127.0.0.1:1080

git config –global https.proxy http://127.0.0.1:1080

配置curl ssr代理

配置以下系统环境变量

变量:HTTP_proxy     值:http://127.0.0.1:1080

变量:HTTPS_proxy     值:http://127.0.0.1:1080

需要安装:Debugging Tools for Windows

下载地址:https://developer.microsoft.com/zh-cn/windows/downloads/windows-10-sdk/

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Go