Skip to content

Use a temp directory for CMake build#3254

Draft
fheinecke wants to merge 1 commit into
NVIDIA:mainfrom
fheinecke:fred/cmake-build-isolation-1
Draft

Use a temp directory for CMake build#3254
fheinecke wants to merge 1 commit into
NVIDIA:mainfrom
fheinecke:fred/cmake-build-isolation-1

Conversation

@fheinecke

Copy link
Copy Markdown
Collaborator

Description

CMake currently always uses ./build/cmake as a build directory when NVTE_CMAKE_BUILD_DIR is not set. This causes a couple of issues:

  • Builds can collide with each other
  • Generated files can become stale and require cleaning prior to every build
  • Build files are not cleaned up upon success nor failure

This creates a temporary directory and cleans it up afterwards. Note: this makes it harder to inspect the build directory, because it will now be cleaned up after every run. For this use case I would recommend setting `NVTE_CMAKE_BUILD_DIR="${PWD}/build/cmake" to retain the current behavior. As a result of moving to a temp directory, object files will now not be reused between builds as well.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • CMake extension builds are now isolated

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Fred Heinecke <fheinecke@nvidia.com>
@fheinecke

Copy link
Copy Markdown
Collaborator Author

/te-ci

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.

1 participant