Closed jjstickel closed 5 years ago
That's annoying because evidently the patch works for me. I'd need to know what you have in your $prefix/etc/macports/sources.conf, and then see log ouput from a failing port command.
There isn't really any other option between applying this patch and copying the PortGroup files manually, I'm afraid.
Applying the patch:
$ pwd
/opt/local/libexec/macports/lib
$ sudo patch -p2 -i /Users/Shared/install/macports/dev_fork/macstrop/sysutils/MacPorts/files/patch-hierarchical-portgroup-search.diff
patching file macports1.0/macports.tcl
Hunk #1 succeeded at 788 (offset -80 lines).
Hunk #2 succeeded at 1429 (offset -83 lines).
Hunk #3 succeeded at 1767 (offset -83 lines).
patching file port1.0/portutil.tcl
Hunk #1 succeeded at 2521 (offset -48 lines).
Contents of /opt/local/etc/macports/sources.conf
(not showing most of the commented lines):
file:///Users/Shared/install/macports/ports
# RJVB/macstrop repo
#file:///Users/Shared/install/macports/dev_fork/macstrop [own_portgroups_first]
rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]
And here is a port command:
$ port info py36-mayavi
Warning: PortGroup python 1.0 could not be located. python-1.0.tcl does not exist.
Warning: PortGroup active_variants 1.1 could not be located. active_variants-1.1.tcl does not exist.
Warning: PortGroup github 1.0 could not be located. github-1.0.tcl does not exist.
Error: Unable to open port: invalid command name "github.setup"
Thanks. I also should have asked what MacPorts version you are running (release or exact commit from git).
I'll look in detail tomorrow, but there's 1 thing that surprises me: from what I can see you deactivated my ports tree. That doesn't seem to cause problems when I do the same on my system but there's no point in using the patch in that situation.
$ port version
Version: 2.5.4
And this is on MacOS 10.12.6.
Of course I plan to use your ports tree, or at least parts of it. But when the port groups didn't work, I wanted to reduce the changes to my system to the minimum possible to demonstrate the problem. Once fixed, I will start using the ports (and port groups) from your repo.
The Mac OS version shouldn't have any importance here.
Can you try with the modified version of the patch I just pushed? I don't see anything that changed in the relevant code since the version I'm using ATM (master branch from mid August this year) so there are only 2 changes:
# add bogus PortGroup bla 2.0 to portfile and then:
> port info qt5-assistant-devel
port info qt5-assistant-devel
Warning: PortGroup bla 2.0 could not be located. bla-2.0.tcl does not exist.
Trees checked: /opt/local/linux-ports /opt/local/site-ports/Linux /opt/local/site-ports /opt/local/site-ports/Soup /opt/local/var/macports/sources/git.macports.org/dports/
Also checked for /opt/local/site-ports/_resources/port1.0/group/bla-2.0.tcl
qt5-assistant-devel @5.11.99999.36 (devel, aqua)
Variants: LTO, (+)langselect, [+]qt5kde
and in main.log:
DEBUG: Custom PortGroup qmake5 1.0 found: /opt/local/site-ports/_resources/port1.0/group/qmake5-1.0.tcl
DEBUG: Custom PortGroup qt5 1.0 found: /opt/local/site-ports/_resources/port1.0/group/qt5-1.0.tcl
DEBUG: Custom PortGroup qt5-mac 1.0 found: /opt/local/site-ports/_resources/port1.0/group/qt5-mac-1.0.tcl
DEBUG: Qt5 is provided by port:qt5-kde; transferring to PortGroup qt5-kde 1.0
DEBUG: Custom PortGroup qt5-kde 1.0 found: /opt/local/site-ports/_resources/port1.0/group/qt5-kde-1.0.tcl
DEBUG: Qt5 is provided by port:qt5-kde
DEBUG: +qt5kde is not yet set but will be for port:qt5-assistant-devel
DEBUG: PortGroup compiler_blacklist_versions 1.0 found in /opt/local/var/macports/sources/git.macports.org/dports/
DEBUG: Sourced PortGroup compiler_blacklist_versions 1.0 from /opt/local/var/macports/sources/git.macports.org/dports/_resources/port1.0/group/compiler_blacklist_versions-1.0.tcl
DEBUG: Custom PortGroup macports_clang_selection 1.0 found: /opt/local/site-ports/_resources/port1.0/group/macports_clang_selection-1.0.tcl
DEBUG: Sourced PortGroup macports_clang_selection 1.0 from /opt/local/site-ports/_resources/port1.0/group/macports_clang_selection-1.0.tcl
DEBUG: Adding depspec "path:libexec/qt5/lib/libQt5Core.so:qt5-kde" (/opt/local/site-ports/_resources/port1.0/group/qt5-kde-1.0.tcl)
DEBUG: Custom PortGroup locale_select 1.0 found: /opt/local/site-ports/_resources/port1.0/group/locale_select-1.0.tcl
DEBUG: Sourced PortGroup locale_select 1.0 from /opt/local/site-ports/_resources/port1.0/group/locale_select-1.0.tcl
DEBUG: Sourced PortGroup qt5-kde 1.0 from /opt/local/site-ports/_resources/port1.0/group/qt5-kde-1.0.tcl
DEBUG: Sourced PortGroup qt5-mac 1.0 from /opt/local/site-ports/_resources/port1.0/group/qt5-mac-1.0.tcl
DEBUG: Sourced PortGroup qt5 1.0 from /opt/local/site-ports/_resources/port1.0/group/qt5-1.0.tcl
DEBUG: PortGroup active_variants 1.1 found in /opt/local/var/macports/sources/git.macports.org/dports/
DEBUG: Sourced PortGroup active_variants 1.1 from /opt/local/var/macports/sources/git.macports.org/dports/_resources/port1.0/group/active_variants-1.1.tcl
DEBUG: Custom PortGroup qmake5-kde 1.0 found: /opt/local/site-ports/_resources/port1.0/group/qmake5-kde-1.0.tcl
DEBUG: Custom PortGroup qt5-kde 1.0 found: /opt/local/site-ports/_resources/port1.0/group/qt5-kde-1.0.tcl
DEBUG: Qt5 is provided by port:qt5-kde
DEBUG: not including qt5-kde-1.0.tcl again
DEBUG: Sourced PortGroup qt5-kde 1.0 from /opt/local/site-ports/_resources/port1.0/group/qt5-kde-1.0.tcl
DEBUG: Re-registering default for qt5.ldflags
DEBUG: Re-registering default for destroot.destdir
DEBUG: Sourced PortGroup qmake5-kde 1.0 from /opt/local/site-ports/_resources/port1.0/group/qmake5-kde-1.0.tcl
DEBUG: Sourced PortGroup qmake5 1.0 from /opt/local/site-ports/_resources/port1.0/group/qmake5-1.0.tcl
Warning: PortGroup bla 2.0 could not be located. bla-2.0.tcl does not exist.
Trees checked: /opt/local/linux-ports /opt/local/site-ports/Linux /opt/local/site-ports /opt/local/site-ports/Soup /opt/local/var/macports/sources/git.macports.org/dports/
Also checked for /opt/local/site-ports/_resources/port1.0/group/bla-2.0.tcl
Hopefully this will give us a clue why the patch fails on your end.
Hmm, same behavior as before (see above), no extra info about trees checked, etc. I pulled your latest master and checked that the patch I am applying, patch-hierarchical-portgroup-search.diff
, is the same as shown in github.
what if you do
> port -vd info foo
Ahh, ok, that does provide more output:
$ port -vd info py36-mayavi
DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/python/py-mayavi
DEBUG: OS darwin/16.7.0 (Mac OS X 10.12) arch i386
Warning: PortGroup python 1.0 could not be located. python-1.0.tcl does not exist.
Trees checked: /Users/Shared/install/macports/ports
Warning: PortGroup active_variants 1.1 could not be located. active_variants-1.1.tcl does not exist.
Trees checked: /Users/Shared/install/macports/ports
Warning: PortGroup github 1.0 could not be located. github-1.0.tcl does not exist.
Trees checked: /Users/Shared/install/macports/ports
DEBUG: invalid command name "github.setup"
while executing
"github.setup enthought mayavi 4.6.2"
(file "Portfile" line 8)
invoked from within
"source Portfile"
invoked from within
"$workername eval {source Portfile}"
(procedure "mportopen" line 50)
invoked from within
"mportopen $porturl [array get options] [array get merged_variations]"
Error: Unable to open port: invalid command name "github.setup"
Ahhh, of course. My patch made the algorithm look ONLY in local port trees defined with file:// ... which is all I have. I've added the original single-line lookup as a fallback if all previous lookups failed, that should find any PGs not found otherwise.
The drawback is that this makes the lookup no longer perfectly hierarchical; a file:// tree listed after the standard rsync:// entry will probably override the PGs from that standard tree. We'll see if that ever leads to issues.
Thanks, this seems to be working now. I've run into another problem, but I will email you as I am not sure it's a bug or user error.
I tried following the instructions to resolve the port group issue. After applying the patch
patch-hierarchical-portgroup-search.diff
as instructed into/opt/local/libexec/macports/lib
, none of the port group files in my default port tree could be found by port. Reversing the patch resolved the problem. I would like to use this more elegant approach than manually copying the port group files into the default tree.