* [PATCH v2 for-next] pm: cpupower: rename raw_pylibcpupower.i
@ 2024-09-12 23:01 Min-Hua Chen
2024-09-13 16:38 ` John B. Wyatt IV
0 siblings, 1 reply; 4+ messages in thread
From: Min-Hua Chen @ 2024-09-12 23:01 UTC (permalink / raw)
To: Thomas Renninger, Shuah Khan, John B. Wyatt IV, John Kacur
Cc: Min-Hua Chen, John B . Wyatt IV, linux-pm, linux-kernel
All *.i files will be removed by 'make mrproper',
including raw_pylibcpupower.i, added by
commit: 338f490e07bc ("pm:cpupower: Add SWIG bindings files for libcpupower")
We can reproduce the error by performing the following command:
cd linux-next
make mrproper
cd tools/power/cpupower/bindings/python
make
We will get an error message:
make: *** No rule to make target 'raw_pylibcpupower.i', needed by 'raw_pylibcpupower_wrap.c'. Stop.
To fix it, rename raw_pylibcpupower.i to raw_pylibcpupower.if.
Reviewed-by: John B. Wyatt IV <jwyatt@redhat.com>
Reviewed-by: John B. Wyatt IV <sageofredondo@gmail.com>
Tested-by: John B. Wyatt IV <jwyatt@redhat.com>
Tested-by: John B. Wyatt IV <sageofredondo@gmail.com>
Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
---
tools/power/cpupower/bindings/python/Makefile | 4 ++--
.../python/{raw_pylibcpupower.i => raw_pylibcpupower.if} | 0
2 files changed, 2 insertions(+), 2 deletions(-)
rename tools/power/cpupower/bindings/python/{raw_pylibcpupower.i => raw_pylibcpupower.if} (100%)
diff --git a/tools/power/cpupower/bindings/python/Makefile b/tools/power/cpupower/bindings/python/Makefile
index dc09c5b66ead..de872a1b80d3 100644
--- a/tools/power/cpupower/bindings/python/Makefile
+++ b/tools/power/cpupower/bindings/python/Makefile
@@ -20,13 +20,13 @@ _raw_pylibcpupower.so: raw_pylibcpupower_wrap.o
raw_pylibcpupower_wrap.o: raw_pylibcpupower_wrap.c
$(CC) -fPIC -c raw_pylibcpupower_wrap.c $(PY_INCLUDE)
-raw_pylibcpupower_wrap.c: raw_pylibcpupower.i
+raw_pylibcpupower_wrap.c: raw_pylibcpupower.if
ifeq ($(HAVE_SWIG),0)
$(error "swig was not found. Make sure you have it installed and in the PATH to generate the bindings.")
else ifeq ($(HAVE_PYCONFIG),0)
$(error "python-config was not found. Make sure you have it installed and in the PATH to generate the bindings.")
endif
- swig -python raw_pylibcpupower.i
+ swig -python raw_pylibcpupower.if
# Will only clean the bindings folder; will not clean the actual cpupower folder
clean:
diff --git a/tools/power/cpupower/bindings/python/raw_pylibcpupower.i b/tools/power/cpupower/bindings/python/raw_pylibcpupower.if
similarity index 100%
rename from tools/power/cpupower/bindings/python/raw_pylibcpupower.i
rename to tools/power/cpupower/bindings/python/raw_pylibcpupower.if
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 for-next] pm: cpupower: rename raw_pylibcpupower.i
2024-09-12 23:01 [PATCH v2 for-next] pm: cpupower: rename raw_pylibcpupower.i Min-Hua Chen
@ 2024-09-13 16:38 ` John B. Wyatt IV
2024-09-13 16:48 ` Shuah Khan
2024-09-13 19:58 ` Min-Hua Chen
0 siblings, 2 replies; 4+ messages in thread
From: John B. Wyatt IV @ 2024-09-13 16:38 UTC (permalink / raw)
To: Min-Hua Chen
Cc: Thomas Renninger, Shuah Khan, John Kacur, John B . Wyatt IV,
linux-pm, linux-kernel
On Fri, Sep 13, 2024 at 07:01:00AM +0800, Min-Hua Chen wrote:
> To fix it, rename raw_pylibcpupower.i to raw_pylibcpupower.if.
Would you please rename this to .swg instead?
'''
5.1.1 Input format
As input, SWIG expects a file containing ISO C/C++ declarations and special
SWIG directives. More often than not, this is a special SWIG interface file
which is usually denoted with a special .i or .swg suffix.
'''
https://www.swig.org/Doc4.2/SWIG.html
I tested it and .swg is not removed by 'make clean' or 'make mrproper'.
My apologies for the extra work Min-Hua. I can send a quick patch
instead if you wish.
--
Sincerely,
John Wyatt
Software Engineer, Core Kernel
Red Hat
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 for-next] pm: cpupower: rename raw_pylibcpupower.i
2024-09-13 16:38 ` John B. Wyatt IV
@ 2024-09-13 16:48 ` Shuah Khan
2024-09-13 19:58 ` Min-Hua Chen
1 sibling, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2024-09-13 16:48 UTC (permalink / raw)
To: John B. Wyatt IV, Min-Hua Chen
Cc: Thomas Renninger, Shuah Khan, John Kacur, John B . Wyatt IV,
linux-pm, linux-kernel, Shuah Khan
On 9/13/24 10:38, John B. Wyatt IV wrote:
> On Fri, Sep 13, 2024 at 07:01:00AM +0800, Min-Hua Chen wrote:
>
>> To fix it, rename raw_pylibcpupower.i to raw_pylibcpupower.if.
>
> Would you please rename this to .swg instead?
>
> '''
> 5.1.1 Input format
>
> As input, SWIG expects a file containing ISO C/C++ declarations and special
> SWIG directives. More often than not, this is a special SWIG interface file
> which is usually denoted with a special .i or .swg suffix.
> '''
>
> https://www.swig.org/Doc4.2/SWIG.html
>
> I tested it and .swg is not removed by 'make clean' or 'make mrproper'.
That is expected.
.i extension is used for a C pre-processor out, hence the need to
mrprpoer and clean remove it. Because of that reason, using .i
will not work for swig interface files.
We build files to debug problems and to check the pre-processor
output. So changing mrproper and cleans to not remove .i would
leave the tree dirty.
This is the reason why I wanted to understand the problem to come up
with a solutions than renaming the file with .if extension.
Please add this information to the changelog so it is clear that
.i extenion will not work for swig files that get added to kernel repos.
>
> My apologies for the extra work Min-Hua. I can send a quick patch
> instead if you wish.
>
+1 - Yes please send me the patch with renaming it with .swg extension.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 for-next] pm: cpupower: rename raw_pylibcpupower.i
2024-09-13 16:38 ` John B. Wyatt IV
2024-09-13 16:48 ` Shuah Khan
@ 2024-09-13 19:58 ` Min-Hua Chen
1 sibling, 0 replies; 4+ messages in thread
From: Min-Hua Chen @ 2024-09-13 19:58 UTC (permalink / raw)
To: jwyatt
Cc: jkacur, linux-kernel, linux-pm, minhuadotchen, sageofredondo,
shuah, trenn
>On Fri, Sep 13, 2024 at 07:01:00AM +0800, Min-Hua Chen wrote:
>
>> To fix it, rename raw_pylibcpupower.i to raw_pylibcpupower.if.
>
>Would you please rename this to .swg instead?
No problem, I will send patch v3 for this.
>
>'''
>5.1.1 Input format
>
>As input, SWIG expects a file containing ISO C/C++ declarations and special
>SWIG directives. More often than not, this is a special SWIG interface file
>which is usually denoted with a special .i or .swg suffix.
>'''
Thanks for sharing the document, using .swg extension looks a better solution.
cheers,
Min-Hua
>
>https://www.swig.org/Doc4.2/SWIG.html
>
>I tested it and .swg is not removed by 'make clean' or 'make mrproper'.
>
>My apologies for the extra work Min-Hua. I can send a quick patch
>instead if you wish.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-13 19:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12 23:01 [PATCH v2 for-next] pm: cpupower: rename raw_pylibcpupower.i Min-Hua Chen
2024-09-13 16:38 ` John B. Wyatt IV
2024-09-13 16:48 ` Shuah Khan
2024-09-13 19:58 ` Min-Hua Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox