Re: [PATCH v3 2/4] pm:cpupower: Add SWIG bindings files for libcpupower
From: Guenter Roeck
Date: Sat Sep 21 2024 - 17:23:18 EST
Hi,
On Wed, Sep 04, 2024 at 10:19:09PM -0400, John B. Wyatt IV wrote:
> SWIG is a tool packaged in Fedora and other distros that can generate
> bindings from C and C++ code for several languages including Python,
> Perl, and Go.
>
> These bindings allows users to easily write scripts that use and extend
> libcpupower's functionality. Currently, only Python is provided in the
> makefile, but additional languages may be added if there is demand.
>
> Added suggestions from Shuah Khan for the README and license discussion.
>
> Note that while SWIG itself is GPL v3+ licensed; the resulting output,
> the bindings code, is permissively licensed + the license of the .o
> files. Please see
> https://swig.org/legal.html and [1] for more details.
>
> [1]
> https://lore.kernel.org/linux-pm/Zqv9BOjxLAgyNP5B@hatbackup/
>
> Suggested-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: John B. Wyatt IV <jwyatt@xxxxxxxxxx>
> Signed-off-by: John B. Wyatt IV <sageofredondo@xxxxxxxxx>
> ---
>
> Changes in v3:
> - Reordered patch series for cpupower stub implementation to be
> first.
> - Added pm:cpupower prefix to header and Rafael to Cc.
>
> Changes in v2:
> - Implemented the function so SWIG will accept the header
> definition
> ---
> .../power/cpupower/bindings/python/.gitignore | 8 +
> tools/power/cpupower/bindings/python/Makefile | 31 +++
> tools/power/cpupower/bindings/python/README | 59 +++++
> .../bindings/python/raw_pylibcpupower.i | 247 ++++++++++++++++++
> 4 files changed, 345 insertions(+)
> create mode 100644 tools/power/cpupower/bindings/python/.gitignore
> create mode 100644 tools/power/cpupower/bindings/python/Makefile
> create mode 100644 tools/power/cpupower/bindings/python/README
> create mode 100644 tools/power/cpupower/bindings/python/raw_pylibcpupower.i
This file is deleted when running "make mrproper".
$ git reset --hard HEAD
$ make mrproper
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: tools/power/cpupower/bindings/python/raw_pylibcpupower.i
That is a bit more than annoying when trying to switch branches after
that happened.
Guenter