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

maint: Cleanup CMake files and delete not compiled files #3667

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

mathbunnyru
Copy link
Contributor

I did the following:

  • sorted the order files are mentioned in cmake files
  • added missing entries
  • deleted files which are not compiled at all (I guess we don't need them?)

Comment on lines 165 to +166
${LIBMAMBA_SOURCE_DIR}/util/url_manip.cpp
${LIBMAMBA_SOURCE_DIR}/util/url.cpp
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the correct sort order, and this is how it shows up in the tree list in VS Code, for example

${LIBMAMBA_INCLUDE_DIR}/mamba/util/variant_cmp.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/util/weakening_map.hpp
# Implementation of version and matching specs
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/archive.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/authentication_info.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/build_number_spec.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/channel.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/chimera_string_spec.hpp
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an example of missing line. Everything will work except that VS Code will give errors when you open this file - it annoyed me, so I decided to create this PR

@@ -1,182 +0,0 @@
// Copyright (c) 2023, QuantStack and Mamba Contributors
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is not included by anyone, and both it and .cpp file are not mentioned in CMake, so I think it's safe to remove it.
Please, make sure I'm right

@@ -1,414 +0,0 @@
// Copyright (c) Alex Movsisyan
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file and server.cpp are not mentioned in CMake at all, so I think it's safe to remove it.
Please, make sure I'm right.

@@ -11,6 +11,7 @@ add_executable(
src/main.cpp
src/msvc_catch_string_view.cpp
src/pool_data.cpp
src/pool_data.hpp
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no separation for source and header files here, so we should mention this header file as well.

Copy link
Member

Choose a reason for hiding this comment

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

This header file is not required strictly here, but for proper IDE integration, is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.
And it also makes it consistent (all source/header files are present in CMake files).

@jjerphan jjerphan added the release::ci_docs For PRs related to CI or documentation label Dec 9, 2024
@mathbunnyru mathbunnyru changed the title maint: Cleanup CMake file and delete not compiled files maint: Cleanup CMake flis and delete not compiled files Dec 9, 2024
@mathbunnyru mathbunnyru changed the title maint: Cleanup CMake flis and delete not compiled files maint: Cleanup CMake files and delete not compiled files Dec 9, 2024
Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

LGTM.

We need to add code coverage to see any potential dead code which may exist, see #2866.

I just have one minor comment.

@@ -11,6 +11,7 @@ add_executable(
src/main.cpp
src/msvc_catch_string_view.cpp
src/pool_data.cpp
src/pool_data.hpp
Copy link
Member

Choose a reason for hiding this comment

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

This header file is not required strictly here, but for proper IDE integration, is that right?

@mathbunnyru
Copy link
Contributor Author

LGTM.

We need to add code coverage to see any potential dead code which may exist, see #2866.

I just have one minor comment.

Thanks! Replied to your comment.

I agree that having coverage would be nice, but I don't think it would help here.
As far as I know, it only works for source/header files that are actually compiled.
So, if you have a header file, which is not included anywhere, or source file, which is not compiled, it won't not work.
(I might be wrong here)

@jjerphan
Copy link
Member

jjerphan commented Dec 9, 2024

I agree with you and I meant that adding code coverage is an addiction to dead code elimination. 🙂

@mathbunnyru
Copy link
Contributor Author

@jjerphan I think this is ready to be merged as well 🙂

@jjerphan
Copy link
Member

jjerphan commented Dec 9, 2024

For this one, I would wait for another review of the team.

Copy link
Member

Choose a reason for hiding this comment

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

This file is still used in micromamba's CMakeLists.txt, and it includes microserver.cpp, so I don't think we should remove them for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JohanMabille thanks!
I didn't notice that. Returned these files back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just as a note: these files are not compiled in any way right now, and their compilation is significantly broken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, I think, if we want to keep these files, we need to fix the compilation and add it to the CI.
Otherwise we'll just have broken files in the repo, which no one is able to use easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an issue: #3677

Copy link
Member

Choose a reason for hiding this comment

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

@mathbunnyru I agree; IIRC we initially wanted to remove these files and then realized we need them for another project (I think Quetz). We kept them for reference because we need to refactor them (ok, maybe it will be a full rewrite, but we still need to keep them for now), but did not have the bandwidth to do it. We'll probably tackle this in 2025.

@JohanMabille JohanMabille merged commit 76d06a7 into mamba-org:main Dec 9, 2024
34 checks passed
@JohanMabille
Copy link
Member

Thanks for the cleanup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::ci_docs For PRs related to CI or documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants