r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
642 stars 56 forks source link

`devtools::install_github()` works but `pak::pkg_install()` fails #587

Open MLopez-Ibanez opened 5 months ago

MLopez-Ibanez commented 5 months ago
devtools::install_github("auto-optimization/mootools/r")

works!

pak::pkg_install("auto-optimization/mootools/r")

FAILS with:


→ Will install 1 package.
→ The package (0 B) is cached.
+ moocore   0.0.9000 [bld][cmp] (GitHub: 9b8a0e0) + ✔ make, ✔ libgsl0-dev
ℹ No downloads are needed, 1 pkg is cached
ℹ Packaging moocore 0.0.9000
✖ Failed to create source package moocore 0.0.9000            

── Standard output ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Warning: unknown option ‘--no-lock’                           
* checking for file ‘/tmp/RtmpYmD8Z0/X/moocore/auto-optimization-mootools-9b8a0e0/r/DESCRIPTION’ ... OK
* preparing ‘moocore’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* running ‘cleanup’
* installing the package to process help pages
      -----------------------------------
* installing *source* package ‘moocore’ ...
** using staged installation
checking for gsl-config... /usr/bin/gsl-config
configure: creating ./config.status
config.status: creating src/Makevars
** libs
make: *** No rule to make target 'moocore/hv_contrib.o', needed by 'moocore.so'. Stop.
ERROR: compilation failed for package ‘moocore’
* removing ‘/tmp/Rtmpf6GTUR/Rinstbd574a7fa384/moocore’
      -----------------------------------
ERROR: package installation failed
Error:                                                        
! error in pak subprocess
Caused by error in `stop_task_package_build(state, worker)`:
! Failed to create source package 'moocore' from source tree '/tmp/RtmpYmD8Z0/filebb3548ceb328/src/contrib/moocore_0.0.9000_9b8a0e0.tar.gz-t'
Type .Last.error to see the more details.
``
gaborcsardi commented 5 months ago

FWIW if I call

/private/tmp/mootools main* 7s
❯ R CMD build r

from your repo, that also fails, although with a different error:

** help
Loading required namespace: moocore
Failed with error:  ‘unable to load shared object '/private/var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpHUlpWM/Rinst17f7d2f3b9e4d/00LOCK-moocore/00new/moocore/libs/moocore.so':
  dlopen(/private/var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpHUlpWM/Rinst17f7d2f3b9e4d/00LOCK-moocore/00new/moocore/libs/moocore.so, 0x0006): symbol not found in flat namespace '_errprintf'’
MLopez-Ibanez commented 5 months ago

Failed with error: ‘unable to load shared object '/private/var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpHUlpWM/Rinst17f7d2f3b9e4d/00LOCK-moocore/00new/moocore/libs/moocore.so': dlopen(/private/var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpHUlpWM/Rinst17f7d2f3b9e4d/00LOCK-moocore/00new/moocore/libs/moocore.so, 0x0006): symbol not found in flat namespace '_errprintf'’

Strange. I cannot reproduce that and neither can the github actions. Is that Linux or Mac? It looks like a Mac problem. If you are happy to open an issue in my repository and give me a full log I can investigate.

Does devtools::install_github("auto-optimization/mootools/r") give you the same error? It doesn't look at all like the error that pak gives me.

MLopez-Ibanez commented 5 months ago

You can see here that installing with remotes::install_github works (even in MacOS):

https://pipelinesghubeus9.actions.githubusercontent.com/e7bhuHhu7cpdl7qlELCgRJq87JULgkbHt9BM4iSjXRKtssP3sF/_apis/pipelines/1/runs/4/signedlogcontent/5?urlExpires=2024-01-27T15%3A51%3A38.9730817Z&urlSigningMethod=HMACV1&urlSignature=WZnRKB9ybKNQkhcdZ5joYww5rkD%2Fx%2FFnCgWCPWkGuzY%3D

so it seems this may be a bug in pak, perhaps in handling packages that are in subdirectories of a github repo?