gn (depot-tools) utility source code.

197 views
Skip to first unread message

sow...@gmail.com

unread,
Apr 27, 2017, 2:49:06 AM4/27/17
to infra-dev
Hi,

At the outset, please let me know if I am dealing with the correct community for following question. If not, I would appreciate if you could redirect me to the correct community.

I wanted to check if source code for "gn" utility - which is part of depot-tools - is available as open source. I need this utility on power platform and at present it is only available for x86 and Mac. If it is available as open source, where could I get it's source?

Thanks,
Atul.

Takuto Ikuta

unread,
Apr 27, 2017, 2:53:22 AM4/27/17
to sow...@gmail.com, infra-dev


--
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+unsubscribe@chromium.org.
To post to this group, send email to infr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/e37b9377-6130-4647-aaf1-adc29257fe8e%40chromium.org.

sow...@gmail.com

unread,
Apr 27, 2017, 7:20:04 AM4/27/17
to infra-dev, sow...@gmail.com
@Takuto - Thanks for pointing me to the source.

Consulting docs/hacking.md file, I tried to build gn using ninja.

# ninja -C out/Debug.gn
log: ninja version 0.1.3 initializing
log: magic group: gid=0 (root)
log: entering main loop
log: generating initial pid array..
log: now monitoring process activity

After this nothing seems to happen.

Is that the correct way of building gn? I cannot use "To build gn using gn" method mentioned in hacking.md because I don't have correct gn binary to start with.

On Thursday, April 27, 2017 at 12:23:22 PM UTC+5:30, Takuto Ikuta wrote:
> Here.
> https://cs.chromium.org/chromium/src/tools/gn/
>
>
>
>
>
> 2017-04-27 15:49 GMT+09:00 <sow...@gmail.com>:
> Hi,
>
>
>
> At the outset, please let me know if I am dealing with the correct community for following question. If not, I would appreciate if you could redirect me to the correct community.
>
>
>
> I wanted to check if source code for "gn" utility - which is part of depot-tools - is available as open source. I need this utility on power platform and at present it is only available for x86 and Mac. If it is available as open source, where could I get it's source?
>
>
>
> Thanks,
>
> Atul.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "infra-dev" group.
>

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

Takuto Ikuta

unread,
Apr 27, 2017, 7:26:36 AM4/27/17
to sow...@gmail.com, infra-dev
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+unsubscribe@chromium.org.

To post to this group, send email to infr...@chromium.org.

sow...@gmail.com

unread,
Apr 27, 2017, 7:30:32 AM4/27/17
to infra-dev, sow...@gmail.com
Takuto-san,

I want a binary which will work on ppc64le/Ubuntu 16.04 - this is missing in depot-tools. Hence I want to build it from source.

On Thursday, April 27, 2017 at 4:56:36 PM UTC+5:30, Takuto Ikuta wrote:
> Please use gn in depot_tools.https://www.chromium.org/developers/how-tos/install-depot-tools
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/5fbe999f-9047-40a4-b0d7-ed34799c22f5%40chromium.org.

Daniel Bratell

unread,
Apr 27, 2017, 7:40:53 AM4/27/17
to infra-dev, sow...@gmail.com
Even if you can't use gn in depot_tools, you will still ninja from there.

Have you looked at
https://chromium.googlesource.com/chromium/src/tools/gn/+/master/bootstrap/bootstrap.py
, the script for building gn that doesn't require gn? I don't know if it's
up to date, and it still needs ninja.

/Daniel
--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

Takuto Ikuta

unread,
Apr 27, 2017, 7:58:21 AM4/27/17
to Daniel Bratell, infra-dev, sow...@gmail.com
Hmm, building gn in ppc64le sounds somewhat difficult.

I have no good idea to build gn on ppc64le.
if you have some machine which prebuilt gn can run, perhaps you can build gn on ppc64le
* generate ninja files using the machine, then modifying generated ninja files for ppc64le, or
* extract build command using ninja with -v option and modifying the commands for ppc64le.

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

To post to this group, send email to infr...@chromium.org.

Paweł Hajdan, Jr.

unread,
Apr 27, 2017, 8:08:40 AM4/27/17
to Takuto Ikuta, Daniel Bratell, infra-dev, sow...@gmail.com
+1 to using bootstrap.py

I wonder - why are you running ninja as root? I'd strongly discourage that.

Paweł

sow...@gmail.com

unread,
May 9, 2017, 7:36:23 AM5/9/17
to infra-dev, tik...@chromium.org, bra...@opera.com, sow...@gmail.com
Well, I have been trying the bootstrap.py approach but nothing seem to happen because all I see in my terminal is following:

Building gn manually in a temporary directory for bootstrapping...
log: ninja version 0.1.3 initializing
log: magic group: gid=0 (root)
log: entering main loop
log: generating initial pid array..
log: now monitoring process activity

Tried multiple times. Last time I was really very patient - allowed it to go on for about 4 hours, but nothing seemed to happen after this. Finally aborted it and got following output in my terminal:

die: got signal SIGINT -- terminating
Traceback (most recent call last):
File "./bootstrap.py", line 788, in <module>
sys.exit(main(sys.argv[1:]))
File "./bootstrap.py", line 120, in main
return run_build(tempdir, options)
File "./bootstrap.py", line 71, in run_build
build_gn_with_ninja_manually(tempdir, options)
File "./bootstrap.py", line 208, in build_gn_with_ninja_manually
check_call(cmd)
File "./bootstrap.py", line 44, in check_call
subprocess.check_call(cmd, cwd=GN_ROOT, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 536, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 523, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 1392, in wait
pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
File "/usr/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
return func(*args)
KeyboardInterrupt

Tried with "--verbose" option as well, but no additional information appeared in my terminal. So, do I need to be _more_ patient? Is this normal - does it take really long to get built?

Thanks,
Atul.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/op.yzcqp8hurbppqq%40cicero2.linkoping.osa.
>
>
>
>
>
>
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "infra-dev" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+...@chromium.org.
>
> To post to this group, send email to infr...@chromium.org.
>
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CALNjmMo07-ysK6b8F5XvXkp7H9Utn0Tf0TFayJsNZRRj6cqhyw%40mail.gmail.com.

Daniel Bratell

unread,
May 9, 2017, 7:55:14 AM5/9/17
to infra-dev, sow...@gmail.com, tik...@chromium.org
On Tue, 09 May 2017 13:36:23 +0200, <sow...@gmail.com> wrote:

> Well, I have been trying the bootstrap.py approach but nothing seem to
> happen because all I see in my terminal is following:
>
> Building gn manually in a temporary directory for bootstrapping...
> log: ninja version 0.1.3 initializing
> log: magic group: gid=0 (root)
> log: entering main loop
> log: generating initial pid array..
> log: now monitoring process activity


This would be "the other ninja"[1], not the build system ninja[2]. You
need to get the build system ninja in the path before or instead of "the
other ninja". Normally there is a ninja in depot_tools that can be used
but I'm not sure if it's available for your architecture. If not, step one
for you will be to get ninja to work.

/Daniel

[1] https://wiki.op5.org/ninja:docs:quickstart-ubuntu or
http://computerhelperzz.blogspot.se/2011/06/ninja-op5-nagios-alternative.html
[2] https://ninja-build.org/manual.html

sow...@gmail.com

unread,
May 15, 2017, 8:00:51 AM5/15/17
to infra-dev, sow...@gmail.com, tik...@chromium.org
On Tuesday, May 9, 2017 at 5:25:14 PM UTC+5:30, Daniel Bratell wrote:
[ ... snip ... ]

>
> This would be "the other ninja"[1], not the build system ninja[2]. You
> need to get the build system ninja in the path before or instead of "the
> other ninja". Normally there is a ninja in depot_tools that can be used
> but I'm not sure if it's available for your architecture. If not, step one
> for you will be to get ninja to work.
>
> /Daniel
>
> [1] https://wiki.op5.org/ninja:docs:quickstart-ubuntu or
> http://computerhelperzz.blogspot.se/2011/06/ninja-op5-nagios-alternative.html
> [2] https://ninja-build.org/manual.html
>
[ ... snip ... ]

I am able to move on with compilation (to certain extent) using this tip! Thanks Daniel! I have reach a point where nacl toolchain is required and looks like I need to make platform related changes to get pnacl build on my platform.

Best regards,
Atul.

sow...@gmail.com

unread,
May 18, 2017, 6:06:05 AM5/18/17
to infra-dev, sow...@gmail.com

I am struggling a bit to get pNaCl built on ppc64le. It is trying to build libcxx, pthread and what not, which is having issues getting built on ppc64le.

I have also been reading about the Portable Native Client and found this in the Technical Overview (https://developer.chrome.com/native-client/overview):

"Native Client expands web programming beyond JavaScript, enabling you to enhance your web applications using your preferred language."

As at the moment, I am least interested in supporting web development in any language other than JavaScript. So is there any way I can just disable the native client and associated modules from getting built?

My aim is to get a bare-necessary Chrome configuration built on ppc64le.

Thanks,
Atul.

Takuto Ikuta

unread,
May 18, 2017, 6:33:04 AM5/18/17
to sow...@gmail.com, infra-dev
Adding 'enable_nacl = false' to args.gn may help you.


Thanks,
Atul.

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

To post to this group, send email to infr...@chromium.org.

Atul Sowani

unread,
May 18, 2017, 7:02:58 AM5/18/17
to Takuto Ikuta, infra-dev
Thanks Takuto-san! Also using '-s' option helped.
Reply all
Reply to author
Forward
0 new messages