Re: More flexible create-module.py and contrib/wscript (issue 343030043 by pdbj@mac.com)

15 views
Skip to first unread message

tomh...@gmail.com

unread,
Oct 8, 2018, 3:05:12 PM10/8/18
to pd...@mac.com, ns-3-r...@googlegroups.com, re...@codereview-hr.appspotmail.com
I support merging this, although my testing of it today suggests it may
need tweaking.

$ python utils/create-module.py mymodule
Project src already exists
Creating module src/mymodule

Successfully created new modules
Run './waf configure' to include them in the build

Do we make 'src' or 'contrib' the default? I might suggest the latter.

Do we require consistency that 'src' or 'contrib' must be explicitly
specified? The implicit 'src' project causes some problems; e.g.:

This does not work as I would expect:

$ python utils/create-module.py src/mysecondmodule
Project src already exists
Creating module src/src/mysecondmodule
Traceback (most recent call last):
File "utils/create-module.py", line 484, in <module>
sys.exit(main(sys.argv))
File "utils/create-module.py", line 473, in main
ok = make_module(modpath, modname)
File "utils/create-module.py", line 394, in make_module
os.mkdir(moduledir)
OSError: [Errno 2] No such file or directory:
'src/src/mysecondmodule'

This also doesn't work as documented:

$ python utils/create-module.py contrib/mycontribmodule
Project src already exists
Creating module src/contrib/mycontribmodule
Traceback (most recent call last):
File "utils/create-module.py", line 484, in <module>
sys.exit(main(sys.argv))
File "utils/create-module.py", line 473, in main
ok = make_module(modpath, modname)
File "src/create-module.py", line 394, in make_module
os.mkdir(moduledir)
OSError: [Errno 2] No such file or directory:
'src/contrib/mycontribmodule'

Also, a similar error occurs if the user specifies the wrong project,
such as mistakenly trying to add the module to the 'utils' directory.

python utils/create-module.py utils/myutilsmodule
...
OSError: [Errno 2] No such file or directory:
'src/utils/myutilsmodule'







https://codereview.appspot.com/343030043/

pd...@mac.com

unread,
Oct 9, 2018, 10:57:52 AM10/9/18
to tomh...@gmail.com, ns-3-r...@googlegroups.com, re...@codereview-hr.appspotmail.com
On 2018/10/08 19:05:11, Tom Henderson wrote:
> Do we make 'src' or 'contrib' the default? I might suggest the
latter.

> The implicit 'src' project causes some problems; e.g.:

> This does not work as I would expect:

> This also doesn't work as documented:

> Also, a similar error occurs if the user specifies the wrong project,
such as

Thanks for testing and providing failing examples. We'll do some more
work and post a revised patch.
Peter

https://codereview.appspot.com/343030043/
Reply all
Reply to author
Forward
0 new messages