Skip to content
New issue

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

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

Already on GitHub? # to your account

Support R older than 1.3.1 #14

Open
chainsawriot opened this issue Feb 2, 2023 · 14 comments
Open

Support R older than 1.3.1 #14

chainsawriot opened this issue Feb 2, 2023 · 14 comments
Assignees

Comments

@chainsawriot
Copy link
Collaborator

There were changes but R older than 2.5 were really different, e.g. no seq_along; versions older than 1.9 can't even use snake case.

A even safer approach is to use bash to wget and R CMD INSTALL instead. I can only install source package in R 1.3.1 this way.

@chainsawriot
Copy link
Collaborator Author

For the time being:

utils::compareVersion(granlist$r_version, "3.1") == -1

Stop dockerize (No Rocker Image)

utils::compareVersion(granlist$r_version, "2.5") == -1

Stop export_granlist (saying not tested)

@chainsawriot
Copy link
Collaborator Author

All the functions in header.R and footer.R:

snake case: R 1.9.0
paste0: R 2.15.0 (Should be replaced by paste0(..., sep = ""))
tempdir: R 1.6.0
supressWarnings: R 1.8.0
tryCatch: R 1.8.0
seq_along: R 2.4.0 (Should be replaced by a check and then 1:length(install_order))

All other functions should be safe. Maybe minimum version of R 1.8.0 should be declared as the tryCatch block is needed.

Also, state somehwhere that the generated installation script might not look idiomatic now.

@chainsawriot
Copy link
Collaborator Author

However, if #17 is implemented, it is safe to go older than R 1.8.0.

@chainsawriot
Copy link
Collaborator Author

chainsawriot commented Feb 5, 2023

install.packages can only be used to install source packages since R 2.1.0.

verbose and quiet were introduced since R 3.0.0.

@chainsawriot
Copy link
Collaborator Author

chainsawriot commented Feb 5, 2023

It is safer to say the current export_granlist can support up to R 2.1.0; can keep the snake case too, but need to fix paste0 and seq_along. Ignore verbose and quiet. And test.

For older versions, shell script approach should be used.

This can be cited: https://www.r-project.org/doc/Rnews/Rnews_2005-1.pdf

Ripley, B. (2005) Packages and their Management in R 2.1.0. R News

@chainsawriot
Copy link
Collaborator Author

chainsawriot commented Feb 5, 2023

Debian Etch / Lenny can be used to compile R 2.1 to R 3.0.

@chainsawriot
Copy link
Collaborator Author

Proposed Dockerfile for R < 3.1.0.

R-2 and R-2.13.0 need to be changeable.

FROM debian/eol:lenny
ENV TZ UTC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt-get update -qq && apt-get install wget locales build-essential r-base-dev  -y

RUN wget http://cran.r-project.org/src/base/R-2/R-2.13.0.tar.gz \
    && tar -zxf R-2.13.0.tar.gz \
    && cd R-2.13.0 \
    && ./configure --without-x ; make \
    && make install

COPY gran.R ./gran.R
RUN Rscript gran.R
CMD ["R"]

chainsawriot added a commit that referenced this issue Feb 6, 2023
@chainsawriot
Copy link
Collaborator Author

ah dar...

#17 dir.exists is only available since 3.2.0.

@chainsawriot chainsawriot changed the title Use alternative method to generate installation script for R older than 2.5 Use alternative method to generate installation script for R older than 2.1 Feb 6, 2023
chainsawriot added a commit that referenced this issue Feb 13, 2023
@chainsawriot
Copy link
Collaborator Author

chainsawriot commented Feb 16, 2023

TODOs

  • eschew all snake cases in inst/header.R and inst/footer.R
  • Check for R version and use R CMD if R version is older than 2.1
  • Test, test, test
  • Check the oldest version of R that can be compiled/installed with Lenny.

@chainsawriot
Copy link
Collaborator Author

chainsawriot commented Mar 5, 2023

lenny = 1.8.0

Update: actually 1.6.0 / 1.5.0 / 1.4.0 / 1.3.1 work; only 1.7.x series doesn't work.

There should be an option like "skip_r1.7 = TRUE"

Will use 1.3.1 as the reference version to write header and footer

@chainsawriot
Copy link
Collaborator Author

chainsawriot commented Mar 5, 2023

etch doesn't have libcurl4-openssl-dev, should drop.

@chainsawriot
Copy link
Collaborator Author

R 1.3.1 doesn't even have compareVersion. Maybe a better approach for <= R 2.1 is to use pure bash (which doesn't sound too bad).

chainsawriot added a commit that referenced this issue Mar 6, 2023
@chainsawriot chainsawriot removed the v0.2 label Mar 6, 2023
@chainsawriot chainsawriot changed the title Use alternative method to generate installation script for R older than 2.1 Use alternative method to generate installation script for R older than 1.3.1 Mar 6, 2023
@chainsawriot chainsawriot changed the title Use alternative method to generate installation script for R older than 1.3.1 Support R older than 1.3.1 Mar 7, 2023
@chainsawriot
Copy link
Collaborator Author

chainsawriot commented Mar 7, 2023

The issue is for supporting 1.3.0 or below is the compilation fails on Lenny.

@chainsawriot
Copy link
Collaborator Author

#165

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant