Skip to content

Miscellaneous EVG compilation script improvements #1710

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

Merged
merged 8 commits into from
Aug 28, 2024

Conversation

eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Aug 27, 2024

Followup to #1524. Verified by this patch.

Addresses the following error on some Windows distros when used with the old CCache.cmake module (discovered while testing the C++ Driver; this does not break builds but does impact ccache efficiency):

ccache: error: CCACHE_BASEDIR: not an absolute path: "/cygdrive/c/data/mci/.../mongo-cxx-driver"

Applies a proper transformation to Windows path form on Windows distros to avoid Windows-side cmake or ccache confusion of file paths.

Additional improvements include:

  • removing a pre-1.11.0 libmongocrypt workaround now that 1.11.0 is released.
  • simplifying DEBUG vs. RELEASE variable checks in compile scripts (mutually exclusive options). We should consider refactoring the config to use only one or the other.
  • Avoiding in-source builds of the C Driver by using the build subdirectory as the binary directory for CMake.

@eramongodb eramongodb requested a review from kevinAlbs August 27, 2024 18:59
@eramongodb eramongodb self-assigned this Aug 27, 2024
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor suggestions.

@@ -82,8 +82,14 @@ configure_flags_append_if_not_null SRV "-DENABLE_SRV=${SRV}"
configure_flags_append_if_not_null TRACING "-DENABLE_TRACING=${TRACING}"
configure_flags_append_if_not_null ZLIB "-DENABLE_ZLIB=${ZLIB}"

if [[ "${DEBUG:-}" == "ON" && "${RELEASE:-}" == "ON" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider refactoring the config to use only one or the other.

Consider removing RELEASE since it appears unused. Though it could be done in a future PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RELEASE is used by the release-compile EVG task. It may be preferable to remove DEBUG instead and let all EVG tasks use Debug build type by default.

"${cmake_binary}" "${configure_flags[@]}" ${extra_configure_flags[@]+"${extra_configure_flags[@]}"} .
"${cmake_binary}" --build .
"${cmake_binary}" --install .
"${cmake_binary}" -S . -B build "${configure_flags[@]}" ${extra_configure_flags[@]+"${extra_configure_flags[@]}"} .
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"${cmake_binary}" -S . -B build "${configure_flags[@]}" ${extra_configure_flags[@]+"${extra_configure_flags[@]}"} .
"${cmake_binary}" -S . -B cmake-build "${configure_flags[@]}" ${extra_configure_flags[@]+"${extra_configure_flags[@]}"} .

Consider using cmake-build to avoid possibly interfering with existing files in the build directory.

@eramongodb
Copy link
Contributor Author

Latest changes verified by this patch.

@eramongodb eramongodb requested a review from kevinAlbs August 27, 2024 21:47
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with another DEBUG removal.

@@ -736,7 +736,7 @@ def pre_commands(self) -> Iterable[Value]:
commands=[
shell_mongoc(
"""
env SANITIZE=address DEBUG=ON SASL=AUTO SSL=OPENSSL EXTRA_CONFIGURE_FLAGS='-DENABLE_EXTRA_ALIGNMENT=OFF' .evergreen/scripts/compile.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove reference to no-longer-needed DEBUG environment variable on line 74:

        if config == "debug":
            self.compile_sh_opt["DEBUG"] = "ON"
        else:
            assert config == "release"
            self.compile_sh_opt["RELEASE"] = "ON"

@eramongodb eramongodb merged commit 332365b into mongodb:master Aug 28, 2024
1 check was pending
@eramongodb eramongodb deleted the cdriver-ccache branch August 28, 2024 14:10
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