Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
This can be done, for instance, with the following patch: --- a/contrib/devtools/shell-win64-cross.nix
+++ b/contrib/devtools/shell-win64-cross.nix
@@ -16,9 +16,18 @@ let
});
toolchain = crossPkgs.stdenv.cc.targetPrefix;
pthreads = crossPkgs.windows.pthreads;
+ gccVersion = "14.2.0";
crossGcc = crossPkgs.buildPackages.gcc14;
- gcc = crossGcc.override {
+ gcc = (crossGcc.override {
cc = crossGcc.cc.overrideAttrs (old: {
+ version = gccVersion;
+ name = builtins.replaceStrings [ old.version ] [ gccVersion ] old.name;
+ postPatch = builtins.replaceStrings [ old.version ] [ gccVersion ] old.postPatch;
+ configureFlags = map (builtins.replaceStrings [ old.version ] [ gccVersion ]) old.configureFlags;
+ src = pkgs.fetchurl {
+ url = "mirror://gcc/releases/gcc-${gccVersion}/gcc-${gccVersion}.tar.xz";
+ sha256 = "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9";
+ };
# Keep target pthread headers out of GCC's native build tools.
env = old.env // {
EXTRA_FLAGS_FOR_TARGET =
@@ -28,7 +37,9 @@ let
};
});
extraPackages = [ pthreads ];
- };
+ }).overrideAttrs (_: {
+ version = gccVersion;
+ });
in
pkgs.mkShellNoCC { |
|
Could address the Ralph comment? |
|
Can you elaborate on the motivation here? Why this bug specifically? Which users (compiling in what currently used environments) do we expect to hit this? |
Even after #36042, users can hit this bug in a build environment we don’t control (e.g. a distro’s |
|
Seems harmless to add the test. An alternative could be to reject g++-mingw less than 14.3 during configure? |
The code in `BerkeleyRODatabase::Backup()` relies on `copy_file()` with `overwrite_existing` working. Upstream fixes: - gcc-mirror/gcc@017e3f8 - gcc-mirror/gcc@35c9814 - gcc-mirror/gcc@8b3e47b
0b28cda to
37c2ad6
Compare
Done. |
Thanks:
It's not clear that adding a test here is that useful, unless you expect cross-compiling end-users are running the unit test binary on their systems before running bitcoind? Otherwise, as mentioned above, maybe it'd be better to reject the compiler outright. It's also not clear what runtime failure / bug the user would be prevented from hitting (by seeing this test failure) if they happened to be using a broken compiler. If I understand correctly, does this mean that migration has likely never worked on windows with GCC-based cross-compiled binaries, but also nobody has ever reported it? There are lots of compiler bugs, and we don't add tests for many of them, and the PR description / commit messages here don't really justify the changes, or explain how a user would be affected by this at runtime, if they used a broken compiler. |
| fs::remove(path2); | ||
| } | ||
|
|
||
| // Catches a libstdc++ bug on Windows (fixed in GCC 13.4/14.3/15.1, never |
There was a problem hiding this comment.
(fixed in GCC 13.4 ... never in 12.x)
One other point here is that we have been shipping Windows release binaries (28.0 with 12.4.0 & 29.0/30.0 with 13.3.0), which should have this bug. 30.0 is still supported, so if this is serious enough to warrant a unit test now, shouldn't we be patching the compiler/libstdc++ in Guix and doing a point release with the fix?
|
I have to admit that I can’t see a real-life scenario in which the bug affects users. The code is reachable only when migrating a legacy BDB wallet, either via the The |
|
It seems to me this is either:
Either way, adding a test that fails where we expect it to fail doesn't seem very helpful to me. |
Could we? |
It seems like a bugfix, because migration shouldn't overwrite? |
|
What's the status here? Looks like there's not agreement to add the test, and no interest in fixing the release binaries, so maybe a new pull can be opened for a wallet refactor? Or something can be done following #34193? |

The code in
BerkeleyRODatabase::Backup()relies oncopy_file()withoverwrite_existingworking.Upstream fixes:
Suggested in #36271 (comment).
Here is an example of the failure when cross-compiling for Windows using GCC 14.2.0: