port version reports 2.4.2 when built from tag v2.4.3
Enrico Maria Crisostomo
enrico.m.crisostomo at gmail.com
Fri Apr 13 21:30:22 UTC 2018
I think I found the culprit:
% strings /opt/macports-2.4.3-dirty/libexec/macports/lib/libtcl8.5.dylib | grep 2\\.4\\.
/opt/macports-2.4.2/libexec/macports/lib
/opt/macports-2.4.2/libexec/macports/bin
/opt/macports-2.4.2/libexec/macports/lib/tcl8.5
/opt/macports-2.4.2/libexec/macports/include
/opt/macports-2.4.2/libexec/macports/man
/opt/macports-2.4.3-dirty/libexec/macports/lib/tcl8.5
/opt/macports-2.4.3-dirty/libexec/macports/lib
while the library built from the clean repo is right:
% strings /opt/macports-2.4.3-clean/libexec/macports/lib/libtcl8.5.dylib | grep 2\\.4\\.
/opt/macports-2.4.3-clean/libexec/macports/lib
/opt/macports-2.4.3-clean/libexec/macports/bin
/opt/macports-2.4.3-clean/libexec/macports/lib/tcl8.5
/opt/macports-2.4.3-clean/libexec/macports/include
/opt/macports-2.4.3-clean/libexec/macports/man
/opt/macports-2.4.3-clean/libexec/macports/lib/tcl8.5
/opt/macports-2.4.3-clean/libexec/macports/lib
Hence, the macports installation that was built from the dirty tree is referring to the installation directory of the previous build. That also explains why removing that directory makes port crash, as I said in a previous mail.
Cheers,
--
Enrico
> On 13 Apr 2018, at 22:28, Enrico Maria Crisostomo <enrico.m.crisostomo at gmail.com> wrote:
>
> Ryan,
>
> Unless there's something I'm not understanding, in which case I apologise for the noise, I don't think my shell is caching anything. I went so far as to change my user's .zshrc file and try this four possibilities _with a reboot between each test_:
>
> * /opt/local: installed from packages: works fine
> * /opt/macports-2.4.2: installed from git, built clean: works fine and reports 2.4.2
> * /opt/macports-2.4.3-dirty: installed from git after switching tag and _not_ cleaning the tree: still reports 2.4.2.
> * /opt/macports-2.4.3-clean: installed from git after cleaning (git clean -xfd): works fine and reports 2.4.3.
>
> How could the shell be caching anything? And why it would be caching for the /opt/macports-2.4.3-dirty tree and not for the /opt/macports-2.4.3-clean tree?
>
> Cheers,
> --
> Enrico
>
>> On 12 Apr 2018, at 18:44, Ryan Schmidt <ryandesign at macports.org> wrote:
>>
>>
>> On Apr 12, 2018, at 03:39, Enrico Maria Crisostomo wrote:
>>
>>> On 12 Apr 2018, at 02:30, Ryan Schmidt wrote:
>>>
>>>> On Apr 11, 2018, at 08:48, Enrico Maria Crisostomo wrote:
>>>>
>>>>> Well, I replicated it:
>>>>>
>>>>> * Clean the repo (e.g.: git clean -xfd)
>>>>> * git checkout v2.4.2
>>>>> * build and install 2.4.2:
>>>>>
>>>>> $ export PATH=/bin:/sbin:/usr/bin:/usr/sbin
>>>>> $ MP_PREFIX=/opt/macports-2.4.2
>>>>> $ ./configure --prefix=$MP_PREFIX --with-applications-dir=$MP_PREFIX/Applications
>>>>> $ make
>>>>> $ sudo make install
>>>>>
>>>>> * open new terminal
>>>>> * git checkout v2.4.3
>>>>> * configure 2.4.3:
>>>>>
>>>>> $ export PATH=/bin:/sbin:/usr/bin:/usr/sbin
>>>>> $ MP_PREFIX=/opt/macports-2.4.3
>>>>> $ ./configure --prefix=$MP_PREFIX --with-applications-dir=$MP_PREFIX/Applications
>>>>>
>>>>> * At this point src/macports1.0/macports_autoconf.tcl correctly contains `variable macports_version "2.4.3"`
>>>>> * build and install 2.4.3:
>>>>>
>>>>> $ make
>>>>> $ sudo make install
>>>>>
>>>>> * At this point /opt/macports-2.4.3/libexec/macports/lib/macports1.0/macports_autoconf.tcl correctly contains `variable macports_version "2.4.3"`.
>>>>> * But port reports 2.4.2:
>>>>>
>>>>> % echo path
>>>>> /opt/macports-2.4.3/bin:/opt/macports-2.4.3/sbin:/bin:/usr/bin:/usr/ucb:/usr/local/bin
>>>>> % type port
>>>>> port is /opt/macports-2.4.3/bin/port
>>>>> % port version
>>>>> Version: 2.4.2
>>>>
>>>> Just to be absolutely certain which `port' binary you're running:
>>>>
>>>> What happens if you run:
>>>>
>>>> /opt/macports-2.4.3/bin/port version
>>>
>>> Hi Ryan,
>>>
>>> This happens:
>>>
>>> % /opt/macports-2.4.3-clean/bin/port version
>>> Version: 2.4.3
>>
>> Then I would say that MacPorts is working correctly. I would guess that the problem occurred because of your shell's cached lookup of the port command in the previous /opt/macports-2.4.2 location.
>
More information about the macports-dev
mailing list