Skip to content

Commit

Permalink
Adjust package installation script to fix travis builds
Browse files Browse the repository at this point in the history
Travis builds currently fail (for a few weeks) due to two different reasons:

On the one hand, the log output exceeds the maximum log length of travis,
resulting in failing builds. This is prevented by setting the parameters
`verbose` and `quiet` to `TRUE`, as then the package compilation log is
not printed to the log but the result of package installation is clearly
perceptible in the log.

On the other hand, travis installs lots of packages which are not necessary
as they are just suggestions of other packages but not necessary dependencies.
Installing such unnecessary packages my lead to problems. This is
circumvented by setting the `dependencies` parameter to `NA` as this results
in installing only necessary dependencies and imports, whereas the former
`TRUE` value of this parameter also led to installing suggested but
unnecessary packages.

Those two fixes hopefully makes travis builds successful again.

Props to @clhunsen for experimenting with the parameters and proposing
the first part of this commit regarding the `verbose` and `quiet`
parameters of the `install.packages` function.

This commit addresses parts of se-sic#161.

Signed-off-by: Thomas Bock <[email protected]>
  • Loading branch information
bockthom committed Nov 8, 2020
1 parent 5e3baa8 commit 1ba0367
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion install.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
## Copyright 2015 by Wolfgang Mauerer <[email protected]>
## Copyright 2015-2017 by Claus Hunsen <[email protected]>
## Copyright 2017 by Thomas Bock <[email protected]>
## Copyright 2020 by Thomas Bock <[email protected]>
## Copyright 2019 by Anselm Fehnker <[email protected]>
## All Rights Reserved.
##
Expand Down Expand Up @@ -55,5 +56,7 @@ filter.installed.packages = function(packageList) {
p = filter.installed.packages(packages)
if (length(p) > 0) {
print(sprintf("Installing package '%s'.", p))
install.packages(p, dependencies = TRUE, verbose = FALSE, quiet = FALSE)

## set dependencies to 'NA' to install only necessary dependencies (i.e., "Depends", "Imports", "LinkingTo")
install.packages(p, dependencies = NA, verbose = TRUE, quiet = TRUE)
}

0 comments on commit 1ba0367

Please sign in to comment.