sandpaper icon indicating copy to clipboard operation
sandpaper copied to clipboard

Cannot `build_site` or `build_lesson` - ERROR: compilation failed for package 'digest'

Open ehinman opened this issue 4 months ago • 4 comments

Please briefly describe your problem and what output you expect. I am using GitLab to pull down a branch that uses sandpaper to build a carpentries-like lesson. When I open the .RProj for this lesson and run sandpaper::build_lesson(), it errors because the renv.lock file doesn't include sandpaper. After installing sandpaper, I then re-initialize renv and run sandpaper::build_lesson(). It starts installing the packages from the renv folder, but continually fails on the package digest.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.

Brief description of the problem

renv::init()
sandpaper::reset_site()
sandpaper::build_lesson()

Error: 
! in callr subprocess.
Caused by error: 
! Error installing package 'digest':
==================================

* installing *source* package ‘digest’ ...
** this is package ‘digest’ version ‘0.6.36’
** package ‘digest’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘Apple clang version 16.0.0 (clang-1600.0.26.6)’
using C++ compiler: ‘Apple clang version 16.0.0 (clang-1600.0.26.6)’
using SDK: ‘MacOSX15.2.sdk’
clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2   -c SpookyV2.cpp -o SpookyV2.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c aes.c -o aes.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c blake3.c -o blake3.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c blake3_dispatch.c -o blake3_dispatch.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c blake3_portable.c -o blake3_portable.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c crc32.c -o crc32.o
clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2   -c crc32c.cpp -o crc32c.o
clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2   -c crc32c_portable.cpp -o crc32c_portable.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c digest.c -o digest.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c digest2int.c -o digest2int.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init.c -o init.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c md5.c -o md5.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c pmurhash.c -o pmurhash.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I.  -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c raes.c -o raes.o
raes.c:25:3: error: use of undeclared identifier 'Free'; did you mean 'free'?
   25 |   Free(ctx);
      |   ^~~~
      |   free
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:56:7: note: 'free' declared here
   56 | void  free(void * __unsafe_indexable);
      |       ^
raes.c:42:44: error: expected expression
   42 |   ctx = (aes_context*)Calloc(sizeof(*ctx), char);
      |                                            ^
raes.c:42:23: error: use of undeclared identifier 'Calloc'
   42 |   ctx = (aes_context*)Calloc(sizeof(*ctx), char);
      |                       ^
3 errors generated.
make: *** [raes.o] Error 1
ERROR: compilation failed for package ‘digest’
* removing ‘/Users/ehinman/Review_Repos/usgs-data-quality-control-course/renv/profiles/lesson-requirements/renv/library/macos/R-4.5/aarch64-apple-darwin20/.renv/1/digest’
install of package 'digest' failed [error code 1]
ℹ See `$stdout` and `$stderr` for standard output and error.
Type .Last.error to see the more details.

Here's my system information

> Sys.info()
                                                                                                       sysname 
                                                                                                      "Darwin" 
                                                                                                       release 
                                                                                                      "23.6.0" 
                                                                                                       version 
"Darwin Kernel Version 23.6.0: Thu Apr 24 20:29:18 PDT 2025; root:xnu-10063.141.1.705.2~1/RELEASE_ARM64_T6000" 

Thank you!

ehinman avatar Aug 05 '25 14:08 ehinman

Hi @ehinman - do the proposed solutions in these other issues help?

https://github.com/carpentries/sandpaper-docs/issues/150 https://github.com/epiverse-trace/tutorials/issues/30

It might well be that you're using an old digest version in your lockfile that needs updating.

froggleston avatar Aug 05 '25 15:08 froggleston

Thank you for the quick response. I have digest version 0.6.37. I have tried "updating digest in the renv.lock file" and it is still failing. Should I go back to 0.6.33?

ehinman avatar Aug 05 '25 16:08 ehinman

It's definitely worth a try! I'm afraid I don't have a Mac to confirm the issue. Would @tobyhodges or @ErinBecker be able to try a build with your repo to confirm? They both have Macs.

froggleston avatar Aug 05 '25 16:08 froggleston

I can't seem to download an earlier version of digest. I am stuck at "0.6.37", even by running remove.packages("digest") and then install.packages("digest", version = "0.6.33").

ehinman avatar Aug 05 '25 16:08 ehinman