python PortGroup and destroot.pre_args

René J.V. Bertin rjvbertin at gmail.com
Tue Jun 29 20:35:49 UTC 2021


Hi,

There's a strange side effect of the Python PG on `destroot.pre_args` (and maybe other, related variables). Accessing the variable after including the PG leads to

{{{
DEBUG: Sourced PortGroup python 1.0 from /path/to//_resources/port1.0/group/python-1.0.tcl
DEBUG: can't read "name": no such variable
    while executing
"set $option"
    (procedure "option" line 10)
    invoked from within
"option name"
    (procedure "python_get_version" line 2)
    invoked from within
"python_get_version"
    invoked from within
"subst {[python_get_version]}"
    invoked from within
"set python.version [subst {[python_get_version]}]"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list set $optionName] [subst -nocommands {[subst {$option_defaults($optionName)}]}]"
    (procedure "default_check" line 10)
    invoked from within
"default_check python.version {} read"
    (read trace on "python.version")
    invoked from within
"string range ${python.version} 0 end-1"
    invoked from within
"subst {[string range ${python.version} 0 end-1].[string index ${python.version} end]}"
    invoked from within
"set python.branch [subst {[string range ${python.version} 0 end-1].[string index ${python.version} end]}]"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list set $optionName] [subst -nocommands {[subst {$option_defaults($optionName)}]}]"
    (procedure "default_check" line 10)
    invoked from within
"default_check python.branch {} read"
    (read trace on "python.branch")
    invoked from within
"subst {${frameworks_dir}/Python.framework/Versions/${python.branch}}"
    invoked from within
"set python.prefix [subst {${frameworks_dir}/Python.framework/Versions/${python.branch}}]"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list set $optionName] [subst -nocommands {[subst {$option_defaults($optionName)}]}]"
    (procedure "default_check" line 10)
    invoked from within
"default_check python.prefix {} read"
    (read trace on "python.prefix")
    invoked from within
"subst {${python.prefix}/bin/python${python.branch}}"
    invoked from within
"set python.bin [subst {${python.prefix}/bin/python${python.branch}}]"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list set $optionName] [subst -nocommands {[subst {$option_defaults($optionName)}]}]"
    (procedure "default_check" line 10)
    invoked from within
"default_check python.bin {} read"
    (read trace on "python.bin")
    invoked from within
"subst {${python.bin} setup.py --no-user-cfg}"
    invoked from within
"set destroot.cmd [subst {${python.bin} setup.py --no-user-cfg}]"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list set $optionName] [subst -nocommands {[subst {$option_defaults($optionName)}]}]"
    (procedure "default_check" line 10)
    invoked from within
"default_check destroot.cmd {} read"
    (read trace on "destroot.cmd")
    invoked from within
"set $option"
    (procedure "option" line 10)
    invoked from within
"option destroot.cmd"
    (procedure "portdestroot::destroot_getargs" line 2)
    invoked from within
"portdestroot::destroot_getargs"
    invoked from within
"subst {[portdestroot::destroot_getargs]}"
    invoked from within
"set destroot.pre_args [subst {[portdestroot::destroot_getargs]}]"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list set $optionName] [subst -nocommands {[subst {$option_defaults($optionName)}]}]"
    (procedure "default_check" line 10)
    invoked from within
"default_check destroot.pre_args {} read"
    (read trace on "destroot.pre_args")
    invoked from within
"ui_msg ${destroot.pre_args}"
    (file "Portfile" line 5)
    invoked from within
"source Portfile"
    invoked from within
"$workername eval {source Portfile}"
    (procedure "mportopen" line 50)
    invoked from within
"mportopen $url"
}}}

Why would `name` have to be defined in order to be able to evaluate destroot.pre_args ?

R


More information about the macports-dev mailing list