Bug 2983

Summary: Deprecated is not anymore added to the bindings
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: python bindingsAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED INVALID    
Severity: minor CC: ns-bugs, tomh
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Tommaso Pecorella 2018-08-31 14:03:41 UTC
I noticed today while rescanning some bindings (using ns-3-dev, i.e., castxml):

     cls.add_method('IsAllHostsMulticast', 
                    'bool', 
                    [], 
-                   deprecated=True, is_const=True)
+                   is_const=True)

and

     cls.add_method('AddTraceSource', 
                    'ns3::TypeId', 
-                   [param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')], 
-                   deprecated=True)
+                   [param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')])
     ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<const ns3::TraceSourceAccessor> accessor, std::string callback, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]

I don't know if this is really important...
Comment 1 Tom Henderson 2018-08-31 15:34:08 UTC
I care more about stability of bindings output across systems (across versions of castxml) so the api definition files don't thrash.

I will check outputs on a few systems.
Comment 2 Tommaso Pecorella 2018-08-31 16:41:50 UTC
I noticed a warning while rescanning the bindings:

/home/pecos/workspace/bake/source/pybindgen/pybindgen/settings.py:87: DeprecationWarning: The option pybindgen.settings.deprecated_virtuals has not been set.  I am going to assume the value of False, change it to True if it breaks your APIs. The option will eventually disappear (the deprecated behaviour will eventually disappear).


Maybe it's the reason behind the missing deprecated attributes ?
Comment 3 Tommaso Pecorella 2018-08-31 16:46:22 UTC
Nope, false alarm.

It's a harmless (albeit unnecessary) warning.
In pybindgen/settings.py there's the line:
  deprecated_virtuals = None
and it should be
  deprecated_virtuals = False

(In reply to Tommaso Pecorella from comment #2)
> I noticed a warning while rescanning the bindings:
> 
> /home/pecos/workspace/bake/source/pybindgen/pybindgen/settings.py:87:
> DeprecationWarning: The option pybindgen.settings.deprecated_virtuals has
> not been set.  I am going to assume the value of False, change it to True if
> it breaks your APIs. The option will eventually disappear (the deprecated
> behaviour will eventually disappear).
> 
> 
> Maybe it's the reason behind the missing deprecated attributes ?
Comment 4 Tom Henderson 2018-08-31 16:47:26 UTC
(In reply to Tom Henderson from comment #1)
> I care more about stability of bindings output across systems (across
> versions of castxml) so the api definition files don't thrash.
> 
> I will check outputs on a few systems.

Unfortunately, when I rescan topology-read on my (Ubuntu 16.04) system, it leaves the deprecated attributes in (i.e. reverts your recent commit).

This is from a castxml from git changeset 367e90c1ecd92, circa Oct. 2017.

This may lead us back to fixing the castxml source build for Ubuntu, and asking people to use a consistent castxml version.
Comment 5 Tommaso Pecorella 2018-08-31 17:16:50 UTC
Closing the "bug", because it seems that the behaviour is caused by the old (2017) CastXML version packaged with Ubuntu 18.04.