Bug 434 - build system revisions
build system revisions
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: build system
ns-3-dev
All All
: P2 normal
Assigned To: Gustavo J. A. M. Carneiro
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-05 13:06 EST by Tom Henderson
Modified: 2009-03-01 09:22 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2008-12-05 13:06:35 EST
This is scheduled for ns-3.4.  Gustavo has already started working on it.

Suggested goals/requirements are discussed in this thread:
http://mailman.isi.edu/pipermail/ns-developers/2008-September/004787.html

Current status:
http://code.nsnam.org/gjc/ns-3-allinone/

This is the first draft of the 'all-in-one' system envisioned some weeks
ago.

./download.py: gets ns-3-dev, traces, and pybindgen from the network.
./build.py: builds ns-3-dev using the downloaded traces and pybindgen.

TODO: handle NSC fetching and usage from ns-3-dev.
Comment 1 Gustavo J. A. M. Carneiro 2008-12-14 18:43:27 EST
NSC part is also done now.

I think all that is missing now is the 'dist' script.
Comment 2 Gustavo J. A. M. Carneiro 2008-12-14 18:46:06 EST
And by the way, once we start using ns-3-allinone, should the bits of code that download external components during waf configure be removed?  My guess is, yes (and I would mostly agree with it), but it isn't 100% clear.
Comment 3 Tom Henderson 2008-12-16 12:23:56 EST
(In reply to comment #1)
> NSC part is also done now.
> 
> I think all that is missing now is the 'dist' script.
> 

download.py fails if bazaar is not installed.

Trying to fetch pybindgen; this will fail if no network connection is available.
  Hit Ctrl-C to skip.
 =>  bzr checkout -rrevno:605 https://launchpad.net/pybindgen pybindgen
Traceback (most recent call last):
  File "./download.py", line 184, in ?
    sys.exit(main())
  File "./download.py", line 178, in main
    get_pybindgen(ns3_dir)
  File "./download.py", line 101, in get_pybindgen
    run_command(["bzr", "checkout", rev, constants.PYBINDGEN_BRANCH, constants.L
OCAL_PYBINDGEN_PATH])
  File "/home/tomh/hg/ns-3-allinone/util.py", line 21, in run_command
    cmd = subprocess.Popen(*args, **kwargs)
  File "/usr/lib/python2.4/subprocess.py", line 542, in __init__
    errread, errwrite)
  File "/usr/lib/python2.4/subprocess.py", line 975, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

~/hg/ns-3-allinone$ which bzr
bzr: Command not found.
Comment 4 Gustavo J. A. M. Carneiro 2008-12-16 12:46:21 EST
(In reply to comment #3)
> (In reply to comment #1)
> > NSC part is also done now.
> > 
> > I think all that is missing now is the 'dist' script.
> > 
> 
> download.py fails if bazaar is not installed.

And what should we do in this case?
  1. Skip pybindgen and disable python;
  2. Catch the exception and show a more user friendly error message, but otherwise abort just the same.
Comment 5 Tom Henderson 2008-12-16 12:58:52 EST
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #1)
> > > NSC part is also done now.
> > > 
> > > I think all that is missing now is the 'dist' script.
> > > 
> > 
> > download.py fails if bazaar is not installed.
> 
> And what should we do in this case?
>   1. Skip pybindgen and disable python;
>   2. Catch the exception and show a more user friendly error message, but
> otherwise abort just the same.
> 

I would suggest to do skip pybindgen and print out a error message like we have now ("PybindGen missing and could not be retrieved)"  However, it would be nice to allow the user to manually move over pybindgen installation from somewhere else and have ./waf configure in the ns-3-dev directory later find it successfully.  

The rationale is, users may be running simulations on machines where they do not have privileges to install bzr.  But maybe they can download it on another machine and move it over.
Comment 6 Gustavo J. A. M. Carneiro 2008-12-16 13:28:13 EST
(In reply to comment #5)
> I would suggest to do skip pybindgen and print out a error message like we have
> now ("PybindGen missing and could not be retrieved)"  However, it would be nice
> to allow the user to manually move over pybindgen installation from somewhere
> else and have ./waf configure in the ns-3-dev directory later find it
> successfully.  
> 
> The rationale is, users may be running simulations on machines where they do
> not have privileges to install bzr.  But maybe they can download it on another
> machine and move it over.
 
With those requirements I think we just need to make download.py skip pybindgen with a warning but otherwise proceed and ignore it.  Then when ./build.py is run, the option --with-pybindgen=../pybindgen is passed, even if ../pybindgen isn't actually there.  Finally, ns-3's waf configure will use the --with-pybindgen option and test to see if pybindgen is there or not, and disable python bindings if not found.

To summarize, ./build.py is stateless, i.e. it does not care whether or how pybindgen was obtained.  At the moment, the only state saved between download.py and build.py is the name of the branch we are working on, stored in the BRANCH file.
Comment 7 Rajib Bhattacharjea 2009-01-21 14:18:21 EST
As far as I can tell, these changes have been pushed into ns-3-dev.  Please mark as closed if appropriate, otherwise provide next steps.
Comment 8 Gustavo J. A. M. Carneiro 2009-02-11 05:56:45 EST
Next steps:

  - Tom had suggested support versioned package directories, like nsc-0.5.0 instead of just nsc.  However this will complicate the auto-detection of packages in ns-3-dev, and require more state saving in config file(s).  Doable, but more work than it sounds.

  - Provide a 'dist' script;

  - Test the scripts in win32.

Comment 9 Gustavo J. A. M. Carneiro 2009-03-01 06:38:37 EST
(In reply to comment #8)
> Next steps:
> 
>   - Tom had suggested support versioned package directories, like nsc-0.5.0
> instead of just nsc.  However this will complicate the auto-detection of
> packages in ns-3-dev, and require more state saving in config file(s).  Doable,
> but more work than it sounds.
> 
>   - Provide a 'dist' script;

Done and done.

> 
>   - Test the scripts in win32.
> 

I will do this next.
Comment 10 Gustavo J. A. M. Carneiro 2009-03-01 07:18:02 EST
Tested/fixed.
Comment 11 Gustavo J. A. M. Carneiro 2009-03-01 09:22:09 EST
Almost forgot.  Maintainer, beware, dist.py adds a full copy of NSC.  If NSC has been built, the built binary files are included.  I just don't know how to exclude build files in NSC, since it does not cleanly separate build files from source files like waf does.  It is best to run dist.py after a clean checkout of NSC.