Linux Power Management development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: "John B. Wyatt IV" <jwyatt@redhat.com>,
	Min-Hua Chen <minhuadotchen@gmail.com>
Cc: jkacur@redhat.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, shuah@kernel.org, trenn@suse.com,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [RFC PATCH for-next] pm: cpupower: rename raw_pylibcpupower.i
Date: Fri, 13 Sep 2024 10:45:38 -0600	[thread overview]
Message-ID: <9f71c145-3d0d-42ad-a258-57ef89ec525c@linuxfoundation.org> (raw)
In-Reply-To: <ZuRpzN2OKHQ75GZW@rhfedora>

On 9/13/24 10:35, John B. Wyatt IV wrote:
> On Fri, Sep 13, 2024 at 06:55:19AM +0800, Min-Hua Chen wrote:
>> AFAIK,
>> raw_pylibcpupower.i is not a generated file, it is a interface file
>> for swig.
> 
> That is correct. You can do more advanced things to help SWIG handle
> different languages, but so far with the script I wrote for libcpupower
> simply copying the definition files as worked for me for the .i file.
> 
> See:
> https://www.swig.org/Doc4.2/Preprocessor.html#Preprocessor
> 
>> The *.i file extension is also used for pre-processor output
>> (single target build) and all *.i files are removed by 'make mrproper',
>> including raw_pylibcpupower.i (should not be removed).
> 
> That would explain it. Not just 'make mrproper', but 'make clean'
> in the root removes the file as well. 'make clean' in the tools
> directory does not affect it.
> 
>  From 'man gcc':
> 
>         file.i
>             C source code that should not be preprocessed.
> 

.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.

>>>
>>>> I have reviewed and tested and this. I am good with it being a stopgap.
>>>
>>> I am okay with the stopgap, but I do want i explore other solutions.
> 
> Reviewing the documentation a better solution would be to rename it to .swg
> 
> '''
> 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.
> '''
> 

This is the reason why I wanted to understand the problem to come up
with a solutions than renaming the file with .if extension.

I am glad to hear .swg can be used. Let's fix this properly then by
renaming the file as raw_pylibcpupower

> https://www.swig.org/Doc4.2/SWIG.html
> 

Please send me patch with the change to rename using .swg extension
and this can be used going forward for other swg interface files.

thanks,
-- Shuah

  reply	other threads:[~2024-09-13 16:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 12:50 [RFC PATCH for-next] pm: cpupower: rename raw_pylibcpupower.i Min-Hua Chen
2024-09-12 16:31 ` Shuah Khan
2024-09-12 17:36   ` John B. Wyatt IV
2024-09-12 20:03     ` Shuah Khan
2024-09-12 22:55       ` Min-Hua Chen
2024-09-13 16:35         ` John B. Wyatt IV
2024-09-13 16:45           ` Shuah Khan [this message]
2024-09-12 22:49     ` Min-Hua Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f71c145-3d0d-42ad-a258-57ef89ec525c@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=jkacur@redhat.com \
    --cc=jwyatt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=minhuadotchen@gmail.com \
    --cc=shuah@kernel.org \
    --cc=trenn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox