Discussion:
Q about post-extract recent commit breakage
Michael Dickens
2018-12-03 15:55:41 UTC
Permalink
Re: < https://github.com/macports/macports-base/commit/7921b2e05e9a4c9cda6efedee496affb305dcc07 >:
{{{
Date: December 29, 2017 at 10:54:09 AM EST
Author: Andrew L. Moore ***@gmail.com
Committed by Mojca Miklavec ***@macports.org

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
Ryan Schmidt
2018-12-04 01:32:40 UTC
Permalink
Post by Michael Dickens
{{{
Date: December 29, 2017 at 10:54:09 AM EST
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.
Michael Dickens
2018-12-04 01:35:24 UTC
Permalink
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.
}}}
Post by Ryan Schmidt
Post by Michael Dickens
{{{
Date: December 29, 2017 at 10:54:09 AM EST
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
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.
Ryan Schmidt
2018-12-04 07:04:34 UTC
Permalink
Post by Michael Dickens
{{{
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.
Ryan Schmidt
2018-12-04 07:07:16 UTC
Permalink
Post by Ryan Schmidt
Post by Michael Dickens
{{{
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.
}}}
post-extract {
move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
}
post-extract {
if {![file exists ${worksrcpath}]} {
move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
}
}
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).
Eric A. Borisch
2018-12-04 14:50:16 UTC
Permalink
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.
Michael Dickens
2018-12-04 18:03:49 UTC
Permalink
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
Post by Ryan Schmidt
Post by Ryan Schmidt
Post by Michael Dickens
{{{
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.
}}}
post-extract {
move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
}
post-extract {
if {![file exists ${worksrcpath}]} {
move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
}
}
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.
worksrcdir ${name}-${commit}-${commit}
(and again, if desired, remove it once a future version of MacPorts is released).
Ryan Schmidt
2018-12-05 10:05:36 UTC
Permalink
Post by Michael Dickens
Post by Ryan Schmidt
Post by Ryan Schmidt
Post by Michael Dickens
{{{
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.
}}}
post-extract {
move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
}
post-extract {
if {![file exists ${worksrcpath}]} {
move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
}
}
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.
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.
Michael Dickens
2018-12-05 14:25:49 UTC
Permalink
Ah yes; very good! Thanks for that fix; it should be removed with the next MP release, yes? - MLD
Post by Ryan Schmidt
Post by Michael Dickens
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.
Loading...