fuchsia编译

fuchsia代码主要在搜索网站的源码站,本地开发环境为Ubuntu 16.04.3,如下:

$ cat /etc/issue
Ubuntu 16.04.3 LTS \n \l

 

以下命令下载fuchsia工程代码,curl的-s选项开启静默模式,减少打印信息:

$ curl -s "https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT" | base64 --decode | bash
~/work/fuchsia/.jiri_root/bin ~/work
cipd bootstrapped to path:"/home/kai/work/fuchsia/.jiri_root/bin/cipd"
~/work
Please add /home/kai/work/fuchsia/.jiri_root/bin to your PATH

Updating all projects
WARN: Some packages are skipped by cipd due to lack of access, you might want to run "cipd auth-login" and try again
ERROR: context deadline exceeded

期间遇到以上的错误,按照提示执行cipd auth-login命令,打开浏览器访问网址:https://www.googleapis.com/auth/userinfo.email,登录gmail账号,获取到激活码,如下配置:

$ fuchsia/buildtools/cipd auth-login
Getting a refresh token with following OAuth scopes:
  * https://www.googleapis.com/auth/userinfo.email

Visit the following URL to get the authorization code and copy-paste it below.

https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&client_id=446450136466-2hr92jrq8e6i4tnsa56b52vacp7t3936.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email

Authorization code: 4/ZQGDaew4WF2dfasdfsdfsdfasdfasdgsfgsdfasdqPctRLcdLG9vgh0Q

Logged in as myemail@gmail.com.
OAuth token details:
  Client ID: 448675635347546-2hr92jrq8e6i4tnsa56b52vacp7t3936.apps.googleusercontent.com
  Scopes:
    https://www.googleapis.com/auth/userinfo.email
    openid

 

再次运行curl命令:

$ curl -s  "https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT" | base64 --decode | bash
~/work/fuchsia/.jiri_root/bin ~/work
cipd bootstrapped to path:"/home/kai/work/fuchsia/.jiri_root/bin/cipd"
~/work
Please add /home/kai/work/fuchsia/.jiri_root/bin to your PATH

Updating all projects
Done creating a Platform Source Tree at "/home/kai/work/fuchsia".
Recommended: export PATH="/home/kai/work/fuchsia/.jiri_root/bin:$PATH"

 

代码下载完成之后,按照提示配置PATH环境变量:

$ export PATH="/home/kai/work/fuchsia/.jiri_root/bin:$PATH"

 

如下所示,将cipd、fx和jiri三个程序添加到了执行路径PATH中。

$ ls fuchsia/.jiri_root/bin/ -l
total 27248
-rwxr-xr-x 1 kai kai 15317191 6月  10 10:43 cipd
lrwxrwxrwx 1 kai kai       16 6月  10 13:43 fx -> ../../scripts/fx
-rwxr-xr-x 1 kai kai 12579551 6月  10 13:39 jiri

 

设置编译目标,其中最后的参数格式为:PRODUCT.BOARD。可使用命令fx list-products和fx list-boards分别参考可用的product和board参数。

fuchsia$ fx set core.x64                              

Generating compile_commands took 363ms
Done. Made 26117 targets from 2168 files in 37189ms
fuchsia$ 

 

最后,运行fuchsia的编译命令:

fuchsia$ fx build

 

END

 

©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页