fix(ci): do not use mongodbtoolchain v4 to compile mongosh MONGOSH-1604 #1684
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On x64 Linux, the v4 mongodbtoolchain gcc is configured with
--with-arch=sandybridge
, raising the minimum CPU requirements to that level. In particular, availability of the AVX CPU feature is made a prerequisite for the generated executables to run.It is possible to override this default for the v4 mongodbtoolchain when compiling a specific executable. However, another quirk of this toolchain (and reason why we want to migrate away from it) is that it statically links in the C++ standard library, which has unfortunately been compiled using the compiler's defaults.
On the server side, 5.0+ uses AVX as a minimum hardware requirement, but since mongosh 2.x is intended to support both 4.2 and 4.4, we should stick to the requirements of these older versions.
So, for now, just switch back to the v3 mongodbtoolchain, which seems to work fine in terms of compiling mongosh. The Node.js configure script does warn that the gcc version (8.5.0) in this toolchain is no longer officially supported, so that underlines the importance of switching away from the server’s toolchain in the near future (MONGOSH-864).
We “test” this by inspecting the generated binary and looking at the instructions it contains, rather than trying to emulate older hardware.