How to make sure that one port gets updated before another? (MinGW)

Mojca Miklavec mojca at macports.org
Sat Oct 27 17:53:12 UTC 2018


On Fri, 26 Oct 2018 at 23:26, Joshua Root wrote:
> On 2018-10-27 08:20 , Mojca Miklavec wrote:
> > On Fri, 26 Oct 2018 at 22:58, Joshua Root wrote:
> >> On 2018-10-27 07:27 , Mojca Miklavec wrote:
> >>> Hi,
> >>>
> >>> A while ago I tried to update MinGW-w64 to version 6. The problem is
> >>> that one needs to update both of these ports:
> >>>     x86_64-w64-mingw32-crt         5.0.4_0 < 6.0.0_0
> >>>     x86_64-w64-mingw32-winpthreads 5.0.4_0 < 6.0.0_0
> >>> but I cannot figure out how to force "sudo port upgrade outdated" to
> >>> update the crt port first. I did try to add the crt port to explicit
> >>> dependencies, but it doesn't seem to help.
> >>
> >> If A depends on B, then B will be upgraded before A.
> >
> > Except that this doesn't happen in my case.
> >
> > I added an explicit dependency on x86_64-w64-mingw32-crt (both build
> > and lib, just to be sure) and it's still not being updated before
> > x86_64-w64-mingw32-winpthreads.
>
> If dependencies didn't get upgraded before their dependents, there would
> be a lot of serious problems. Since we don't see that,

Except ... hmmm ...
    https://trac.macports.org/ticket/57457
    Travis CI: Sometimes declared dependencies aren't installed
?

> let's assume
> something else is going on here. Is there an actual circular dependency?

That's why I came up to ask for someone's help.

For the port x86_64-w64-mingw32-crt there is
    depends_build bin:x86_64-w64-mingw32-gcc:x86_64-w64-mingw32-gcc-bootstrap
which is satisfied by either of these:
- x86_64-w64-mingw32-gcc-bootstrap
- x86_64-w64-mingw32-gcc-nothreads
- x86_64-w64-mingw32-gcc

For the port x86_64-w64-mingw32-winpthreads there is now
    depends_build \
        path:x86_64-w64-mingw32/lib/libgcc_s.a:x86_64-w64-mingw32-gcc-nothreads
\
        port:x86_64-w64-mingw32-crt
where the first dependency is satisfied by either of the two:
- x86_64-w64-mingw32-gcc-nothreads
- x86_64-w64-mingw32-gcc

Further, the port x86_64-w64-mingw32-gcc-nothreads depends on:
    depends_lib port:x86_64-w64-mingw32-crt
    depends_build bin:x86_64-w64-mingw32-gcc:x86_64-w64-mingw32-gcc-bootstrap
and the port x86_64-w64-mingw32-gcc depends on
    depends_lib
        port:x86_64-w64-mingw32-crt \
        port:x86_64-w64-mingw32-winpthreads
   depends_build \
        path:x86_64-w64-mingw32/lib/libgcc_s.a:x86_64-w64-mingw32-gcc-nothreads

At the time of updating both of these ports are deactivated:
    x86_64-w64-mingw32-gcc-bootstrap
    x86_64-w64-mingw32-gcc-nothreads
and only
    x86_64-w64-mingw32-gcc
is activated.

So in theory crt and winpthreads are runtime dependencies of gcc,
while gcc could in theory be considered a *build* dependency of both
crt and winpthreads. I don't know whether that counts as a dependency
cycle or not. But gcc is up to date.

> > Note that MacPorts doesn't complain about a dependency cycle
> It won't if it can find some port that can be upgraded. Upgrade can work
> a little differently to install in this respect, since often all
> dependencies are already installed (if not the latest version).

In general you then users wouldn't even notice this issue. At least it
has never been the issue for me for the exact same ports as long as I
was upgrading to the next (minor) version. But it became an issue when
updating from version 5.0.4 to 6.0.0 since winpthreads apparently
cannot be built against crt that's too old. I assume that users
getting binary updates would not be hit by the problem, but I don't
want to hurt those who install from source.

Mojca


More information about the macports-dev mailing list