Bug 1682

Summary: ./waf crashes on FC10
Product: ns-3 Reporter: Nicola Baldo <nicola>
Component: build systemAssignee: Vedran Miletić <vedran>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, tomh, tommaso.pecorella, vedran
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Possible fix

Description Nicola Baldo 2013-05-13 10:36:50 UTC
ns-3-dev changeset:   9755:92b68bcb87f6

building on a Fedora Core 10 (gcc 4.3.2, python 2.5.2)

# hg clone http://code.nsnam.org/ns-3-dev

# cd ns-3-dev

# ./waf configure --enable-modules=lte --enable-examples --enable-tests
Traceback (most recent call last):
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Scripting.py", line 149, in run_commands
    parse_options()
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Scripting.py", line 127, in parse_options
    Context.create_context('options').execute()
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Options.py", line 134, in execute
    super(OptionsContext,self).execute()
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Context.py", line 87, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/root/ns-3-dev/wscript", line 209, in options
    opt.recurse('src')
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/root/ns-3-dev/src/wscript", line 44, in options
    opt.load('boost', tooldir=['waf-tools'])
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Context.py", line 81, in load
    module=load_tool(t,path)
  File "/root/ns-3-dev/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Context.py", line 296, in load_tool
    __import__(tool)
  File "waf-tools/boost.py", line 359
     except Errors.ConfigurationError as exc:
                                       ^
 SyntaxError: invalid syntax


same error with simply "./waf" and other commands such as "./waf clean", "./waf  distclean", etc.
Comment 1 Nicola Baldo 2013-05-15 07:18:10 UTC
I've found that the problem is solved by updating waf-tools/boost.py to a more recent version which I found here:
https://code.google.com/p/waf/source/browse/waflib/extras/boost.py?r=95449949a237133e8651a2e3fc3fa9e671e86608
Comment 2 Tommaso Pecorella 2013-07-09 16:54:52 UTC
Is this bug still valid ?

T.
Comment 3 Nicola Baldo 2013-07-10 05:27:16 UTC
yes, I just tested with changeset:   9919:5596934962c2
and the bug is still there
Comment 4 Vedran Miletić 2013-07-10 06:20:32 UTC
I can take a look at this if someone can provide me SSH to FC10 machine.
Comment 5 Tommaso Pecorella 2013-07-10 06:24:35 UTC
I think it's worth checking if changing the boost.py fixes the issue (and if it doesn't bring issues to other OSes).

Unfortunately I don't have a FC10 available. Maybe there's one on Jenkins.

T.
Comment 6 Vedran Miletić 2013-07-10 06:28:38 UTC
I actually wonder if this is a result of our modifications, since we took latest boost.py with waf upgrade.
Comment 7 Nicola Baldo 2013-07-10 06:35:25 UTC
Unfortunately I can't give you ssh access to the FC10 machine I am using. However I can test other versions of boost.py if you wish.
Comment 8 Tommaso Pecorella 2013-07-10 06:43:57 UTC
Vedran is right, it is one of our modifications to that file.

If you check the differences between the "original" boost.py and "our" boost.py, the error message pints to one of our additions.

			for cxxflags in (['/MD', '/EHsc'], []):
				self.env.stash()
				self.env["CXXFLAGS_%s" % var] += cxxflags
				try:
					try_link()
					self.end_msg("ok: winning cxxflags combination: %s" % (self.env["CXXFLAGS_%s" % var]))
					e = None
					break
				except Errors.ConfigurationError as exc:
					self.env.revert()
					e = exc

And from this point on, I'll leave it to whoever knows something about Python. For me it's more or less like reading Chinese.
Comment 9 Tommaso Pecorella 2013-07-10 06:54:24 UTC
This might be relevant...

http://www.gossamer-threads.com/lists/python/python/785327

It seems that "as" might cause errors on older Pythons. Aaaaand:
- building on a Fedora Core 10 (gcc 4.3.2, python 2.5.2)

It seems that the correct syntax is:
  except Exception, exc:

No idea if this syntax will do the work and will work as intended on newer Pythons as well.
Comment 10 Tommaso Pecorella 2013-07-10 06:57:55 UTC
Created attachment 1627 [details]
Possible fix

Try this one please.
Comment 11 Nicola Baldo 2013-07-10 07:43:28 UTC
it works on the FC10 machine!!
Comment 12 Tommaso Pecorella 2013-07-10 11:55:10 UTC
(In reply to comment #11)
> it works on the FC10 machine!!

Good, can we check if it works on other systems as well ?

On MacOSX (10.8) it works.

T.
Comment 13 Nicola Baldo 2013-07-10 12:19:01 UTC
works also on ubuntu 12.04 64bit and 10.04 32bit
Comment 14 Tommaso Pecorella 2013-07-11 05:59:12 UTC
Fixed in changeset: 9920:e90d966ba939