Discussion:
[zeromq-dev] CZMQ code generation
Osiris Pedroso
2016-04-25 12:47:11 UTC
Permalink
Up till now, I thought that the following command was what regenerated the
code for CZMQ project (or any other project using GSL code generation for
that matter):
```
***@OPLIN:~/git/czmq# gsl project.xml
```

But I came across the contents of CZMQ's Makemodule.am, which has this rule
in it (similar rule exist in ZYRE and MALAMUTE):
```
# Produce generated code from models in the src directory
code:
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip_msg.xml
cd $(srcdir); gsl -target:- project.xml
```

**Question #1**: What does the GSL command line options "-zproject:1" and
"-target:-" mean?
I looked in GSL's README.md and the information is not there. The word
"zproject" is nowhere in the gsl sources...
```
Options currently recognised by GSL are:

* -a argument: Pass arguments following filename to GSL script
* -q quiet: suppress routine messages
* -p parallel: process files in parallel
* -s:n size:n set script cache size - default is 1000000
* -h help: show command-line summary
* -v version: show full version information
```
**Question#2**: So, if one wants to apply GSL & ZPROJECT latest changes, is
the correct approach to "make code" to get all modules regenerated for each
of these projects then?

**Question #3**: If a contributor makes a change to a **.gsl** file, is he
expected to also regen all downstream projects affected by those changes
and PR them as well? What is the correct etiquette here?
Kevin Sapper
2016-04-25 14:29:15 UTC
Permalink
Q1:
With a minus in the gsl command you can set or override an attribute of
project e.g. `project.topdir` or `project.target`.

The snippet from Makemodule.am will re-generate all zproto models. As
zproto does generate headers for its models which might conflict with an
zproject api, zproject will be called with target "-" which means no
target. Hence only the C api will be re-generated overriding unwanted
zproto headers.

Q2:
No, `gsl project.xml` is the correct command. You'll use `make code` to
refresh zproto models.

Q3:
No, changes are applied gradually downstream there is no pressure to do it
right away. If there was a critical bug a mail to the mailing might be
appropriate though.
Post by Osiris Pedroso
Up till now, I thought that the following command was what regenerated the
code for CZMQ project (or any other project using GSL code generation for
```
```
But I came across the contents of CZMQ's Makemodule.am, which has this
```
# Produce generated code from models in the src directory
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip_msg.xml
cd $(srcdir); gsl -target:- project.xml
```
**Question #1**: What does the GSL command line options "-zproject:1" and
"-target:-" mean?
I looked in GSL's README.md and the information is not there. The word
"zproject" is nowhere in the gsl sources...
```
* -a argument: Pass arguments following filename to GSL script
* -q quiet: suppress routine messages
* -p parallel: process files in parallel
* -s:n size:n set script cache size - default is 1000000
* -h help: show command-line summary
* -v version: show full version information
```
**Question#2**: So, if one wants to apply GSL & ZPROJECT latest changes,
is the correct approach to "make code" to get all modules regenerated for
each of these projects then?
**Question #3**: If a contributor makes a change to a **.gsl** file, is he
expected to also regen all downstream projects affected by those changes
and PR them as well? What is the correct etiquette here?
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Osiris Pedroso
2016-04-25 14:53:17 UTC
Permalink
Thanks Kevin, very informative.

On Q1, I believe you answered was "-target:-" means.

What does the cmd line option "-zproject:1" mean on the line:
```
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
```
Post by Kevin Sapper
With a minus in the gsl command you can set or override an attribute of
project e.g. `project.topdir` or `project.target`.
The snippet from Makemodule.am will re-generate all zproto models. As
zproto does generate headers for its models which might conflict with an
zproject api, zproject will be called with target "-" which means no
target. Hence only the C api will be re-generated overriding unwanted
zproto headers.
No, `gsl project.xml` is the correct command. You'll use `make code` to
refresh zproto models.
No, changes are applied gradually downstream there is no pressure to do it
right away. If there was a critical bug a mail to the mailing might be
appropriate though.
Post by Osiris Pedroso
Up till now, I thought that the following command was what regenerated
the code for CZMQ project (or any other project using GSL code generation
```
```
But I came across the contents of CZMQ's Makemodule.am, which has this
```
# Produce generated code from models in the src directory
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip_msg.xml
cd $(srcdir); gsl -target:- project.xml
```
**Question #1**: What does the GSL command line options "-zproject:1" and
"-target:-" mean?
I looked in GSL's README.md and the information is not there. The word
"zproject" is nowhere in the gsl sources...
```
* -a argument: Pass arguments following filename to GSL script
* -q quiet: suppress routine messages
* -p parallel: process files in parallel
* -s:n size:n set script cache size - default is 1000000
* -h help: show command-line summary
* -v version: show full version information
```
**Question#2**: So, if one wants to apply GSL & ZPROJECT latest changes,
is the correct approach to "make code" to get all modules regenerated for
each of these projects then?
**Question #3**: If a contributor makes a change to a **.gsl** file, is
he expected to also regen all downstream projects affected by those changes
and PR them as well? What is the correct etiquette here?
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Kevin Sapper
2016-04-25 14:58:16 UTC
Permalink
Both options have equal meaning.

"-target:-" is used as input for zproject

and

"-topdir:.. -zproject:1" is equally used as input for one of zproto's
scripts.
Post by Osiris Pedroso
Thanks Kevin, very informative.
On Q1, I believe you answered was "-target:-" means.
```
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
```
Post by Kevin Sapper
With a minus in the gsl command you can set or override an attribute of
project e.g. `project.topdir` or `project.target`.
The snippet from Makemodule.am will re-generate all zproto models. As
zproto does generate headers for its models which might conflict with an
zproject api, zproject will be called with target "-" which means no
target. Hence only the C api will be re-generated overriding unwanted
zproto headers.
No, `gsl project.xml` is the correct command. You'll use `make code` to
refresh zproto models.
No, changes are applied gradually downstream there is no pressure to do
it right away. If there was a critical bug a mail to the mailing might be
appropriate though.
Post by Osiris Pedroso
Up till now, I thought that the following command was what regenerated
the code for CZMQ project (or any other project using GSL code generation
```
```
But I came across the contents of CZMQ's Makemodule.am, which has this
```
# Produce generated code from models in the src directory
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip_msg.xml
cd $(srcdir); gsl -target:- project.xml
```
**Question #1**: What does the GSL command line options "-zproject:1"
and "-target:-" mean?
I looked in GSL's README.md and the information is not there. The word
"zproject" is nowhere in the gsl sources...
```
* -a argument: Pass arguments following filename to GSL script
* -q quiet: suppress routine messages
* -p parallel: process files in parallel
* -s:n size:n set script cache size - default is 1000000
* -h help: show command-line summary
* -v version: show full version information
```
**Question#2**: So, if one wants to apply GSL & ZPROJECT latest changes,
is the correct approach to "make code" to get all modules regenerated for
each of these projects then?
**Question #3**: If a contributor makes a change to a **.gsl** file, is
he expected to also regen all downstream projects affected by those changes
and PR them as well? What is the correct etiquette here?
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Osiris Pedroso
2016-04-25 15:02:27 UTC
Permalink
Got it. Thanks!
Post by Kevin Sapper
Both options have equal meaning.
"-target:-" is used as input for zproject
and
"-topdir:.. -zproject:1" is equally used as input for one of zproto's
scripts.
Post by Osiris Pedroso
Thanks Kevin, very informative.
On Q1, I believe you answered was "-target:-" means.
```
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
```
Post by Kevin Sapper
With a minus in the gsl command you can set or override an attribute of
project e.g. `project.topdir` or `project.target`.
The snippet from Makemodule.am will re-generate all zproto models. As
zproto does generate headers for its models which might conflict with an
zproject api, zproject will be called with target "-" which means no
target. Hence only the C api will be re-generated overriding unwanted
zproto headers.
No, `gsl project.xml` is the correct command. You'll use `make code` to
refresh zproto models.
No, changes are applied gradually downstream there is no pressure to do
it right away. If there was a critical bug a mail to the mailing might be
appropriate though.
Post by Osiris Pedroso
Up till now, I thought that the following command was what regenerated
the code for CZMQ project (or any other project using GSL code generation
```
```
But I came across the contents of CZMQ's Makemodule.am, which has this
```
# Produce generated code from models in the src directory
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q sockopts.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip.xml
cd $(srcdir)/src; gsl -topdir:.. -zproject:1 -q zgossip_msg.xml
cd $(srcdir); gsl -target:- project.xml
```
**Question #1**: What does the GSL command line options "-zproject:1"
and "-target:-" mean?
I looked in GSL's README.md and the information is not there. The word
"zproject" is nowhere in the gsl sources...
```
* -a argument: Pass arguments following filename to GSL script
* -q quiet: suppress routine messages
* -p parallel: process files in parallel
* -s:n size:n set script cache size - default is 1000000
* -h help: show command-line summary
* -v version: show full version information
```
**Question#2**: So, if one wants to apply GSL & ZPROJECT latest
changes, is the correct approach to "make code" to get all modules
regenerated for each of these projects then?
**Question #3**: If a contributor makes a change to a **.gsl** file, is
he expected to also regen all downstream projects affected by those changes
and PR them as well? What is the correct etiquette here?
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Loading...