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

[FEA] detect and clean out build dirs if building in a central location #2

Open
trxcllnt opened this issue May 7, 2021 · 1 comment
Labels
0 - Backlog In queue waiting for assignment feature request New feature or request good first issue Good for newcomers

Comments

@trxcllnt
Copy link
Contributor

trxcllnt commented May 7, 2021

Related to #1, sometimes project dependencies fail to build for various reasons. Doing a clean rebuild of the dependent project won't detect that one of its dependencies didn't build and clean-build it too, because clean builds of the dependent project don't (shouldn't?) clean out the dependency build cache.

It's kind of a hacky solution, but we have a CMake function that checks whether the files for a dependency exist, and if not, deletes ${FETCHCONTENT_BASE_DIR}/${pkg}-build and ${FETCHCONTENT_BASE_DIR}/${pkg}-subbuild directories before calling CPMFindPackage:

function(_clean_build_dirs_if_not_fully_built dir soname)
  if (NOT EXISTS "${CPM_BINARY_CACHE}/${dir}-build/${soname}")
    file(REMOVE_RECURSE "${CPM_BINARY_CACHE}/${dir}-build")
    file(REMOVE_RECURSE "${CPM_BINARY_CACHE}/${dir}-subbuild")
  endif()
endfunction()
@trxcllnt trxcllnt added feature request New feature or request ? - Needs Triage Need team to review and classify labels May 7, 2021
@robertmaynard robertmaynard added good first issue Good for newcomers and removed ? - Needs Triage Need team to review and classify labels May 10, 2021
@robertmaynard
Copy link
Contributor

for rapids-cmake I expect the signature would look like:

rapids_cpm_clean_build_directory( 
   <ProjectName>
   SENTINEL_FILE [relative_path]
   )

robertmaynard added a commit to robertmaynard/rapids-cmake that referenced this issue Jul 29, 2021
To properly test `cpm` packages in rapids-cmake we need to fix
two major issues.

 1. A way to have tests that depend on the same CPM package
    not execute at the same time. This is required so we don't
    double checkout a project

 2. A way to checkout and build projects such as RMM that themselves
    use rapids-cmake without issue.

Number rapidsai#1 is solved by the introduction of the `SERIAL` keyword

Number rapidsai#2 is solved for most tests by having the `project_template`
that `.cmake` tests use get `rapids-cmake` via FETCH_CONENT. This
will allow us to verify local rapids-cmake changes against existing
projects that use rapids-cmake
rapids-bot bot pushed a commit that referenced this issue Aug 2, 2021
To properly test `cpm` packages in rapids-cmake we need to fix
two major issues.

 1. A way to have tests that depend on the same CPM package
    not execute at the same time. This is required so we don't
    double checkout a project

 2. A way to checkout and build projects such as RMM that themselves
    use rapids-cmake without issue.

Number #1 is solved by the introduction of the `SERIAL` keyword

Number #2 is solved for most tests by having the `project_template`
that `.cmake` tests use get `rapids-cmake` via FETCH_CONENT. This
will allow us to verify local rapids-cmake changes against existing
projects that use rapids-cmake

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers: None

URL: #48
@robertmaynard robertmaynard added the 0 - Backlog In queue waiting for assignment label Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog In queue waiting for assignment feature request New feature or request good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

2 participants