Quantcast

Warning: reinplace ... didn't change anything in ...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Warning: reinplace ... didn't change anything in ...

Ryan Schmidt-24
MacPorts 2.4.1 shows a new warning when a reinplace command doesn't change anything. The purpose of reinplace is to change something in a file, so when that doesn't happen, it may be a developer error that we want to alert the developer about. Portfile developers should remove these warnings in the appropriate way, which may be to fix the reinplace or use a patchfile instead; remove the reinplace; or silence the warning.

The most common situation will probably be a portfile that contains a reinplace that changes something in a source file, and it worked at one time, but then the port was updated to a new version of the software, which changed that source file in such a way that the reinplace no longer works. Examine the source file and the reinplace to figure out what was being changed. You may find it easier to go back to the old version of the software that the port was using at the time the reinplace was last modified. (Use "git blame" to find out when that was.) Once you figure out what was being changed, determine whether it still needs to be changed in the new version. If so, update the reinplace so it works again or preferably, if practical, change the reinplace to a patchfile; you'll probably need to increase the port's revision, if the change has any bearing on what the port installs. If the reinplace is no longer needed, just remove it from the portfile.

Another possibility is a reinplace in a portfile or portgroup that the developer intended to be a no-op in some situations. For example, you might be reinplacing "/opt/local" with the value of ${prefix}; if the value of ${prefix} *is* "/opt/local", this wouldn't change anything, and that's fine, though in this situation, we prefer that the file to be changed contains a placeholder, like "@PREFIX@", and then you reinplace "@PREFIX@" with the value of ${prefix}. Or, you might be using fs-traverse to loop over many files, reinplacing each one, even if not all of the files need the reinplacement -- for example, looping over all python files to change the shebang line. In these cases, silence the warning by using reinplace's new "-q" ("quiet") flag.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Warning: reinplace ... didn't change anything in ...

Jeremy Lavergne-2
Can buildbot report on this at warning levels? Or should we have
something `-Werror`-like?

On 02/27/2017 01:10 PM, Ryan Schmidt wrote:
> MacPorts 2.4.1 shows a new warning when a reinplace command doesn't change anything. The purpose of reinplace is to change something in a file, so when that doesn't happen, it may be a developer error that we want to alert the developer about. Portfile developers should remove these warnings in the appropriate way, which may be to fix the reinplace or use a patchfile instead; remove the reinplace; or silence the warning.
>
> The most common situation will probably be a portfile that contains a reinplace that changes something in a source file, and it worked at one time, but then the port was updated to a new version of the software, which changed that source file in such a way that the reinplace no longer works. Examine the source file and the reinplace to figure out what was being changed. You may find it easier to go back to the old version of the software that the port was using at the time the reinplace was last modified. (Use "git blame" to find out when that was.) Once you figure out what was being changed, determine whether it still needs to be changed in the new version. If so, update the reinplace so it works again or preferably, if practical, change the reinplace to a patchfile; you'll probably need to increase the port's revision, if the change has any bearing on what the port installs. If the reinplace is no longer needed, just remove it from the portfile.
>
> Another possibility is a reinplace in a portfile or portgroup that the developer intended to be a no-op in some situations. For example, you might be reinplacing "/opt/local" with the value of ${prefix}; if the value of ${prefix} *is* "/opt/local", this wouldn't change anything, and that's fine, though in this situation, we prefer that the file to be changed contains a placeholder, like "@PREFIX@", and then you reinplace "@PREFIX@" with the value of ${prefix}. Or, you might be using fs-traverse to loop over many files, reinplacing each one, even if not all of the files need the reinplacement -- for example, looping over all python files to change the shebang line. In these cases, silence the warning by using reinplace's new "-q" ("quiet") flag.
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Warning: reinplace ... didn't change anything in ...

Mojca Miklavec-2
On 28 February 2017 at 01:02, Jeremy Lavergne wrote:
> On 02/27/2017 01:10 PM, Ryan Schmidt wrote:
>>
>> MacPorts 2.4.1 shows a new warning when a reinplace command doesn't change anything. The purpose of reinplace is to change something in a file, so when that doesn't happen, it may be a developer error that we want to alert the developer about.
>
> Can buildbot report on this at warning levels?

We can put some regex to make buildbot recognise those lines as
warnings in the same way as build warnings generated by the compiler.

(But realistically unless developers will get an email, nobody will
look at those anyway.)

Mojca
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Warning: reinplace ... didn't change anything in ...

Brandon Allbery
In reply to this post by Ryan Schmidt-24

On Mon, Feb 27, 2017 at 1:10 PM, Ryan Schmidt <[hidden email]> wrote:
MacPorts 2.4.1 shows a new warning when a reinplace command doesn't change anything. The purpose of reinplace is to change something in a file, so when that doesn't happen, it may be a developer error that we want to alert the developer about. Portfile developers should remove these warnings in the appropriate way, which may be to fix the reinplace or use a patchfile instead; remove the reinplace; or silence the warning.

Is there a convenient way to silence it? For example, I can imagine a reinplace intended to allow replacement of /opt/local with an alternate prefix, which will in most cases trigger the warning.

--
brandon s allbery kf8nh                               sine nomine associates
[hidden email]                                  [hidden email]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Warning: reinplace ... didn't change anything in ...

Ryan Schmidt-24

On Feb 28, 2017, at 06:34, Brandon Allbery wrote:

> Is there a convenient way to silence it? For example, I can imagine a reinplace intended to allow replacement of /opt/local with an alternate prefix, which will in most cases trigger the warning.

Continue reading the rest of my first message. I explain how to do that.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Warning: reinplace ... didn't change anything in ...

Brandon Allbery
On Tue, Feb 28, 2017 at 2:30 PM, Ryan Schmidt <[hidden email]> wrote:

On Feb 28, 2017, at 06:34, Brandon Allbery wrote:

> Is there a convenient way to silence it? For example, I can imagine a reinplace intended to allow replacement of /opt/local with an alternate prefix, which will in most cases trigger the warning.

Continue reading the rest of my first message. I explain how to do that.

Yes, sorry. After sending that I realized I wasn't quite right and collapsed back into bed for another couple hours of fitful sleep. :/

--
brandon s allbery kf8nh                               sine nomine associates
[hidden email]                                  [hidden email]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
Loading...