The ns-3 Network Simulator Project

Extend bake build tool to allow shallow git clones

The issue for which a patch is requested is here: https://gitlab.com/nsnam/bake/issues/1

Specifically, these commands can be used to download our most recent release:

$ git clone https://gitlab.com/nsnam/bake.git
$ cd bake
$ ./bake.py configure -e ns-3.30.1
$ ./bake.py download

and two git repositories (and one Mercurial repository) will be downloaded into the source directory. (you can safely ignore if it skips some repositories identified as a 'Problem'; these are likely due to lack of system dependencies to download optional components).

Note, if you want to clean out these source directories, run

$ ./bake.py fullclean

The two git repositories are called 'ns-3.30.1' and 'pybindgen'. If you cd into those directories, you can see that they have a full git history:

$ cd source/ns-3.30.1
$ git log

Your job on this task is to extend the bake tool (the implementation is in the directory 'bake') so that users may optionally pass a --depth= argument to the download phase of bake, and a git shallow clone will be downloaded (with the appropriate depth).

Please submit the patch that allows a user to successfully run these commands instead, where depth is any integer that the git --depth option allows:

$ git clone https://gitlab.com/nsnam/bake.git
$ cd bake
$ ./bake.py configure -e ns-3.30.1
$ ./bake.py download --depth=<N>

Your option should also display in the help text shown by this command:

$ ./bake.py download --help

The mercurial repository (netanim-3.108) can be skipped.

Task tags

  • python

Students who completed this task

hax0kartik, pterp

Task type

  • code Code
close

2019