[Rd] R pkg install should fail for unsuccessful DLL copy on windows?

Pages, Herve hp@ge@ @end|ng |rom |redhutch@org
Fri May 31 01:50:29 CEST 2019


Also note that this can lead to people not being able to load the
package if the set of .Call entry points has changed between the old
and new versions of the package. We strongly suspect that this is what
happened to this Bioconductor user:

   https://support.bioconductor.org/p/121228/

Note that she's installing the binary and in this case no warning
is issued. All we see is:

   package ‘S4Vectors’ successfully unpacked and MD5 sums checked

but the old DLL apparently didn't get replaced with the new one.
Hence the

   error: "make_RAW_from_NA_LLINT" not available for .Call() for package 
"S4Vectors"

later on when trying to load the package.

Cheers,
H.


On 5/30/19 16:31, Toby Hocking wrote:
> thanks for the tip Jan.
> 
> However it would be nice if I didn't have to handle this myself for all of
> my packages. (and teach my students how to do that)
> 
> BTW I tried to disable staged installation, and the issue still happens:
> 
> th798 using cmp2986 MINGW64 ~/projects/max-generalized-auc (master)
> $ R_INSTALL_STAGED=FALSE R --vanilla -e
> ".libPaths('~/R/library');.libPaths();options(repos='
> https://urldefense.proofpoint.com/v2/url?u=https-3A__cloud.r-2Dproject.org&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=7X00xNRObhT9O68YU8m-IBkt38N5p_GP-UV77XEnKZw&e= ',
> warn=2);library(penaltyLearning);install.packages('penaltyLearning',
> type='source');getOption('warn');sessionInfo()"
> 
> R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
> Copyright (C) 2019 The R Foundation for Statistical Computing
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> 
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> 
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> 
>> .libPaths('~/R/library');.libPaths();options(repos='
> https://urldefense.proofpoint.com/v2/url?u=https-3A__cloud.r-2Dproject.org&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=7X00xNRObhT9O68YU8m-IBkt38N5p_GP-UV77XEnKZw&e= ',
> warn=2);library(penaltyLearning);install.packages('penaltyLearning',
> type='source');getOption('warn');sessionInfo()
> [1] "C:/Users/th798/R/library"           "C:/Program
> Files/R/R-3.6.0/library"
> Loading required package: data.table
> Registered S3 methods overwritten by 'ggplot2':
>    method         from
>    [.quosures     rlang
>    c.quosures     rlang
>    print.quosures rlang
> Installing package into 'C:/Users/th798/R/library'
> (as 'lib' is unspecified)
> trying URL '
> https://urldefense.proofpoint.com/v2/url?u=https-3A__cloud.r-2Dproject.org_src_contrib_penaltyLearning-5F2018.09.04.tar.gz&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=o34c6BnD4LvJv-00tYn5M2TqO_IjH5qtaKnnhI4ph50&e= '
> Content type 'application/x-gzip' length 2837289 bytes (2.7 MB)
> ==================================================
> downloaded 2.7 MB
> 
> * installing *source* package 'penaltyLearning' ...
> ** package 'penaltyLearning' successfully unpacked and MD5 sums checked
> ** using non-staged installation
> ** libs
> c:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include"
> -DNDEBUG          -O2 -Wall  -mtune=generic -c interface.cpp -o interface.o
> c:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include"
> -DNDEBUG          -O2 -Wall  -mtune=generic -c largestContinuousMinimum.cpp
> -o largestContinuousMinimum.o
> largestContinuousMinimum.cpp: In function 'int
> largestContinuousMinimum(int, double*, double*, int*)':
> largestContinuousMinimum.cpp:38:27: warning: 'start' may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>         index_vec[0] = start;
>                             ^
> c:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include"
> -DNDEBUG          -O2 -Wall  -mtune=generic -c modelSelection.cpp -o
> modelSelection.o
> /usr/bin/sed: -e expression #1, char 1: unknown command: `C'
> c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o penaltyLearning.dll
> tmp.def interface.o largestContinuousMinimum.o modelSelection.o
> -LC:/PROGRA~1/R/R-36~1.0/bin/x64 -lR
> installing to C:/Users/th798/R/library/penaltyLearning/libs/x64
> Warning in file.copy(files, dest, overwrite = TRUE) :
>    problem copying .\penaltyLearning.dll to
> C:\Users\th798\R\library\penaltyLearning\libs\x64\penaltyLearning.dll:
> Permission denied
> ** R
> ** data
> ** byte-compile and prepare package for lazy loading
> ** help
> *** installing help indices
>    converting help for package 'penaltyLearning'
>      finding HTML links ... done
>      GeomTallRect                            html
>      IntervalRegressionCV                    html
>      IntervalRegressionCVmargin              html
>      IntervalRegressionInternal              html
>      IntervalRegressionRegularized           html
>      IntervalRegressionUnregularized         html
>      ROChange                                html
>      change.colors                           html
>      change.labels                           html
>      changeLabel                             html
>      check_features_targets                  html
>      check_target_pred                       html
>      coef.IntervalRegression                 html
>      demo8                                   html
>      featureMatrix                           html
>      featureVector                           html
>      geom_tallrect                           html
>      labelError                              html
>      largestContinuousMinimumC               html
>      largestContinuousMinimumR               html
>      modelSelection                          html
>      modelSelectionC                         html
>      modelSelectionR                         html
>      neuroblastomaProcessed                  html
>      oneSkip                                 html
>      plot.IntervalRegression                 html
>      predict.IntervalRegression              html
>      print.IntervalRegression                html
>      squared.hinge                           html
>      targetIntervalROC                       html
>      targetIntervalResidual                  html
>      targetIntervals                         html
>      theme_no_space                          html
> ** building package indices
> ** testing if installed package can be loaded
> * DONE (penaltyLearning)
> 
> The downloaded source packages are in
> 'C:\Users\th798\AppData\Local\Temp\RtmpkVV0sH\downloaded_packages'
> [1] 2
> R version 3.6.0 (2019-04-26)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 17134)
> 
> Matrix products: default
> 
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> other attached packages:
> [1] penaltyLearning_2018.09.04 data.table_1.12.2
> 
> loaded via a namespace (and not attached):
>   [1] Rcpp_1.0.1       assertthat_0.2.1 dplyr_0.8.1      crayon_1.3.4
>   [5] R6_2.4.0         grid_3.6.0       plyr_1.8.4       magic_1.5-9
>   [9] gtable_0.3.0     magrittr_1.5     scales_1.0.0     ggplot2_3.1.1
> [13] pillar_1.4.0     rlang_0.3.4      lazyeval_0.2.2   geometry_0.4.1
> [17] tools_3.6.0      glue_1.3.1       purrr_0.3.2      munsell_0.5.0
> [21] abind_1.4-7      compiler_3.6.0   pkgconfig_2.0.2  colorspace_1.4-1
> [25] tidyselect_0.2.5 tibble_2.1.1
>>
>>
> ]0;MINGW64:/c/Users/th798/projects/max-generalized-auc
> th798 using cmp2986 MINGW64 ~/projects/max-generalized-auc (master)
> $
> 
> 
> 
> On Wed, May 29, 2019 at 8:15 PM Jan Gorecki <j.gorecki using wit.edu.pl> wrote:
> 
>> Hi Toby,
>> AFAIK it has not been addressed in R. You can handle the problem on
>> your package side, see
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Rdatatable_data.table_pull_3237&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=rI7qS9klz5h9_Cxq2381FT730_fIJS2eYuO7zfoFuOQ&e=
>> Regards,
>> Jan
>>
>>
>> On Thu, May 30, 2019 at 4:46 AM Toby Hocking <tdhock5 using gmail.com> wrote:
>>>
>>> Hi all,
>>>
>>> I am having an issue related to installing packages on windows with
>>> R-3.6.0. When installing a package that is in use, I expected R to stop
>>> with an error. However I am getting a warning that the DLL copy was not
>>> successful, but the overall package installation IS successful. This is
>>> quite dangerous because the old DLL and the new R code could be
>>> incompatible.
>>>
>>> I am definitely not the first person to have this issue.
>>> * Matt Dowle reported
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.r-2Dproject.org_bugzilla_show-5Fbug.cgi-3Fid-3D17478&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=IJuOtHB4O_KwvegXltTlKm91bD5nu9Ltdcyi2xBqurA&e=  which was
>> never
>>> addressed.
>>> * Jim Hester reported
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.r-2Dproject.org_bugzilla_show-5Fbug.cgi-3Fid-3D17453&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=j0nlC7mk5y3nA30dLMfkiYhsgFRsexMMfWoLgOVIO6w&e=  which was
>>> apparently addressed in R-3.5.1, via
>>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_wch_r-2Dsource_commit_828a04f9c428403e476620b1905a1d8ca41d0bcd&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=92B6JnxdBpF06tY0vcrp4SJ2avJA6t68xlDGF7cWFfk&e=
>>>
>>> But I am now having the same issue in R-3.6.0 -- is this a regression in
>> R?
>>> or is there another fix that I can use?
>>>
>>> Below is the minimal R code that I used to reproduce the issue.
>> Essentially,
>>> * I start R with --vanilla and set options repos=cloud and warn=2 (which
>> I
>>> expect should convert warnings to errors).
>>> * I do library(penaltyLearning) and then install the package from source,
>>> which results in the
>>>    warnings. I expected there should be an error.
>>>
>>> th798 using cmp2986 MINGW64 ~/R
>>> $ R --vanilla -e "options(repos='https://urldefense.proofpoint.com/v2/url?u=https-3A__cloud.r-2Dproject.org&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=7X00xNRObhT9O68YU8m-IBkt38N5p_GP-UV77XEnKZw&e= ',
>>> warn=2);library(penaltyLearning);install.packages('penaltyLearning',
>>> type='source');getOption('warn');sessionInfo()"
>>>
>>> R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
>>> Copyright (C) 2019 The R Foundation for Statistical Computing
>>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>>
>>> R is free software and comes with ABSOLUTELY NO WARRANTY.
>>> You are welcome to redistribute it under certain conditions.
>>> Type 'license()' or 'licence()' for distribution details.
>>>
>>> R is a collaborative project with many contributors.
>>> Type 'contributors()' for more information and
>>> 'citation()' on how to cite R or R packages in publications.
>>>
>>> Type 'demo()' for some demos, 'help()' for on-line help, or
>>> 'help.start()' for an HTML browser interface to help.
>>> Type 'q()' to quit R.
>>>
>>>> options(repos='https://urldefense.proofpoint.com/v2/url?u=https-3A__cloud.r-2Dproject.org&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=7X00xNRObhT9O68YU8m-IBkt38N5p_GP-UV77XEnKZw&e= ',
>>> warn=2);library(penaltyLearning);install.packages('penaltyLearning',
>>> type='source');getOption('warn');sessionInfo()
>>> Loading required package: data.table
>>> Registered S3 methods overwritten by 'ggplot2':
>>>    method         from
>>>    [.quosures     rlang
>>>    c.quosures     rlang
>>>    print.quosures rlang
>>> trying URL '
>>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__cloud.r-2Dproject.org_src_contrib_penaltyLearning-5F2018.09.04.tar.gz&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=o34c6BnD4LvJv-00tYn5M2TqO_IjH5qtaKnnhI4ph50&e= '
>>> Content type 'application/x-gzip' length 2837289 bytes (2.7 MB)
>>> ==================================================
>>> downloaded 2.7 MB
>>>
>>> * installing *source* package 'penaltyLearning' ...
>>> ** package 'penaltyLearning' successfully unpacked and MD5 sums checked
>>> ** using staged installation
>>> ** libs
>>> c:/Rtools/mingw_64/bin/g++  -std=gnu++11
>> -I"C:/PROGRA~1/R/R-36~1.0/include"
>>> -DNDEBUG          -O2 -Wall  -mtune=generic -c interface.cpp -o
>> interface.o
>>> c:/Rtools/mingw_64/bin/g++  -std=gnu++11
>> -I"C:/PROGRA~1/R/R-36~1.0/include"
>>> -DNDEBUG          -O2 -Wall  -mtune=generic -c
>> largestContinuousMinimum.cpp
>>> -o largestContinuousMinimum.o
>>> largestContinuousMinimum.cpp: In function 'int
>>> largestContinuousMinimum(int, double*, double*, int*)':
>>> largestContinuousMinimum.cpp:38:27: warning: 'start' may be used
>>> uninitialized in this function [-Wmaybe-uninitialized]
>>>         index_vec[0] = start;
>>>                             ^
>>> c:/Rtools/mingw_64/bin/g++  -std=gnu++11
>> -I"C:/PROGRA~1/R/R-36~1.0/include"
>>> -DNDEBUG          -O2 -Wall  -mtune=generic -c modelSelection.cpp -o
>>> modelSelection.o
>>> /usr/bin/sed: -e expression #1, char 1: unknown command: `C'
>>> c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o
>> penaltyLearning.dll
>>> tmp.def interface.o largestContinuousMinimum.o modelSelection.o
>>> -LC:/PROGRA~1/R/R-36~1.0/bin/x64 -lR
>>> installing to C:/Program
>>>
>> Files/R/R-3.6.0/library/00LOCK-penaltyLearning/00new/penaltyLearning/libs/x64
>>> ** R
>>> ** data
>>> ** byte-compile and prepare package for lazy loading
>>> ** help
>>> *** installing help indices
>>>    converting help for package 'penaltyLearning'
>>>      finding HTML links ... done
>>>      GeomTallRect                            html
>>>      IntervalRegressionCV                    html
>>>      IntervalRegressionCVmargin              html
>>>      IntervalRegressionInternal              html
>>>      IntervalRegressionRegularized           html
>>>      IntervalRegressionUnregularized         html
>>>      ROChange                                html
>>>      change.colors                           html
>>>      change.labels                           html
>>>      changeLabel                             html
>>>      check_features_targets                  html
>>>      check_target_pred                       html
>>>      coef.IntervalRegression                 html
>>>      demo8                                   html
>>>      featureMatrix                           html
>>>      featureVector                           html
>>>      geom_tallrect                           html
>>>      labelError                              html
>>>      largestContinuousMinimumC               html
>>>      largestContinuousMinimumR               html
>>>      modelSelection                          html
>>>      modelSelectionC                         html
>>>      modelSelectionR                         html
>>>      neuroblastomaProcessed                  html
>>>      oneSkip                                 html
>>>      plot.IntervalRegression                 html
>>>      predict.IntervalRegression              html
>>>      print.IntervalRegression                html
>>>      squared.hinge                           html
>>>      targetIntervalROC                       html
>>>      targetIntervalResidual                  html
>>>      targetIntervals                         html
>>>      theme_no_space                          html
>>> ** building package indices
>>> ** testing if installed package can be loaded from temporary location
>>> WARNING: moving package to final location failed, copying instead
>>> Warning in file.copy(instdir, dirname(final_instdir), recursive = TRUE,
>> :
>>>    problem copying C:\Program
>>>
>> Files\R\R-3.6.0\library\00LOCK-penaltyLearning\00new\penaltyLearning\libs\x64\penaltyLearning.dll
>>> to C:\Program
>>> Files\R\R-3.6.0\library\penaltyLearning\libs\x64\penaltyLearning.dll:
>>> Permission denied
>>> ** testing if installed package can be loaded from final location
>>> ** testing if installed package keeps a record of temporary installation
>>> path
>>> * DONE (penaltyLearning)
>>>
>>> The downloaded source packages are in
>>> 'C:\Users\th798\AppData\Local\Temp\RtmpUrOoFE\downloaded_packages'
>>> [1] 2
>>> R version 3.6.0 (2019-04-26)
>>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>> Running under: Windows 10 x64 (build 17134)
>>>
>>> Matrix products: default
>>>
>>> locale:
>>> [1] LC_COLLATE=English_United States.1252
>>> [2] LC_CTYPE=English_United States.1252
>>> [3] LC_MONETARY=English_United States.1252
>>> [4] LC_NUMERIC=C
>>> [5] LC_TIME=English_United States.1252
>>>
>>> attached base packages:
>>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>>
>>> other attached packages:
>>> [1] penaltyLearning_2018.09.04 data.table_1.12.2
>>>
>>> loaded via a namespace (and not attached):
>>>   [1] Rcpp_1.0.1       assertthat_0.2.1 dplyr_0.8.1      crayon_1.3.4
>>>   [5] R6_2.4.0         grid_3.6.0       plyr_1.8.4       magic_1.5-9
>>>   [9] gtable_0.3.0     magrittr_1.5     scales_1.0.0     ggplot2_3.1.1
>>> [13] pillar_1.4.0     rlang_0.3.4      lazyeval_0.2.2   geometry_0.4.1
>>> [17] tools_3.6.0      glue_1.3.1       purrr_0.3.2      munsell_0.5.0
>>> [21] abind_1.4-7      compiler_3.6.0   pkgconfig_2.0.2  colorspace_1.4-1
>>> [25] tidyselect_0.2.5 tibble_2.1.1
>>>>
>>>>
>>> ]0;MINGW64:/c/Users/th798/R
>>> th798 using cmp2986 MINGW64 ~/R
>>> $
>>>
>>> related blog post: https://urldefense.proofpoint.com/v2/url?u=https-3A__tdhock.github.io_blog_2019_windows-2Ddll_&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=966ZHBqmdlD56fg01o9FZKpQYT07ZL3dzmZt3cEWgaQ&e=
>>>
>>>          [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-devel using r-project.org mailing list
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Ddevel&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=8Tg6DVEkxJdPCYGLbPDOm7UQuVwBJS_ezJksvJkECNM&e=
>>
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel using r-project.org mailing list
> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Ddevel&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=zldJhdavBFtHDHr08_HFRAi9MY2WBkTiDn1ggbog4cA&s=8Tg6DVEkxJdPCYGLbPDOm7UQuVwBJS_ezJksvJkECNM&e=
> 

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages using fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319


More information about the R-devel mailing list