sass package failing to install with {renv} restore, installs okay with install.packages()

Hi, I'm getting the following error message when I try to do a renv restore with my project.

- Installing sass ...                           FAILED
Error: Error installing package 'sass':

* installing *source* package ‘sass’ ...
** package ‘sass’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/Library/Frameworks/R.framework/Resources/share/make/ warning: overriding commands for target `shlib-clean'
Makevars:12: warning: ignoring old commands for target `shlib-clean'
using C compiler: ‘gcc-13 (Homebrew GCC 13.2.0) 13.2.0’
using C++ compiler: ‘g++-13 (Homebrew GCC 13.2.0) 13.2.0’
using SDK: ‘MacOSX13.1.sdk’
/Library/Frameworks/R.framework/Resources/share/make/ warning: overriding commands for target `shlib-clean'
Makevars:12: warning: ignoring old commands for target `shlib-clean'
MAKEFLAGS= make -C libsass clean
rm -f lib/*.a lib/*.so lib/*.dll lib/*.dylib lib/*.la
rmdir lib
rmdir: lib: No such file or directory
make[1]: [clean-objects] Error 1 (ignored)
rm -f   src/cencode.o src/ast.o src/ast_values.o src/ast_supports.o src/ast_sel_cmp.o src/ast_sel_unify.o src/ast_sel_super.o src/ast_sel_weave.o src/ast_selectors.o src/context.o src/constants.o src/fn_utils.o src/fn_miscs.o src/fn_maps.o src/fn_lists.o src/fn_colors.o src/fn_numbers.o src/fn_strings.o src/fn_selectors.o src/color_maps.o src/environment.o src/ast_fwd_decl.o src/bind.o src/file.o src/util.o src/util_string.o src/json.o src/units.o src/values.o src/plugins.o src/source.o src/position.o src/lexer.o src/parser.o src/parser_selectors.o src/prelexer.o src/eval.o src/eval_selectors.o src/expand.o src/listize.o src/cssize.o src/extender.o src/extension.o src/stylesheet.o src/output.o src/inspect.o src/emitter.o src/check_nesting.o src/remove_placeholders.o src/sass.o src/sass_values.o src/sass_context.o src/sass_functions.o src/sass2scss.o src/backtrace.o src/operators.o src/ast2c.o src/c2ast.o src/to_value.o src/source_map.o src/error_handling.o src/memory/allocator.o src/memory/shared_ptr.o src/utf8_string.o src/base64vlq.o 
rm -f compile.o init.o
/Library/Frameworks/R.framework/Resources/share/make/ warning: overriding commands for target `shlib-clean'
Makevars:12: warning: ignoring old commands for target `shlib-clean'
gcc-13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I./libsass/include  -I/opt/R/arm64/include    -fPIC  -mtune=native -g -O2 -Wall -pedantic -Wconversion -c compile.c -o compile.o
g++-13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I./libsass/include  -I/opt/R/arm64/include    -fPIC  -mtune=native -g -O2 -Wall -pedantic -Wconversion -c init.cpp -o init.o
MAKEFLAGS= CC="gcc-13" CFLAGS="-mtune=native -g -O2 -Wall -pedantic -Wconversion" CXX="g++-13" AR="ar" LDFLAGS="-L/opt/R/arm64/lib" make -C libsass
gcc-13 -mtune=native -g -O2 -Wall -pedantic -Wconversion -O2 -I ./include  -stdlib=libc++ -fPIC -c -o src/cencode.o src/cencode.c
g++-13 -Wall -O2 -std=c++11 -I ./include  -stdlib=libc++ -fPIC -c -o src/ast.o src/ast.cpp
In file included from src/memory.hpp:8,
                 from src/sass.hpp:55,
                 from src/ast.cpp:3:
src/memory/allocator.hpp:8:10: fatal error: vector: No such file or directory
    8 | #include <vector>
      |          ^~~~~~~~
compilation terminated.
make[1]: *** [src/ast.o] Error 1
make: *** [libsass/lib/libsass.a] Error 2
ERROR: compilation failed for package ‘sass’
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.7.4

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.2    tools_4.3.2       rstudioapi_0.16.0 renv_1.0.3 

install.packages('sass') works okay so I'm puzzled why renv::restore() is failing

I think I found a solution that works and reason for the failure. The lockfile was created with R 4.3.1 but the local R version is 4.3.2.

I ended up doing a renv::init() and "Discard the lockfile and re-initialize" and it got my project working again