Building On Linux

415 views
Skip to first unread message

PhistucK

unread,
May 19, 2017, 8:47:21 AM5/19/17
to Chromium-dev
Disclaimer - I know I am trying to do something that should not be done, but hacking is fun.

So I discovered that Google Cloud Platform lets you have your own cloud shell, which is probably some virtual machine running Linux. I thought I would try to build Chromium on it. :)

The first hurdle was lsbrelease which does not exist there. I commented the code in install-build-deps.sh. Looks like it worked (or so I thought?)...
I ran gclient runhooks and for some reason, it broke because of google-play-services, but I wonder - why does it even need it? I am not building Chromium for Android, I just followed https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md.

Any idea why the Chromium for Linux hooks include anything from google-play-services?

phistuck@frequentfeedscraper:~/chromium/src$ gclient runhooks
.gclient file in parent directory /home/phistuck/chromium might not be the file you want to use

________ running '/usr/bin/python src/build/landmines.py' in '/home/phistuck/chromium'

________ running '/usr/bin/python src/tools/remove_stale_pyc_files.py src/android_webview/tools src/build/android src/gpu/gles2_conform_support src/infra src/ppapi src/printing src/third_party/catapult src/third_party/closure_compiler/build src/third_party/WebKit/Tools/Scripts src/tools' in '/home/phistuck/chromium'

________ running '/usr/bin/python src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' in '/home/phistuck/chromium'
Can't find '/home/phistuck/chromium/src/native_client/build/package_version/package_version.py'
Presumably you are intentionally building without NativeClient.
Skipping NativeClient toolchain download.

________ running '/usr/bin/python src/build/android/play_services/update.py download' in '/home/phistuck/chromium'
Traceback (most recent call last):
  File "src/build/android/play_services/update.py", line 21, in <module>
    import devil_chromium
  File "src/build/android/play_services/../devil_chromium.py", line 10, in <module>
    from pylib.constants import host_paths
  File "src/build/android/play_services/../pylib/constants/__init__.py", line 17, in <module>
    import devil.android.sdk.keyevent
ImportError: No module named devil.android.sdk.keyevent
Error: Command '/usr/bin/python src/build/android/play_services/update.py download' returned non-zero exit status 1 in /home/phistuck/chromium



PhistucK

Nico Weber

unread,
May 19, 2017, 9:08:08 AM5/19/17
to PhistucK, Chromium-dev
Up until last week, hooks couldn't run per-os, so we always run all hooks on all platforms, and each hook early-outs if it doesn't apply to the current config. (Scottmg implemented per-os hooks recently and we're going to move some of the hooks over to that soon.)

So that hook running is ok. However, the output above that (".gclient file may be wrong") looks incorrect. How did you set up your checkout? Just "fetch chromium"?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CABc02_%2BUTqcYj2g4e1rXKLuNBO8XQ7ckFafm--azNPHJC1PDKg%40mail.gmail.com.

PhistucK

unread,
May 19, 2017, 9:12:53 AM5/19/17
to Nico Weber, Chromium-dev
The guide reads -

Run the fetch tool from depot_tools to check out the code and its dependencies.

$ fetch --nohooks chromium

I just added --no-history to that (as it mentions below the command). I mean -
fetch --nohooks --no-history chromium

Regarding my .gclient file -
phistuck@frequentfeedscraper:~/chromium/src$ cd ..
phistuck@frequentfeedscraper:~/chromium$ ls -l
total 4
drwxr-xr-x 59 phistuck phistuck 4096 May 19 15:33 src
phistuck@frequentfeedscraper:~/chromium$ cat .gclient
solutions = [
  {
    "url": "https://chromium.googlesource.com/chromium/src.git",
    "managed": False,
    "name": "src",
    "deps_file": ".DEPS.git",
    "custom_deps": {},
  },
]


PhistucK

Michael Moss

unread,
May 19, 2017, 11:44:02 AM5/19/17
to phis...@gmail.com, Nico Weber, Chromium-dev
The devil modules are part of the src/third_party/catapult/ checkout. Do you not have that dir for some reason? (I did just did a clean 'fetch --nohooks --no-history chromium', and I have it, and that hook runs fine (fails fast) for me on Trusty).

Nico Weber

unread,
May 19, 2017, 11:50:02 AM5/19/17
to PhistucK, Chromium-dev
When you're in src/, what's the output of ` find .. -name .gclient`? The ".gclient file in parent directory /home/phistuck/chromium might not be the file you want to use" strongly suggests that your checkout is in a weird state somehow. `fetch` is the right way to get it, though.

PhistucK

unread,
May 19, 2017, 12:32:57 PM5/19/17
to Michael Moss, Nico Weber, Chromium-dev
No catapult in src/third_party, but... I do a few of those and they do not seem friendly -
drwx------  7 phistuck phistuck  4096 May 19 15:00 _gclient_gittmp_catapultxAM2uC
drwx------  7 phistuck phistuck  4096 May 19 15:01 _gclient_gittmp_ffmpegl5gx0b
drwx------  7 phistuck phistuck  4096 May 19 15:06 _gclient_gittmp_icuKWS8k6


PhistucK

PhistucK

unread,
May 19, 2017, 12:37:27 PM5/19/17
to Nico Weber, Chromium-dev
phistuck@frequentfeedscraper:~/chromium/src$ find .. -name .gclient
../.gclient
phistuck@frequentfeedscraper:~/chromium/src$ 


PhistucK

PhistucK

unread,
May 19, 2017, 1:31:06 PM5/19/17
to Nico Weber, Michael Moss, Chromium-dev
Sorry for wasting your precious development time. :(
I must have missed some error in the fetching process. I thought the Chromium source code (pre-build) required less than five gigabytes (the apparent limit of Cloud Console), but I guess I was wrong. :(


PhistucK

Thiago Farina

unread,
May 19, 2017, 1:35:47 PM5/19/17
to PhistucK, Nico Weber, Michael Moss, Chromium-dev
On Fri, May 19, 2017 at 2:29 PM, PhistucK <phis...@gmail.com> wrote:
Sorry for wasting your precious development time. :(
I must have missed some error in the fetching process. I thought the Chromium source code (pre-build) required less than five gigabytes (the apparent limit of Cloud Console), but I guess I was wrong. :(

And the end result will be bigger than that.

How much memory does this VM have? How many cores does it have?

--
Thiago Farina

PhistucK

unread,
May 19, 2017, 4:14:48 PM5/19/17
to Thiago Farina, Nico Weber, Michael Moss, Chromium-dev
It is possible that the end result can be bigger than that, on a non-persistent storage. That might work, I did not try.

Not too much. :)
top - 23:12:52 up 25 min,  1 user,  load average: 0.37, 0.09, 0.03
Tasks:  23 total,   1 running,  22 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.7 us,  0.0 sy,  0.0 ni, 99.0 id,  0.3 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    608680 total,   468976 used,   139704 free,    26764 buffers
KiB Swap:   786428 total,        0 used,   786428 free.   201680 cached Mem


PhistucK

Primiano Tucci

unread,
May 22, 2017, 9:00:46 AM5/22/17
to phis...@gmail.com, Thiago Farina, Nico Weber, Michael Moss, Chromium-dev, d...@chromium.org
The fact that play_services are ran as part of runhooks on != android seems a bug to me. can you please file a crbug?

By inspecting DEPS the sdkextras (which pulls exclusively play services) seems to be in the general hooks section and not in the per-platform hooks.
Hopefully that has been just a genuine oversight (easy to fix in this case) and not that we actually intend to do that for subtle reasons.

As regards lsb-release, yeah that's a problem I encountered in the past when bootstraping a chromium build in a vanilla ubuntu docker container (which doesn't have even "ping" by default, to be clear).
I think the way to fix it is:
- detect for the presence of lsb-release
- if it's not there do a separate cycle of apt-get update && apt-get install lsb-release and then carry on with the rest


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Primiano Tucci

unread,
May 22, 2017, 9:02:55 AM5/22/17
to phis...@gmail.com, Thiago Farina, Nico Weber, Michael Moss, Chromium-dev, d...@chromium.org
Ah I realized only now about the per-os hooks discussion above. I think I got confused with the --platform= argument of download_From_google_storage. Ignore the "this is a bug" above.

d...@chromium.org

unread,
May 22, 2017, 9:29:15 AM5/22/17
to Primiano Tucci, phis...@gmail.com, Thiago Farina, Nico Weber, Michael Moss, Chromium-dev, d...@chromium.org
//b/a/play_services/update.py running might not be an error, but not doing an early out should be. The code looks like it would properly do that early out, but it blows up at the import stage before having a chance to get there.

Reilly Grant

unread,
May 22, 2017, 11:50:52 AM5/22/17
to tfa...@chromium.org, PhistucK, Nico Weber, Michael Moss, Chromium-dev
Google Cloud Shell instances have 1 vCPU, 600 MB of memory and 5 GB of storage which is not nearly enough to build Chromium.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
Reply all
Reply to author
Forward
0 new messages