From 7de7e78c113ba2d733bf521fd36e39865f32d80f Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 19 Aug 2024 16:03:34 -0700 Subject: [PATCH 1/7] Add a new devcontainer for ancient R --- .devcontainer/r-ancient-gcc/Dockerfile | 18 ++++++++++++++++++ .devcontainer/r-ancient-gcc/devcontainer.json | 10 ++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .devcontainer/r-ancient-gcc/Dockerfile create mode 100644 .devcontainer/r-ancient-gcc/devcontainer.json diff --git a/.devcontainer/r-ancient-gcc/Dockerfile b/.devcontainer/r-ancient-gcc/Dockerfile new file mode 100644 index 000000000..74e38ec53 --- /dev/null +++ b/.devcontainer/r-ancient-gcc/Dockerfile @@ -0,0 +1,18 @@ +FROM registry.gitlab.com/jangorecki/dockerfiles/r-3.3.0 + +RUN apt-get -qq update \ + && apt-get install -y --no-install-recommends git + +COPY DESCRIPTION . + +RUN Rscript -e ' \ +read.dcf("DESCRIPTION", c("Imports", "Suggests")) |> \ + tools:::.split_dependencies() |> \ + names() |> \ + setdiff(tools:::.get_standard_package_names()$base) |> \ + install.packages() \ +' + +# setup cc() +WORKDIR /root +COPY .devcontainer/.Rprofile . diff --git a/.devcontainer/r-ancient-gcc/devcontainer.json b/.devcontainer/r-ancient-gcc/devcontainer.json new file mode 100644 index 000000000..da60569c9 --- /dev/null +++ b/.devcontainer/r-ancient-gcc/devcontainer.json @@ -0,0 +1,10 @@ +{ + "build": { "dockerfile": "Dockerfile", "context": "../.." }, + "customizations": { "vscode": { + "extensions": [ + "REditorSupport.r", + "ms-vscode.cpptools-extension-pack" + ] + }} + } + \ No newline at end of file From c5f7769f445d5128211274242a2361feb8532f6d Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 19 Aug 2024 16:04:48 -0700 Subject: [PATCH 2/7] ws --- .devcontainer/r-ancient-gcc/devcontainer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/r-ancient-gcc/devcontainer.json b/.devcontainer/r-ancient-gcc/devcontainer.json index da60569c9..74c039fb7 100644 --- a/.devcontainer/r-ancient-gcc/devcontainer.json +++ b/.devcontainer/r-ancient-gcc/devcontainer.json @@ -7,4 +7,3 @@ ] }} } - \ No newline at end of file From 5fbdb04021e10eeae914dedf11167858eba6412d Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 19 Aug 2024 16:05:24 -0700 Subject: [PATCH 3/7] ws --- .devcontainer/r-ancient-gcc/devcontainer.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.devcontainer/r-ancient-gcc/devcontainer.json b/.devcontainer/r-ancient-gcc/devcontainer.json index 74c039fb7..de21d3dfe 100644 --- a/.devcontainer/r-ancient-gcc/devcontainer.json +++ b/.devcontainer/r-ancient-gcc/devcontainer.json @@ -1,9 +1,9 @@ { - "build": { "dockerfile": "Dockerfile", "context": "../.." }, - "customizations": { "vscode": { - "extensions": [ - "REditorSupport.r", - "ms-vscode.cpptools-extension-pack" - ] - }} - } + "build": { "dockerfile": "Dockerfile", "context": "../.." }, + "customizations": { "vscode": { + "extensions": [ + "REditorSupport.r", + "ms-vscode.cpptools-extension-pack" + ] + }} +} From 076a5e3104ad8d9e5e4a7d5b6a0d45ea170d922c Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 19 Aug 2024 16:47:52 -0700 Subject: [PATCH 4/7] Can't use |> --- .devcontainer/r-ancient-gcc/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.devcontainer/r-ancient-gcc/Dockerfile b/.devcontainer/r-ancient-gcc/Dockerfile index 74e38ec53..e361b3c2a 100644 --- a/.devcontainer/r-ancient-gcc/Dockerfile +++ b/.devcontainer/r-ancient-gcc/Dockerfile @@ -5,12 +5,11 @@ RUN apt-get -qq update \ COPY DESCRIPTION . -RUN Rscript -e ' \ -read.dcf("DESCRIPTION", c("Imports", "Suggests")) |> \ - tools:::.split_dependencies() |> \ - names() |> \ - setdiff(tools:::.get_standard_package_names()$base) |> \ - install.packages() \ +RUN Rscript -e ' \ +dcf = read.dcf("DESCRIPTION", c("Imports", "Suggests")) \ +deps = names(tools:::.split_dependencies(dcf)) \ +standard_pkgs = tools:::.get_standard_package_names() \ +install.packages(setdiff(deps, standard_pkgs$base)) \ ' # setup cc() From fe17c66cdf1499e66fa51921a886bd0a0cadc73c Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 19 Aug 2024 16:54:30 -0700 Subject: [PATCH 5/7] Use ';' (not real newlines in docker string) --- .devcontainer/r-ancient-gcc/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.devcontainer/r-ancient-gcc/Dockerfile b/.devcontainer/r-ancient-gcc/Dockerfile index e361b3c2a..3be4bc85f 100644 --- a/.devcontainer/r-ancient-gcc/Dockerfile +++ b/.devcontainer/r-ancient-gcc/Dockerfile @@ -5,11 +5,11 @@ RUN apt-get -qq update \ COPY DESCRIPTION . -RUN Rscript -e ' \ -dcf = read.dcf("DESCRIPTION", c("Imports", "Suggests")) \ -deps = names(tools:::.split_dependencies(dcf)) \ -standard_pkgs = tools:::.get_standard_package_names() \ -install.packages(setdiff(deps, standard_pkgs$base)) \ +RUN Rscript -e ' \ +dcf = read.dcf("DESCRIPTION", c("Imports", "Suggests")); \ +deps = names(tools:::.split_dependencies(dcf)); \ +standard_pkgs = tools:::.get_standard_package_names(); \ +install.packages(setdiff(deps, standard_pkgs$base)); \ ' # setup cc() From 6ba971e7bfcb62f965b958228f3c4a7d268aaab0 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 19 Aug 2024 20:55:13 -0700 Subject: [PATCH 6/7] Add repos=; skip unavailable packages --- .devcontainer/r-ancient-gcc/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/r-ancient-gcc/Dockerfile b/.devcontainer/r-ancient-gcc/Dockerfile index 3be4bc85f..b8b57fe5d 100644 --- a/.devcontainer/r-ancient-gcc/Dockerfile +++ b/.devcontainer/r-ancient-gcc/Dockerfile @@ -6,9 +6,11 @@ RUN apt-get -qq update \ COPY DESCRIPTION . RUN Rscript -e ' \ +options(repos = "https://cloud.r-project.org"); \ dcf = read.dcf("DESCRIPTION", c("Imports", "Suggests")); \ deps = names(tools:::.split_dependencies(dcf)); \ standard_pkgs = tools:::.get_standard_package_names(); \ +deps = intersect(deps, rownames(available.packages()); \ install.packages(setdiff(deps, standard_pkgs$base)); \ ' From d7f2715041060290eaaad5000db4e46f719158b5 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 20 Aug 2024 04:09:06 +0000 Subject: [PATCH 7/7] Missing ')' --- .devcontainer/r-ancient-gcc/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/r-ancient-gcc/Dockerfile b/.devcontainer/r-ancient-gcc/Dockerfile index b8b57fe5d..179184c69 100644 --- a/.devcontainer/r-ancient-gcc/Dockerfile +++ b/.devcontainer/r-ancient-gcc/Dockerfile @@ -10,7 +10,7 @@ options(repos = "https://cloud.r-project.org"); \ dcf = read.dcf("DESCRIPTION", c("Imports", "Suggests")); \ deps = names(tools:::.split_dependencies(dcf)); \ standard_pkgs = tools:::.get_standard_package_names(); \ -deps = intersect(deps, rownames(available.packages()); \ +deps = intersect(deps, rownames(available.packages())); \ install.packages(setdiff(deps, standard_pkgs$base)); \ '