Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openwsman failed with SWIG 4.1.0 #2395

Closed
jplesnik opened this issue Oct 11, 2022 · 10 comments
Closed

openwsman failed with SWIG 4.1.0 #2395

jplesnik opened this issue Oct 11, 2022 · 10 comments
Assignees
Milestone

Comments

@jplesnik
Copy link
Contributor

jplesnik commented Oct 11, 2022

I rebuilt the latest version of SWIG (6b6761a) successfully for Fedora and CentOS Stream

I tried to rebuild the dependencies and the package openwsman failed with this version.

/builddir/build/BUILD/openwsman-2.7.1/build/bindings/ruby/openwsman_wrap.c: At top level:
/builddir/build/BUILD/openwsman-2.7.1/build/bindings/ruby/openwsman_wrap.c:3906:19: error: static declaration of 'SwigClassXmlDoc' follows non-static declaration
 3906 | static swig_class SwigClassXmlDoc;
      |                   ^~~~~~~~~~~~~~~
/builddir/build/BUILD/openwsman-2.7.1/build/bindings/ruby/openwsman_wrap.c:2698:16: note: previous declaration of 'SwigClassXmlDoc' with type 'swig_class'
 2698 |     KLASS_DECL(SwigClassXmlDoc,SWIGTYPE_p__WsXmlDoc);
      |                ^~~~~~~~~~~~~~~
/builddir/build/BUILD/openwsman-2.7.1/bindings/ruby/helpers.h:54:43: note: in definition of macro 'KLASS_DECL'
   54 | #define KLASS_DECL(k,t) extern swig_class k
      |                                           ^
/builddir/build/BUILD/openwsman-2.7.1/build/bindings/ruby/openwsman_wrap.c:4367:19: error: static declaration of 'SwigClassXmlNode' follows non-static declaration
 4367 | static swig_class SwigClassXmlNode;
      |                   ^~~~~~~~~~~~~~~~

Complete build log is here

@kkaempf kkaempf self-assigned this Oct 11, 2022
@wsfulton
Copy link
Member

Build failures don't look like they are due to recent SWIG commits. @jplesnik what was the last version of SWIG you tested openwsman with (was it in that round of tests three weeks ago?).

Glad that @kkaempf is looking, might be due to a new Ruby version (3.1.2) being used??

@ojwb ojwb added the Ruby label Oct 11, 2022
@ojwb
Copy link
Member

ojwb commented Oct 11, 2022

I didn't investigate, but just from the log snippet above it looks like a header in the openwsman project has an extern declaration while SWIG generates a static definition:

/builddir/build/BUILD/openwsman-2.7.1/bindings/ruby/helpers.h:54:43: note: in definition of macro 'KLASS_DECL'
   54 | #define KLASS_DECL(k,t) extern swig_class k
      |                                           ^

@jplesnik
Copy link
Contributor Author

@wsfulton The build of openwsman is failing since commit 4ac3c87.

@jplesnik
Copy link
Contributor Author

jplesnik commented Oct 12, 2022

It seems the using of SWIGVERSION is the source of the issue.
https://github.com/Openwsman/openwsman/blob/master/bindings/ruby/helpers.h#L50

Replacement SWIGVERSION by SWIG_VERSION does not help. It seems it is not defined for Ruby.

@Openwsman
Copy link

Well, it actually is defined (adding #ifdef SWIG_VERSION to helpers.h proves this) but apparently has the wrong value !?

#if SWIG_VERSION > 0x020004
...

computes to false 🤯

@Openwsman
Copy link

The problem is in Lib/typemaps/swigversion.swg where apparently SWIG_VERSION_ (not the trailing underline) isn't defined.
SWIG_VERSION evaluates to SWIG_VERSION_ instead of a numeric value.

@Openwsman
Copy link

Dropping the final

#undef SWIG_VERSION_

from Lib/typemaps/swigversion.swg fixes it.

@wsfulton
Copy link
Member

I've reopened #1050 for discussing the best solution.

@ojwb ojwb removed the Ruby label Oct 12, 2022
@ojwb ojwb added this to the swig-4.1 milestone Oct 12, 2022
@wsfulton
Copy link
Member

Fixed now, see 6b6761a...46f7501

@kkaempf
Copy link
Member

kkaempf commented Oct 14, 2022

Confirmed fixed, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants