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

3rdparty: Disable tests and tools for ada #14618

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

BenPope
Copy link
Member

@BenPope BenPope commented Nov 2, 2023

ada uses CPM: https://github.com/cpm-cmake/CPM.cmake

Disable ADA_TESTING, ADA_TOOLS, ADA_BENCHMARKING to prevent CPM from downloading 3rdparty repositories.

I'm still seeing this message:

Generating ada.cpp, ada.h, ada_c.h, demo.cpp, demo.c, README.md
fatal: detected dubious ownership in repository at '/var/lib/buildkite-agent/builds/buildkite-amd64-builders-i-0d17fc136ea6bdd74-1/redpanda/redpanda'

Also add the license.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.2.x
  • v23.1.x
  • v22.3.x

Release Notes

  • none

@BenPope BenPope requested review from dotnwat and rockwotj November 2, 2023 11:08
@BenPope BenPope requested review from a team, emaxerrno and dswang as code owners November 2, 2023 11:08
@BenPope BenPope requested review from nk-87 and removed request for a team November 2, 2023 11:08
@BenPope BenPope self-assigned this Nov 2, 2023
@BenPope BenPope force-pushed the 3rdparty_ada_url_no_cpm branch from f533a85 to ee4caca Compare November 2, 2023 12:00
@vbotbuildovich
Copy link
Collaborator

new failures detected in https://buildkite.com/redpanda/redpanda/builds/40302#018b9014-082f-457f-8d12-f89d7d17bf4e: "rptest.tests.rpk_registry_test.RpkRegistryTest.test_produce_consume_proto"

rockwotj
rockwotj previously approved these changes Nov 2, 2023
Copy link
Contributor

@rockwotj rockwotj left a comment

Choose a reason for hiding this comment

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

Maybe they would take patches to allow disabling testing via an ADA_TESTING option, I don't love the workarounds here, but alas cmake.

Should we be doing this for vtools too?

Comment on lines 116 to 120
FetchContent_Populate(ada)
set(GIT_EXECUTABLE_OLD ${GIT_EXECUTABLE})
set(GIT_EXECUTABLE "" CACHE INTERNAL "Invalid path to the Git executable")
add_subdirectory(${ada_SOURCE_DIR} ${ada_BINARY_DIR})
set(GIT_EXECUTABLE ${GIT_EXECUTABLE_OLD} CACHE STRING "location of git" FORCE)
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems not fun.

Should we be setting BUILD_TESTING to OFF instead of this hack around disabling the git exec lookup?

Additionally we should be able to set(ADA_TOOLS OFF) to disable building the tools right? That feels like a slightly better solution, but ideally they had an option like ADA_TESTING instead of BUILD_TESTING right?

I guess this ends up being net less because we'll have to do the same BUILD_TESTING hack to disable and re-enable as we only want tests in our repo.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you mean like before I force pushed

Copy link
Member Author

Choose a reason for hiding this comment

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

I was seeing some git activity, and was trying to get rid of: "detected dubious ownership in repository at"

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ambivalent. Ideally we just did something like:

set(ADA_TOOLS OFF) and set(ADA_TESTING OFF) and called it a day (without the set it back hack). I'm fine with this, but would love Noah's opinion here. I'm a CMake newbie.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was seeing some git activity, and was trying to get rid of: "detected dubious ownership in repository at"

Did this fix it?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's no git activity now! But same error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Bummer...

It looks like they distribute a single header version in releases... Is it easy in CMake to download that and add it as a target?

https://github.com/ada-url/ada/releases/tag/v2.7.2

Anyways I'm not trying to add more work for you, we can just start with this.

@vbotbuildovich
Copy link
Collaborator

new failures detected in https://buildkite.com/redpanda/redpanda/builds/40302#018b9023-0464-4a30-b3aa-8ad2feb8f29e: "rptest.tests.topic_recovery_test.TopicRecoveryTest.test_time_based_retention.cloud_storage_type=CloudStorageType.ABS"

@BenPope
Copy link
Member Author

BenPope commented Nov 2, 2023

Should we be doing this for vtools too?

Yeah, I'll make equivalent changes when this is merged.

Comment on lines 111 to 120
FetchContent_GetProperties(ada)
if(NOT ada_POPULATED)
# Disable git to prevent CPM from downloading 3rdparty repositories.
# An intentional side effect is that tests and tools are not built

FetchContent_Populate(ada)
set(GIT_EXECUTABLE_OLD ${GIT_EXECUTABLE})
set(GIT_EXECUTABLE "" CACHE INTERNAL "Invalid path to the Git executable")
add_subdirectory(${ada_SOURCE_DIR} ${ada_BINARY_DIR})
set(GIT_EXECUTABLE ${GIT_EXECUTABLE_OLD} CACHE STRING "location of git" FORCE)
Copy link
Member

Choose a reason for hiding this comment

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

the simplest thing to do is fork ada and write a better cmake file. i did it for several of the dependencies in here, and it is pretty easy since we don't have maintain tests, benchmarks, installation, etc...

Copy link
Member

Choose a reason for hiding this comment

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

alternatively, you can check-in a patch to the cmakefile and have fetchcontent apply the patch.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @travisdowns knows one of the maintainers, so maybe we can get them to apply the patch (or just write a dumb CMake file for the single file version).

Copy link
Member

Choose a reason for hiding this comment

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

yeh if we want to go through upstream that works. the problems with the ada cmake file are pretty reasonable i would expect maintainers to pick fixes for them. here is the one i did for Avro https://github.com/redpanda-data/avro/blob/release-1.11.1-redpanda/redpanda_build/CMakeLists.txt as an example of a custom cmakefile.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dotnwat Any objection to merging this as-is to mitigate this type of failure and then reworking the build in followup work?

@vbotbuildovich
Copy link
Collaborator

new failures detected in https://buildkite.com/redpanda/redpanda/builds/40302#018b906e-19e6-41a5-b6c0-54cb82495fb3: "rptest.tests.partition_movement_test.PartitionMovementTest.test_deletion_stops_move.num_to_upgrade=2"

@BenPope
Copy link
Member Author

BenPope commented Nov 2, 2023

CI Failures are unrelated as this just affects the public build.

@anonrig
Copy link

anonrig commented Nov 8, 2023

Maybe they would take patches to allow disabling testing via an ADA_TESTING option, I don't love the workarounds here, but alas cmake.

We are open to any patches :-)

@rockwotj
Copy link
Contributor

rockwotj commented Nov 8, 2023

@anonrig Wow I don't know if someone pointed you here, but 🙏

I created a PR to what I believe would work for us: ada-url/ada#557

@BenPope and @dotnwat feel free to take a peek at that patch, I believe that should work here, but you're both better at CMake than I am.

nk-87
nk-87 previously approved these changes Nov 8, 2023
ada uses CPM: https://github.com/cpm-cmake/CPM.cmake

Disable ADA_TESTING, ADA_TOOLS, ADA_BENCHMARKING to prevent CPM
from downloading 3rdparty repositories.

Also add the license.

Signed-off-by: Ben Pope <ben@redpanda.com>
@BenPope BenPope dismissed stale reviews from nk-87 and rockwotj via ad41585 November 10, 2023 11:15
@BenPope BenPope force-pushed the 3rdparty_ada_url_no_cpm branch from ee4caca to ad41585 Compare November 10, 2023 11:15
@BenPope BenPope requested review from dotnwat and rockwotj November 10, 2023 11:16
Copy link
Contributor

@rockwotj rockwotj left a comment

Choose a reason for hiding this comment

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

Are you still seeing the issue on dubious ownership? If not, please update the cover letter.

@BenPope
Copy link
Member Author

BenPope commented Nov 10, 2023

Are you still seeing the issue on dubious ownership? If not, please update the cover letter.

Yes, because the single header is always built.

@vbotbuildovich
Copy link
Collaborator

new failures in https://buildkite.com/redpanda/redpanda/builds/40829#018bb942-82e6-4915-ae94-35321b5ee95c:

"rptest.tests.cloud_storage_scrubber_test.CloudStorageScrubberTest.test_scrubber.cloud_storage_type=CloudStorageType.ABS"

@BenPope BenPope merged commit 912d051 into redpanda-data:dev Nov 13, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants