> On Apr 14, 2022, at 14:56, Peter Serocka <pesero...@gmail.com> wrote:
>
>
>
>> On Apr 14, 2022, at 14:10, chilli.names...@gmail.com wrote:
>>
>>
>>
>> Thinking more about upgrading, maybe there's an Xcode version issue?
>> MacPorts requires Xcode's command line tools. Though a newer version of
>> macOS can run older and outdated versions of Xcode, after upgrading the OS,
>> the user will often find Xcode greyed out with the circle with the line
>> through it. Upgrading macOS didn't used to do this, but it apparently does
>> now. There are steps (or tricks) available now to get older Xcode versions
>> working with a newer mismatched macOS version. But I bet that's why port is
>> choking after upgrade: maybe port still works, but the upgrade broke Xcode,
>> so port chokes. A wild guess.
>>
>
> Xcode version mismatch issues do exist in some situations, and I have been
> dealing with those; but my point here is that the port command itself refuses
> to do any further work after a major macOS upgrade. It chokes quite early,
> inside proc mportinit found in
> <prefix>/libexec/macports/lib/macports1.0/macports.tclmacports.tcl
> and the error message is:
>
> Error: Current platform "darwin 19" does not match expected platform "darwin
> 18"
> Error: If you upgraded your OS, please follow the migration instructions:
> https://trac.macports.org/wiki/Migration
> OS platform mismatch
> while executing
> "mportinit ui_options global_options global_variations"
> Error: /opt/macports18/bin/port: Failed to initialize MacPorts, OS platform
> mismatch
>
> Which prevents further upgrades or installs in the existing tree.
>
> (Sadly one can't even run a "port installed" or a "port requested" at this
> point, in case one missed to capture these for reference before the macOS
> upgrade. Just noted as an aside; as this will happen with either prefix,
> default or custom.)
>
I see. MacPorts likes to know things. I seriously doubt it is recommended, but
I'll bet someone on the list knows where you can edit a config and change what
platform MacPorts expects to see. I have done similar to port files to get
newer ports to install on older systems, same kind of hack but... reversed and
for all ports rather than one.
Personally I don't take any issues with starting over. MacPorts is scriptable.
So you run port requested on your current install and look at what you have
installed, and create a simple script to install all those ports after you
upgrade macOS, reinstall Xcode (double check what version goes with what macOS
release) and MacPorts. Personally, I love building software, love to watch the
standard output fly across the screen for as long as it takes, probably because
I'm not a developer. Everyone seems to be sensitive towards those that are too
busy to roll their own, and having binaries available is really a good thing,
because sometimes the binary will install when the port won't build (for
whatever reason, but probably my fault, but if there's no bug, I only see it
after the system gets really old, like in a 10yo Mac OS X). Then I need
direction, which I've gotten here.