Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exaslct does not throw an error when it fails to install an R package #772

Closed
tomuben opened this issue Feb 3, 2023 · 3 comments
Closed
Assignees
Labels
bug Unwanted / harmful behavior

Comments

@tomuben
Copy link
Collaborator

tomuben commented Feb 3, 2023

Steps to reproduce

  1. Use a flavor with R3.4.4 (standard 7.x flavor)
  2. Add Hmisc R pkg to flavor_customization/packages/r_cran_packages
  3. Run build command: exaslct build --flavor-path ./flavors/standard-EXASOL-7.1.0 -> builds the image without errors
  4. Login to the built docker image and execute R, then library(Hmisc) -> Observe
@tomuben tomuben added the bug Unwanted / harmful behavior label Feb 3, 2023
@tkilias tkilias transferred this issue from exasol/script-languages-container-tool Mar 14, 2023
@tkilias
Copy link
Collaborator

tkilias commented Mar 14, 2023

The reason for this bug is that the package installation of R doesn't fail when packages can't be installed. It only shows it in the logs, which can't be easily searched. There are potentially a few options to solve this issue.

Some discussion regarding this issue: https://stackoverflow.com/questions/26244530/how-do-i-make-install-packages-return-an-error-if-an-r-package-cannot-be-install

  1. We could try to catch warnings thrown by R.
  2. We could check if all packages were installed with available.packages() after the install.package() function returned
  3. We check if we can load the package with library(package)
  4. We could write integration tests for the packages.

The first solution doesn't guarantee to find all issues during installation, but would fail fast. The second one only guarantees that the package was installed, but not that it is loadable. The third one guarantees that a package is loadable, but not that it works.

I suggest implementing 1. and 2. as part of the installation script and 3. and 4. for important packages.

@tkilias
Copy link
Collaborator

tkilias commented Mar 14, 2023

Maybe option 3 can also be automated, but we probably should use the list of installed.packages() instead our list, in case packages get installed from a Github repository

@tkilias
Copy link
Collaborator

tkilias commented Mar 14, 2023

Acceptance Criteria

  • Check warnings after R package install
  • Check if the list of installed packages contains the requested packages
  • Check if we can load all installed packages

@tkilias tkilias self-assigned this Mar 16, 2023
@ckunki ckunki changed the title exaslct does not throw an error when it fails to install a R pkg exaslct does not throw an error when it fails to install an R package Apr 17, 2023
@tomuben tomuben self-assigned this Nov 20, 2024
tomuben added a commit to exasol/script-languages that referenced this issue Nov 22, 2024
@tomuben tomuben closed this as completed Nov 22, 2024
tomuben added a commit that referenced this issue Nov 26, 2024
Changelog:
- #772: Added check of installation of R packages (#1021) 
- Updated dependencies and release log (#1027)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

No branches or pull requests

2 participants