Please try using GN in simple chrome workflow

148 views
Skip to first unread message

Ryo Hashimoto

unread,
Apr 18, 2016, 2:39:53 AM4/18/16
to chromiu...@chromium.org
Hello,

After crrev.com/387726, you can use GN in the simple chrome workflow.
(Huge thanks to stevenjb@ for handling chromite license problem!)
Please try using it as we are to deprecate GYP in favor of GN.

How to use:
0. Have an up-to-date Chromium check out, and run "cros chrome-sdk --board=$BOARD".
1. Generate ninja files (quotes are necessary):
gn gen out_$BOARD/gn --args="$GN_ARGS treat_warnings_as_errors=false"
2. Build chrome and relatives:
ninja -C out_$BOARD/gn chrome chrome_sandbox nacl_helper
3. Deploy chrome to your device:
deploy_chrome --build-dir=out_$BOARD/gn --to=<your device>

Known issues:
- Currently, "treat_warnings_as_errors=false" is needed (crbug.com/589724).
- GN complains about an unknown argument "use_mesa_platform_null" (already fixed)
- Board specific compiler flags (e.g. -mtune, -mfpu) are ignored (crbug.com/595653)

Please file a bug if you find anything not working well.

Thanks!

Rahul Chaturvedi

unread,
Apr 18, 2016, 12:53:47 PM4/18/16
to Ryo Hashimoto, Chromium OS dev
This is awesome!

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en


Steven Bennetts

unread,
Apr 18, 2016, 7:07:54 PM4/18/16
to Ryo Hashimoto, Chromium OS dev
Thanks a ton Ryo for all your work to get this going!

I have added a GN section to the Building Chromium for Chromium OS (simple chrome) page.

I strongly encourage everyone to switch to GN for both Linux (with or without chromeos=1) and Simple Chrome.

Instructions for linux-chromeos have been updated for GN.

As Ryo mentioned, please file a bug if you have any issues. You should label it with Build-Tools-GN. If you assign it to me I will make sure that it gets triaged.

We will be deprecating GYP support for linux-chromeos and Simple Chrome soon.

NOTE: We still have some work to do to get GN working for chroot builds. If you are interested in hacking on the chromeos-chrome ebuild, please let me know!



--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

---
You received this message because you are subscribed to the Google Groups "Chromium OS dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Jenny Zhang(章瑛)

unread,
Aug 1, 2016, 6:10:16 PM8/1/16
to Steven Bennetts, Ryo Hashimoto, Chromium OS dev
The simple chrome built with gn is too big to deploy on my samus device, it run out of the space. Any workaround?

Thanks,

Jenny

Steven Bennetts

unread,
Aug 1, 2016, 6:33:00 PM8/1/16
to Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
1. Make sure you have an updated chrome checkout. For a while we were building a chrome image that was ~6% larger after the GN migration, but this has been fixed.

2. If that doesn't work, you may need to re-image your device with a more recent dev image. Chrome is still about 1% larger with GN so there may not be enough extra headroom in an older image.

There are also some other workarounds in YAQS:

Achuith Bhandarkar

unread,
Aug 1, 2016, 6:49:48 PM8/1/16
to Steven Bennetts, Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
How big is your chrome? Are you sure you're building a Release build?

Rahul Chaturvedi

unread,
Aug 1, 2016, 6:53:25 PM8/1/16
to Achuith Bhandarkar, Steven Bennetts, Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
try,
(on the device, as root) mkdir /var/work/chrome
(on the host) deploy_chrome --build-dir=out_link/Release --to=$DEVICE_IP --target-dir=/var/work/chrome --mount


Satoru Takabayashi

unread,
Aug 5, 2016, 2:17:45 AM8/5/16
to Rahul Chaturvedi, Achuith Bhandarkar, Steven Bennetts, Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
I followed the simplechrome workflow as-is and got "Not enough free space on the device" with deploy_chrome. Here's some findings:

On the device side (squawks): 

- I have a test image versioned R54-8662.0.0 (Chrome 54.0.2813.0)  installed.
- /opt/google/chrome/chrome is 115MB

On the workstation side:

- chrome binary is 161MB (synced at #409960 and stripped in the staging directory [1])
- There are many lib*_library.so such as libui_library.so in the Release directory but these weren't included in the output of 'ldd chrome'

Two questions:

1) Why is chrome binary built locally considerably bigger?
2) Why are lib*_library.so built if these are not needed by the chrome binary?

With lib*_library.so removed from the Release directory, deploy_chrome passed the free space check, but failed in the end:

    rsync: write failed on "/opt/google/chrome/chrome": No space left on device (28)

Looking at the device, the copy ended at 151MB out of 161MB. It was very close! :)

Passing --target-dir=... --mount would work around the problem, but I'd like deploy_chrome to just work without additional flags. However, if it's no longer feasible, I think we should update the doc and include the required options.

[1] You can check the contents in the staging directory created by deploy_chrome by by passing --staging-only --staging-dir=... --build-dir=... options.



To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dev+unsubscribe@chromium.org.

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

---
You received this message because you are subscribed to the Google Groups "Chromium OS dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dev+unsubscribe@chromium.org.


--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

Satoru Takabayashi

unread,
Aug 5, 2016, 3:30:13 AM8/5/16
to Rahul Chaturvedi, Achuith Bhandarkar, Steven Bennetts, Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
On Fri, Aug 5, 2016 at 3:17 PM, Satoru Takabayashi <sat...@chromium.org> wrote:
I followed the simplechrome workflow as-is and got "Not enough free space on the device" with deploy_chrome. Here's some findings:

On the device side (squawks): 

- I have a test image versioned R54-8662.0.0 (Chrome 54.0.2813.0)  installed.
- /opt/google/chrome/chrome is 115MB

On the workstation side:

- chrome binary is 161MB (synced at #409960 and stripped in the staging directory [1])
- There are many lib*_library.so such as libui_library.so in the Release directory but these weren't included in the output of 'ldd chrome'

Two questions:

1) Why is chrome binary built locally considerably bigger?

Noticed that the binary contained a section named '.GCC.command.line' which was about 9MB. Stripping it reduced the binary size from 161MB to 152MB.

Rahul Chaturvedi

unread,
Aug 5, 2016, 11:59:36 AM8/5/16
to Satoru Takabayashi, Achuith Bhandarkar, Steven Bennetts, Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
Chrome that we'd want to push while development can be larger than the one on device for many reasons (different build type, more debug symbols).

It would be pretty awesome if deploy_chrome automatically (maybe after a user prompt?) changed the mount location to one on the stateful partition if the install fails due to size.

Steven Bennetts

unread,
Aug 5, 2016, 12:19:09 PM8/5/16
to Rahul Chaturvedi, Satoru Takabayashi, Achuith Bhandarkar, Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
Hey Satoru, could you file an issue for this?

We spent some time ensuring that the binaries built in the chroot were similar size pre and post GN migration, but we haven't done a lot of analysis with SimpleChrome (and there are a fair number of differences). You can assign it to me and I will cc the folks that are most likely to be able to solve this reasonably quickly. Unfortunately divining in to the chrome sdk scripts is always a time consuming process.

Cheers,
Steven

Satoru Takabayashi

unread,
Aug 7, 2016, 9:54:38 PM8/7/16
to Steven Bennetts, Rahul Chaturvedi, Achuith Bhandarkar, Jenny Zhang(章瑛), Ryo Hashimoto, Chromium OS dev
Filed: crbug.com/635374. Will update the bug if I find new things.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages