Skip to content

Commit c3d0825

Browse files
authored
clean stale tbb build artifacts before shipping libraries (#255)
Long-lived working trees can carry TBB libraries in src/tbb/build/lib_release from prior builds -- including from the pre-6.0 make-based build system, whose Windows DLLs (tbb.dll, tbbmalloc.dll, tbbmalloc_proxy.dll) could be swept into the installed package and mask the tbb stub library. - clear lib_release before repopulating it in useBundledTbb(), so installs ship exactly what the current build produced - enable the (previously commented-out) removal of src/tbb/build in cleanup.R; since the cmake migration, the bundled TBB is rebuilt from scratch on every install, so these artifacts are not reused anyway
1 parent 6e20b49 commit c3d0825

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/install.libs.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ useBundledTbb <- function() {
236236
full.names = TRUE
237237
)
238238

239+
# clear any artifacts from prior builds, so that we only ship
240+
# the libraries produced by the build above
241+
unlink("tbb/build/lib_release", recursive = TRUE)
242+
239243
dir.create("tbb/build/lib_release", recursive = TRUE, showWarnings = FALSE)
240244
file.copy(tbbFiles, "tbb/build/lib_release", overwrite = TRUE)
241245
unlink("tbb/build-tbb", recursive = TRUE)

tools/config/cleanup.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
# Clean up files generated during configuration here.
33
# Use 'remove_file()' to remove files generated during configuration.
44

5-
# unlink("src/tbb/build", recursive = TRUE)
6-
# unlink("src/tbb/build-tbb", recursive = TRUE)
5+
# NOTE: stale artifacts in src/tbb/build can otherwise be swept into the
6+
# installed package; the bundled TBB is rebuilt from scratch on each
7+
# install, so nothing is lost by removing these
8+
unlink("src/tbb/build", recursive = TRUE)
9+
unlink("src/tbb/build-tbb", recursive = TRUE)
710
unlink("inst/lib", recursive = TRUE)
811
unlink("inst/libs", recursive = TRUE)
912
unlink("inst/include/index.html", recursive = TRUE)

0 commit comments

Comments
 (0)