Skip to content

Upgrade windows docker images base to Ubuntu 24.04#1755

Open
Raniz85 wants to merge 1 commit into
cross-rs:mainfrom
Raniz85:ubuntu-24.04-pc-windows-gnu
Open

Upgrade windows docker images base to Ubuntu 24.04#1755
Raniz85 wants to merge 1 commit into
cross-rs:mainfrom
Raniz85:ubuntu-24.04-pc-windows-gnu

Conversation

@Raniz85

@Raniz85 Raniz85 commented Mar 11, 2026

Copy link
Copy Markdown

Newer versions of Rust require a newer version of MingW.

Fixes #1754, #1737

@Emilgardis

Copy link
Copy Markdown
Member

/ci try --target *indows-gnu

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Try run for comment

Failed Jobs

@Raniz85

Raniz85 commented Mar 11, 2026 via email

Copy link
Copy Markdown
Author

@Emilgardis

Copy link
Copy Markdown
Member

have a look at #1580 also, where we've been trying to bump the image

Newer versions of Rust require a newer version of MingW.

Fixes cross-rs#1754, cross-rs#1737
@Raniz85 Raniz85 force-pushed the ubuntu-24.04-pc-windows-gnu branch from 82b57ad to 38d5272 Compare March 12, 2026 12:37
@Raniz85

Raniz85 commented Mar 12, 2026

Copy link
Copy Markdown
Author

This turned out to be quite the rabbit hole. Made deeper because I haven't worked with C++ for some 20 years :S

I've spent considerable time trying to figure out what goes wrong - with a lot of help from pushing Claude in various directions.

The issue seems to be that the rust-cmake-hello-world crate is incompatible with newer GCC.
The reason that Claude gave me is that re2 uses call_once which is reliant on thread locals and this doesn't work with MingW-GCC-13 across DLL-boundaries. I found some info online that seems to support this (among others, this: llvm/llvm-project#161039).

The solution is to either force libstdc++ to be linked statically (I don't like this solution) or to upgrade RE2 (newer versions doesn't seem to use call_once, which turned out to be a bit of a rabbit hole itself :)

Either way, the fix needs to be done in https://github.com/cross-rs/rust-cmake-hello-world.

I think that upgrading RE2 is the better option, but that will break the test for most (all?) other images right now since they don't support C++17, which Abseil (a dependency of RE2 since ~May 2024) requires - it could help the effort in #1850 though since 24.04 has toolchains that support C++17.

There's a PR open on rust-cmake-hello-world to upgrade RE2, once that is merged, the CI run should pass for these images again (though it will break for pretty much all the other images that use GCC-8 or older).

One option would be to point test.sh to specific revisions of rust-cmake-hello-world instead of main until all images have been updated.

@Raniz85

Raniz85 commented Mar 12, 2026

Copy link
Copy Markdown
Author

Two questions:

  1. Should I change test.sh to use different refs for rust-cmake-hello-world depending on which image we're testing?
  2. Should we combine this PR with Updated Docker image to Ubuntu-24.04 and Cargo dependencies #1580?

@Emilgardis

Copy link
Copy Markdown
Member

I think using different refs makes sense, I switched the PR to be put on branch 24 so we can make the test script use that branch instead when needed

@Emilgardis

Copy link
Copy Markdown
Member

We can combine the prs, but we can also just rebase the other one on top of it :) small incremental changes are nice though also

@Raniz85

Raniz85 commented Mar 16, 2026

Copy link
Copy Markdown
Author

I agree :)

I'll update the test script to use the new ref and then we can retry the image tests

@MichaIng

MichaIng commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Since Debian/Ubuntu dropped sjlj for dwarf already (which you see in your updated patch as well), this isn't a reason anymore to compile the mingw compilers from source. Using the distro packages also makes assuring the POSIX variant obsolete, since there are explicit packages for this now: g++-mingw-w64-x86-64-posix gfortran-mingw-w64-x86-64-posix

So that way, the mingw.sh could be skipped and removed.

I am working on this on my fork as a continuation of #1580: MichaIng#2

But for cargo tests with --features=re2, I get a null pointer dereference:

wine: Unhandled page fault on execute access to 0000000000000000 at address 0000000000000000

Hence I removed cpp = true from the targets.toml for the two windows-gnu targets.

Or am I missing something, and own mingw compiler builds are still needed, and probably solve this particular issue I see with re2?


What I am still fiddling with on my fork is Solaris: #1599 #1730
I recognized a little late that I am working on issues unrelated to Ubuntu 20.04 => 24.04, but as I am on it ... DilOS 2 libs are too old for recent Rust, it seems DilOS 3 is inevitable (not released, just saw the APT suite, but it is empty). But I am still trying to do some linker mapping from new/missing to old/existing symbols. But this is another topic. I'll try to get everything green on my fork, and open a new PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x86_64-pc-windows-gnu image 0.2.5: link failure — GetHostNameW missing from mingw-w64

3 participants