Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): do not use mongodbtoolchain v4 to compile mongosh MONGOSH-1604 #1684

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

addaleax
Copy link
Contributor

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.

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.
@addaleax addaleax merged commit d790fcb into main Sep 26, 2023
2 checks passed
@addaleax addaleax deleted the 1604-dev branch September 26, 2023 12:39
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.

2 participants