Skip to content

swig --version doesn't work in all versions of swig; -version should be used instead #4756

@ngie-eign

Description

@ngie-eign

Did code inspection and it looks like setup.py relies on swig --version returning something meaningful (see the linked code below).

--version isn't implemented on all versions of swig (it seems that it's only technically implemented on the MacOS version of the package).

FreeBSD

% swig --version
Unable to find option or file '--version', Use 'swig -help' for more information.
% swig -version 

SWIG Version 4.2.1

Compiled with c++ [amd64-portbld-freebsd14.3]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

Linux

% lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm
% swig --version
Unable to find option or file '--version', Use 'swig -help' for more information.
% swig -version 

SWIG Version 4.1.0

Compiled with g++ [arm-unknown-linux-gnueabihf]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

macOS

% swig --version

SWIG Version 4.3.1

Compiled with clang++ [aarch64-apple-darwin24.2.0]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

swig_version_text = run(f'{swig} --version', capture=1)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions