Q about post-extract recent commit breakage

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Q about post-extract recent commit breakage

Michael Dickens-4
Re: < https://github.com/macports/macports-base/commit/7921b2e05e9a4c9cda6efedee496affb305dcc07 >:
{{{
Date:   December 29, 2017 at 10:54:09 AM EST
Author: Andrew L. Moore [hidden email]
Committed by Mojca Miklavec [hidden email]

portextract: Create symlink if no $worksrcpath

If expected extract path doesn't exist, create a symlink
from expected directory to the actual one.
If $worksrcdir is explicitly set, nothing is done.
}}}

This commit breaks the extract for "cmake-devel". Is the issue with the Portfile, or with the commit? I'll look into this issue when I have a chance, but maybe someone else (Mojca?) will get there first! - MLD
Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Ryan Schmidt-24


On Dec 3, 2018, at 09:55, Michael Dickens wrote:

> Re: < https://github.com/macports/macports-base/commit/7921b2e05e9a4c9cda6efedee496affb305dcc07 >:
> {{{
> Date:   December 29, 2017 at 10:54:09 AM EST
> Author: Andrew L. Moore slewsys@...
> Committed by Mojca Miklavec mojca@...
>
> portextract: Create symlink if no $worksrcpath
>
> If expected extract path doesn't exist, create a symlink
> from expected directory to the actual one.
> If $worksrcdir is explicitly set, nothing is done.
> }}}
>
> This commit breaks the extract for "cmake-devel". Is the issue with the Portfile, or with the commit? I'll look into this issue when I have a chance, but maybe someone else (Mojca?) will get there first! - MLD

That PR was submitted a year ago. It was high time to merge it.

https://github.com/macports/macports-base/pull/55

It was hoped that this would make many ports easier to write, without needing to set worksrcdir. Much testing was done to determine what negative impact this change might have, and some ports were identified that needed changes to be compatible with this. Most of those ports were already fixed to be compatible with both current MacPorts and the above PR. Looks like as of today only one port remains to be modified:

https://github.com/macports/macports-ports/pull/1760

It is certainly possible that some ports were missed. If you need help figuring out what to do with cmake-devel, let us know what the error is.


Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Michael Dickens-4
Here's the error (just do "sudo port extract cmake-devel"; it results in this error on every OS I tested, from 10.5 to 10.14):
{{{
Error: Failed to extract cmake-devel: error renaming "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13" to "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13": trying to rename a volume or move a directory into itself
Error: See /opt/local/var/macports/logs/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/main.log for details.
}}}

On Mon, Dec 3, 2018, at 8:32 PM, Ryan Schmidt wrote:

>
>
> On Dec 3, 2018, at 09:55, Michael Dickens wrote:
>
> > Re: < https://github.com/macports/macports-base/commit/7921b2e05e9a4c9cda6efedee496affb305dcc07 >:
> > {{{
> > Date:   December 29, 2017 at 10:54:09 AM EST
> > Author: Andrew L. Moore slewsys@...
> > Committed by Mojca Miklavec mojca@...
> >
> > portextract: Create symlink if no $worksrcpath
> >
> > If expected extract path doesn't exist, create a symlink
> > from expected directory to the actual one.
> > If $worksrcdir is explicitly set, nothing is done.
> > }}}
> >
> > This commit breaks the extract for "cmake-devel". Is the issue with the Portfile, or with the commit? I'll look into this issue when I have a chance, but maybe someone else (Mojca?) will get there first! - MLD
>
> That PR was submitted a year ago. It was high time to merge it.
>
> https://github.com/macports/macports-base/pull/55
>
> It was hoped that this would make many ports easier to write, without
> needing to set worksrcdir. Much testing was done to determine what
> negative impact this change might have, and some ports were identified
> that needed changes to be compatible with this. Most of those ports were
> already fixed to be compatible with both current MacPorts and the above
> PR. Looks like as of today only one port remains to be modified:
>
> https://github.com/macports/macports-ports/pull/1760
>
> It is certainly possible that some ports were missed. If you need help
> figuring out what to do with cmake-devel, let us know what the error is.
Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Ryan Schmidt-24


On Dec 3, 2018, at 19:35, Michael Dickens wrote:

> Here's the error (just do "sudo port extract cmake-devel"; it results in this error on every OS I tested, from 10.5 to 10.14):
> {{{
> Error: Failed to extract cmake-devel: error renaming "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13" to "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13": trying to rename a volume or move a directory into itself
> Error: See /opt/local/var/macports/logs/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/main.log for details.
> }}}

Ok, that's because cmake-devel does this:

    post-extract {
        move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
    }

Now that base has been changed, MacPorts has already made a ${worksrcdir} (in this case ${name}-${commit}) symlink for you. So for compatibility with both the released version of MacPorts and master, you should ensure it doesn't already exist before moving it:

    post-extract {
        if {![file exists ${worksrcpath}]} {
            move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
        }
    }

which is basically what's done in the remaining commit for libao in this PR:

https://github.com/macports/macports-ports/pull/1760

After compatibility with the current version of MacPorts is no longer needed, the entire post-extract block can be removed.

Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Ryan Schmidt-24
On Dec 4, 2018, at 01:04, Ryan Schmidt wrote:

> On Dec 3, 2018, at 19:35, Michael Dickens wrote:
>
>> Here's the error (just do "sudo port extract cmake-devel"; it results in this error on every OS I tested, from 10.5 to 10.14):
>> {{{
>> Error: Failed to extract cmake-devel: error renaming "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13" to "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13": trying to rename a volume or move a directory into itself
>> Error: See /opt/local/var/macports/logs/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/main.log for details.
>> }}}
>
> Ok, that's because cmake-devel does this:
>
>    post-extract {
>        move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
>    }
>
> Now that base has been changed, MacPorts has already made a ${worksrcdir} (in this case ${name}-${commit}) symlink for you. So for compatibility with both the released version of MacPorts and master, you should ensure it doesn't already exist before moving it:
>
>    post-extract {
>        if {![file exists ${worksrcpath}]} {
>            move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
>        }
>    }
>
> which is basically what's done in the remaining commit for libao in this PR:
>
> https://github.com/macports/macports-ports/pull/1760
>
> After compatibility with the current version of MacPorts is no longer needed, the entire post-extract block can be removed.

Or, more simply and more usually, you should be able to just:

worksrcdir        ${name}-${commit}-${commit}

(and again, if desired, remove it once a future version of MacPorts is released).

Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Eric A. Borisch-2
A note if others have github-hosted packages that use Doxygen to create documentation: check to see if these changes broke your documentation generation. Doxygen doesn't seem to like it when the INPUT directory itself is a symlink. No errors are reported, but no useful documentation is generated, either. At least, that was my experience with DCMTK: undoing this change and restoring the (github portgroup-provided) move behavior fixed it. 
Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Michael Dickens-4
In reply to this post by Ryan Schmidt-24
Or, even more simply, just remove the post-extract all together. I don't recall why it's the in the first place, but removing it seems to do the trick. Thanks! - MLD

On Tue, Dec 4, 2018, at 2:07 AM, Ryan Schmidt wrote:

> On Dec 4, 2018, at 01:04, Ryan Schmidt wrote:
>
> > On Dec 3, 2018, at 19:35, Michael Dickens wrote:
> >
> >> Here's the error (just do "sudo port extract cmake-devel"; it results in this error on every OS I tested, from 10.5 to 10.14):
> >> {{{
> >> Error: Failed to extract cmake-devel: error renaming "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13" to "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13": trying to rename a volume or move a directory into itself
> >> Error: See /opt/local/var/macports/logs/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/main.log for details.
> >> }}}
> >
> > Ok, that's because cmake-devel does this:
> >
> >    post-extract {
> >        move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
> >    }
> >
> > Now that base has been changed, MacPorts has already made a ${worksrcdir} (in this case ${name}-${commit}) symlink for you. So for compatibility with both the released version of MacPorts and master, you should ensure it doesn't already exist before moving it:
> >
> >    post-extract {
> >        if {![file exists ${worksrcpath}]} {
> >            move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
> >        }
> >    }
> >
> > which is basically what's done in the remaining commit for libao in this PR:
> >
> > https://github.com/macports/macports-ports/pull/1760
> >
> > After compatibility with the current version of MacPorts is no longer needed, the entire post-extract block can be removed.
>
> Or, more simply and more usually, you should be able to just:
>
> worksrcdir        ${name}-${commit}-${commit}
>
> (and again, if desired, remove it once a future version of MacPorts is
> released).
>
Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Ryan Schmidt-24


On Dec 4, 2018, at 12:03, Michael Dickens wrote:

> On Tue, Dec 4, 2018, at 2:07 AM, Ryan Schmidt wrote:
>> On Dec 4, 2018, at 01:04, Ryan Schmidt wrote:
>>> On Dec 3, 2018, at 19:35, Michael Dickens wrote:
>>>
>>>> Here's the error (just do "sudo port extract cmake-devel"; it results in this error on every OS I tested, from 10.5 to 10.14):
>>>> {{{
>>>> Error: Failed to extract cmake-devel: error renaming "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13" to "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13": trying to rename a volume or move a directory into itself
>>>> Error: See /opt/local/var/macports/logs/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/main.log for details.
>>>> }}}
>>>
>>> Ok, that's because cmake-devel does this:
>>>
>>>   post-extract {
>>>       move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
>>>   }
>>>
>>> Now that base has been changed, MacPorts has already made a ${worksrcdir} (in this case ${name}-${commit}) symlink for you. So for compatibility with both the released version of MacPorts and master, you should ensure it doesn't already exist before moving it:
>>>
>>>   post-extract {
>>>       if {![file exists ${worksrcpath}]} {
>>>           move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
>>>       }
>>>   }
>>>
>>> which is basically what's done in the remaining commit for libao in this PR:
>>>
>>> https://github.com/macports/macports-ports/pull/1760
>>>
>>> After compatibility with the current version of MacPorts is no longer needed, the entire post-extract block can be removed.
>>
>> Or, more simply and more usually, you should be able to just:
>>
>> worksrcdir        ${name}-${commit}-${commit}
>>
>> (and again, if desired, remove it once a future version of MacPorts is
>> released).
>

> Or, even more simply, just remove the post-extract all together. I don't recall why it's the in the first place, but removing it seems to do the trick. Thanks!


That works with the not-yet-released MacPorts master version, but does not work with the released MacPorts 2.5.4; for that version, you still need to set worksrcdir manually when it is not the default value. Fixed in 860f9c647f60a33043e8a13dfe688c575faa88cd.


Reply | Threaded
Open this post in threaded view
|

Re: Q about post-extract recent commit breakage

Michael Dickens-4
Ah yes; very good! Thanks for that fix; it should be removed with the next MP release, yes? - MLD

On Wed, Dec 5, 2018, at 5:05 AM, Ryan Schmidt wrote:
> On Dec 4, 2018, at 12:03, Michael Dickens wrote:
> > Or, even more simply, just remove the post-extract all together. I don't recall why it's the in the first place, but removing it seems to do the trick. Thanks!
>
> That works with the not-yet-released MacPorts master version, but does
> not work with the released MacPorts 2.5.4; for that version, you still
> need to set worksrcdir manually when it is not the default value. Fixed
> in 860f9c647f60a33043e8a13dfe688c575faa88cd.