Re: [chromium-dev] Modifying .gyp files
Really? At least, it does not seem to be the case for make generator. There are no rules for handling .proto files in make generator. That's actually what I've been trying to do in the last couple of days. On Sun, Dec 27, 2009 at 12:47 PM, Mark Mentovai m...@chromium.org wrote: Igor Gatis wrote: Is there a wishlist? I'd like to vote for support for both configure step and .proto files. GYP rules should be able to support .proto files. -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Igor Gatis wrote: Really? At least, it does not seem to be the case for make generator. There are no rules for handling .proto files in make generator. That's actually what I've been trying to do in the last couple of days. GYP rules are something that you have to write yourself, there aren't any pre-baked ones other than the native support each environment provides to compile C++. A GYP rule applies to input files in a 'sources' section based on the file's extension. Look at the 'rules' sections in some of Chromium's .gyp files for examples. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Great, just wrote a rule for that. I placed it on the final target of my project. What would be nice is to define such rule on the protobuf library gyp and export it. It seems this file does thathttp://page-speed.googlecode.com/svn-history/r310/firefox_addon/trunk/src/pagespeed_firefox/pagespeed_firefox.gyp. But when I try doing the same, I get the following error: Traceback (most recent call last): File /home/wgatis/google-apis/tools/third_party/gyp/gyp, line 18, in module sys.exit(gyp.main(sys.argv[1:])) File /home/wgatis/google-apis/tools/third_party/gyp/pylib/gyp/__init__.py, line 432, in main generator.GenerateOutput(flat_list, targets, data, params) File /home/wgatis/google-apis/tools/third_party/gyp/pylib/gyp/generator/make.py, line 1104, in GenerateOutput part_of_all=qualified_target in needed_targets) File /home/wgatis/google-apis/tools/third_party/gyp/pylib/gyp/generator/make.py, line 480, in Write self.WriteRules(spec['rules'], extra_sources, extra_outputs, part_of_all) File /home/wgatis/google-apis/tools/third_party/gyp/pylib/gyp/generator/make.py, line 606, in WriteRules for rule_source in rule['rule_sources']: KeyError: 'rule_sources' I attached my protobuf gyp file. On Sun, Dec 27, 2009 at 2:01 PM, Mark Mentovai m...@chromium.org wrote: Igor Gatis wrote: Really? At least, it does not seem to be the case for make generator. There are no rules for handling .proto files in make generator. That's actually what I've been trying to do in the last couple of days. GYP rules are something that you have to write yourself, there aren't any pre-baked ones other than the native support each environment provides to compile C++. A GYP rule applies to input files in a 'sources' section based on the file's extension. Look at the 'rules' sections in some of Chromium's .gyp files for examples. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev protobuf.gyp Description: Binary data
Re: [chromium-dev] Modifying .gyp files
Igor Gatis igorga...@gmail.com wrote: Great, just wrote a rule for that. I placed it on the final target of my project. What would be nice is to define such rule on the protobuf library gyp and export it. It seems this file does that. But when I try doing the same, I get the following error: [...] File /home/wgatis/google-apis/tools/third_party/gyp/pylib/gyp/generator/make.py, line 606, in WriteRules for rule_source in rule['rule_sources']: KeyError: 'rule_sources' Sounds like a bug in the make generator. It shouldn't be an error to define a rule but not have any sources that match its extension in a specific target. Try changing line 606 of make.py to: for rule_source in rule.get('rule_sources', []): although that may be incomplete: you may also need to keep the block at lines 666-668 from executing if |not 'rule_sources' in rule| too. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
I used a custom action with success and I believe that sounds better for module updates purposes. We used to do things like that in the pre-GYP days. When we moved our builds over to GYP, we decided that it wasn't anywhere near worthwhile. It inflated build times (autoconf's configure is SLOW) and was difficult to capture dependency data properly and get the output in the right place. I don't recommend adding configure steps when you can configure once for the platforms you need and check the results in. I see. Well, if you see GYP as a self-contained tool, support for configure sounds pretty handy especially for those who do not care about first make call being slow. I'd say user might specify both input and output files (being optional). Is there a wishlist? I'd like to vote for support for both configure step and .proto files. -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
http://code.google.com/p/gyp/issues/list http://code.google.com/p/gyp/issues/listSearch for the issue or create a new one. ☆PhistucK On Sun, Dec 27, 2009 at 04:08, Igor Gatis igorga...@gmail.com wrote: I used a custom action with success and I believe that sounds better for module updates purposes. We used to do things like that in the pre-GYP days. When we moved our builds over to GYP, we decided that it wasn't anywhere near worthwhile. It inflated build times (autoconf's configure is SLOW) and was difficult to capture dependency data properly and get the output in the right place. I don't recommend adding configure steps when you can configure once for the platforms you need and check the results in. I see. Well, if you see GYP as a self-contained tool, support for configure sounds pretty handy especially for those who do not care about first make call being slow. I'd say user might specify both input and output files (being optional). Is there a wishlist? I'd like to vote for support for both configure step and .proto files. -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
You mean they were manually pre-created, right? I used a custom action with success and I believe that sounds better for module updates purposes. Perhaps we should consider adding a new target type, say, 'config', which would invoke configure automatically. On Fri, Dec 11, 2009 at 12:07 PM, Mikhail Naganov mnaga...@chromium.orgwrote: You may look at e.g. third_party/libxml. 'config.h' files are pre-created for each platform ({linux|mac|win32}/config.h), then an appropriate include dir is chosen for the particular platform (see libxml.gyp). On Fri, Dec 11, 2009 at 16:39, Igor Gatis igorga...@gmail.com wrote: This is great. Thanks a lot. Final question: I've included a third_party module which uses autotools. I wrote a .gyp for this module. When I try to build it using make, it complains because config.h is missing - how should I fix that? Is there a way standard way to make it run configure or I should add a custom action for that? Thanks, -Igor On Thu, Dec 10, 2009 at 1:55 PM, Mikhail Naganov mnaga...@chromium.org wrote: http://code.google.com/p/gyp/w/list On Thu, Dec 10, 2009 at 18:49, Igor Gatis igorga...@gmail.com wrote: Thanks Mark. BTW, do you guys know of lists or wiki I could get more information regarding GYP tool? On Wed, Dec 9, 2009 at 5:40 PM, Mark Mentovai m...@chromium.org wrote: There's better info in gclient.py, as a comment. Maybe we can just rip this off and stick it in a web page somewhere on the developer site. Hooks .gclient and DEPS files may optionally contain a list named hooks to allow custom actions to be performed based on files that have changed in the working copy as a result of a sync/update or revert operation. This could be prevented by using --nohooks (hooks run by default). Hooks can also be forced to run with the runhooks operation. If sync is run with --force, all known hooks will run regardless of the state of the working copy. Each item in a hooks list is a dict, containing these two keys: pattern The associated value is a string containing a regular expression. When a file whose pathname matches the expression is checked out, updated, or reverted, the hook's action will run. action A list describing a command to run along with its arguments, if any. An action command will run at most one time per gclient invocation, regardless of how many files matched the pattern. The action is executed in the same directory as the .gclient file. If the first item in the list is the string python, the current Python interpreter (sys.executable) will be used to run the command. If the list contains string $matching_files it will be removed from the list and the list will be extended by the list of matching files. Example: hooks = [ { pattern: \\.(gif|jpe?g|pr0n|png)$, action: [python, image_indexer.py, --all]}, ] Marc-Antoine Ruel wrote: Humm, that's a good question. Right now the only doc is gclient help runhooks which is .. uh .. not really useful. M-A On Wed, Dec 9, 2009 at 3:28 PM, Igor Gatis igorga...@gmail.com wrote: Is there documentation somewhere regarding gclient? I'd like to know more about how hooks and other gclient features work. On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Igor Gatis wrote: You mean they were manually pre-created, right? Yes I used a custom action with success and I believe that sounds better for module updates purposes. We used to do things like that in the pre-GYP days. When we moved our builds over to GYP, we decided that it wasn't anywhere near worthwhile. It inflated build times (autoconf's configure is SLOW) and was difficult to capture dependency data properly and get the output in the right place. I don't recommend adding configure steps when you can configure once for the platforms you need and check the results in. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Thanks Mark. BTW, do you guys know of lists or wiki I could get more information regarding GYP tool? On Wed, Dec 9, 2009 at 5:40 PM, Mark Mentovai m...@chromium.org wrote: There's better info in gclient.py, as a comment. Maybe we can just rip this off and stick it in a web page somewhere on the developer site. Hooks .gclient and DEPS files may optionally contain a list named hooks to allow custom actions to be performed based on files that have changed in the working copy as a result of a sync/update or revert operation. This could be prevented by using --nohooks (hooks run by default). Hooks can also be forced to run with the runhooks operation. If sync is run with --force, all known hooks will run regardless of the state of the working copy. Each item in a hooks list is a dict, containing these two keys: pattern The associated value is a string containing a regular expression. When a file whose pathname matches the expression is checked out, updated, or reverted, the hook's action will run. action A list describing a command to run along with its arguments, if any. An action command will run at most one time per gclient invocation, regardless of how many files matched the pattern. The action is executed in the same directory as the .gclient file. If the first item in the list is the string python, the current Python interpreter (sys.executable) will be used to run the command. If the list contains string $matching_files it will be removed from the list and the list will be extended by the list of matching files. Example: hooks = [ { pattern: \\.(gif|jpe?g|pr0n|png)$, action: [python, image_indexer.py, --all]}, ] Marc-Antoine Ruel wrote: Humm, that's a good question. Right now the only doc is gclient help runhooks which is .. uh .. not really useful. M-A On Wed, Dec 9, 2009 at 3:28 PM, Igor Gatis igorga...@gmail.com wrote: Is there documentation somewhere regarding gclient? I'd like to know more about how hooks and other gclient features work. On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
http://code.google.com/p/gyp has some wiki pages. On Thu, Dec 10, 2009 at 10:49 AM, Igor Gatis igorga...@gmail.com wrote: Thanks Mark. BTW, do you guys know of lists or wiki I could get more information regarding GYP tool? On Wed, Dec 9, 2009 at 5:40 PM, Mark Mentovai m...@chromium.org wrote: There's better info in gclient.py, as a comment. Maybe we can just rip this off and stick it in a web page somewhere on the developer site. Hooks .gclient and DEPS files may optionally contain a list named hooks to allow custom actions to be performed based on files that have changed in the working copy as a result of a sync/update or revert operation. This could be prevented by using --nohooks (hooks run by default). Hooks can also be forced to run with the runhooks operation. If sync is run with --force, all known hooks will run regardless of the state of the working copy. Each item in a hooks list is a dict, containing these two keys: pattern The associated value is a string containing a regular expression. When a file whose pathname matches the expression is checked out, updated, or reverted, the hook's action will run. action A list describing a command to run along with its arguments, if any. An action command will run at most one time per gclient invocation, regardless of how many files matched the pattern. The action is executed in the same directory as the .gclient file. If the first item in the list is the string python, the current Python interpreter (sys.executable) will be used to run the command. If the list contains string $matching_files it will be removed from the list and the list will be extended by the list of matching files. Example: hooks = [ { pattern: \\.(gif|jpe?g|pr0n|png)$, action: [python, image_indexer.py, --all]}, ] Marc-Antoine Ruel wrote: Humm, that's a good question. Right now the only doc is gclient help runhooks which is .. uh .. not really useful. M-A On Wed, Dec 9, 2009 at 3:28 PM, Igor Gatis igorga...@gmail.com wrote: Is there documentation somewhere regarding gclient? I'd like to know more about how hooks and other gclient features work. On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
http://code.google.com/p/gyp/w/list On Thu, Dec 10, 2009 at 18:49, Igor Gatis igorga...@gmail.com wrote: Thanks Mark. BTW, do you guys know of lists or wiki I could get more information regarding GYP tool? On Wed, Dec 9, 2009 at 5:40 PM, Mark Mentovai m...@chromium.org wrote: There's better info in gclient.py, as a comment. Maybe we can just rip this off and stick it in a web page somewhere on the developer site. Hooks .gclient and DEPS files may optionally contain a list named hooks to allow custom actions to be performed based on files that have changed in the working copy as a result of a sync/update or revert operation. This could be prevented by using --nohooks (hooks run by default). Hooks can also be forced to run with the runhooks operation. If sync is run with --force, all known hooks will run regardless of the state of the working copy. Each item in a hooks list is a dict, containing these two keys: pattern The associated value is a string containing a regular expression. When a file whose pathname matches the expression is checked out, updated, or reverted, the hook's action will run. action A list describing a command to run along with its arguments, if any. An action command will run at most one time per gclient invocation, regardless of how many files matched the pattern. The action is executed in the same directory as the .gclient file. If the first item in the list is the string python, the current Python interpreter (sys.executable) will be used to run the command. If the list contains string $matching_files it will be removed from the list and the list will be extended by the list of matching files. Example: hooks = [ { pattern: \\.(gif|jpe?g|pr0n|png)$, action: [python, image_indexer.py, --all]}, ] Marc-Antoine Ruel wrote: Humm, that's a good question. Right now the only doc is gclient help runhooks which is .. uh .. not really useful. M-A On Wed, Dec 9, 2009 at 3:28 PM, Igor Gatis igorga...@gmail.com wrote: Is there documentation somewhere regarding gclient? I'd like to know more about how hooks and other gclient features work. On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Is there documentation somewhere regarding gclient? I'd like to know more about how hooks and other gclient features work. On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Humm, that's a good question. Right now the only doc is gclient help runhooks which is .. uh .. not really useful. M-A On Wed, Dec 9, 2009 at 3:28 PM, Igor Gatis igorga...@gmail.com wrote: Is there documentation somewhere regarding gclient? I'd like to know more about how hooks and other gclient features work. On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
There's better info in gclient.py, as a comment. Maybe we can just rip this off and stick it in a web page somewhere on the developer site. Hooks .gclient and DEPS files may optionally contain a list named hooks to allow custom actions to be performed based on files that have changed in the working copy as a result of a sync/update or revert operation. This could be prevented by using --nohooks (hooks run by default). Hooks can also be forced to run with the runhooks operation. If sync is run with --force, all known hooks will run regardless of the state of the working copy. Each item in a hooks list is a dict, containing these two keys: pattern The associated value is a string containing a regular expression. When a file whose pathname matches the expression is checked out, updated, or reverted, the hook's action will run. action A list describing a command to run along with its arguments, if any. An action command will run at most one time per gclient invocation, regardless of how many files matched the pattern. The action is executed in the same directory as the .gclient file. If the first item in the list is the string python, the current Python interpreter (sys.executable) will be used to run the command. If the list contains string $matching_files it will be removed from the list and the list will be extended by the list of matching files. Example: hooks = [ { pattern: \\.(gif|jpe?g|pr0n|png)$, action: [python, image_indexer.py, --all]}, ] Marc-Antoine Ruel wrote: Humm, that's a good question. Right now the only doc is gclient help runhooks which is .. uh .. not really useful. M-A On Wed, Dec 9, 2009 at 3:28 PM, Igor Gatis igorga...@gmail.com wrote: Is there documentation somewhere regarding gclient? I'd like to know more about how hooks and other gclient features work. On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
[chromium-dev] Modifying .gyp files
When I change a .gyp, do I need to call gyp or the build process does that for me? If it does, how does it detect the .gyp file has been modified? -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? If it does, how does it detect the .gyp file has been modified? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
Got it, thanks. BTW, it might be worth mentioning that somewhere, perhaps here: http://www.chromium.org/developers/quick-reference On Tue, Dec 8, 2009 at 6:27 PM, Mark Mentovai mmento...@google.com wrote: Igor Gatis wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? When you change it yourself, in your own working copy, you run gclient runhooks to get new files generated. When a .gyp change is checked in, you don't need to do this: gclient will automatically run GYP as needed when you run gclient sync. Mark -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev
Re: [chromium-dev] Modifying .gyp files
On Tue, Dec 8, 2009 at 12:23 PM, Igor Gatis igorga...@gmail.com wrote: When I change a .gyp, do I need to call gyp or the build process does that for me? If it does, how does it detect the .gyp file has been modified? On Linux, when you run make it will rerun gyp on your behalf if any gyp files changed. See the rule in the root Makefile that starts with Makefile: . -- Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev