Skip to content

Commit

Permalink
Add Dev Containers with Clang using -stdlib=libc++
Browse files Browse the repository at this point in the history
  • Loading branch information
benz0li committed Mar 10, 2024
1 parent a9a3ba4 commit f5a668b
Show file tree
Hide file tree
Showing 5 changed files with 333 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .devcontainer/Debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ ARG COMPILER
ARG COMPILER_VERSION

# hadolint ignore=DL3008,SC2086
RUN apt-get update \
RUN CXX_STDLIB_VERSION=${CXX_STDLIB:+$COMPILER_VERSION} \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
dpkg-dev \
g++ \
"${CXX_STDLIB:-g++}${CXX_STDLIB_VERSION:+-}${CXX_STDLIB_VERSION}${CXX_STDLIB:+-dev}" \
libc6-dev \
make \
ca-certificates \
Expand Down Expand Up @@ -159,14 +160,16 @@ RUN apt-get update \
&& apt-get remove -y --purge devscripts \
&& apt-get autoremove -y \
## Install R runtime dependencies
&& CXX_STDLIB_VERSION=${CXX_STDLIB:+$COMPILER_VERSION} \
&& apt-get install -y --no-install-recommends \
dpkg-dev \
g++ \
"${CXX_STDLIB:-g++}${CXX_STDLIB_VERSION:+-}${CXX_STDLIB_VERSION}${CXX_STDLIB:+-dev}" \
libc6-dev \
make \
ca-certificates \
"${COMPILER:-gcc}${COMPILER_VERSION:+-}${COMPILER_VERSION}" \
gfortran \
"${CXX_STDLIB}${CXX_STDLIB:+abi}${CXX_STDLIB_VERSION:+-}${CXX_STDLIB_VERSION}${CXX_STDLIB:+-dev}" \
libbz2-dev \
'^libcurl[3|4]$' \
libicu-dev \
Expand Down
81 changes: 81 additions & 0 deletions .devcontainer/debian-stable-clang-libcpp/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "R devel (Debian stable, Clang, libc++)",
"build": {
"dockerfile": "../Debian.Dockerfile",
"context": "..",
"args": {
"BASE_IMAGE": "debian",
"BASE_IMAGE_TAG": "stable",
"COMPILER": "clang",
"CXX_STDLIB": "libc++",
"CRAN": "https://cloud.r-project.org",
"R_VERSION": "devel",
// "NCPUS": "1",
"USE_ZSH_FOR_ROOT": "unset-to-use-bash",
"SET_LANG": "en_US.UTF-8",
"SET_TZ": "Etc/UTC"
}
},

"onCreateCommand": "onCreateCommand.sh",
"postCreateCommand": "postCreateCommand.sh",
"postStartCommand": "postStartCommand.sh",

"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true,
"upgradePackages": false,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
},
// A comma separated list of packages to install
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "qpdf"
}
},

"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"[email protected]",
"editorconfig.editorconfig",
"GitHub.vscode-pull-request-github",
"grapecity.gc-excelviewer",
"mhutchie.git-graph",
"mutantdino.resourcemonitor",
"redhat.vscode-yaml",
"REditorSupport.r",
"timonwong.shellcheck",
"exiasr.hadolint",
"ms-azuretools.vscode-docker",
"ms-vscode.cpptools"
],
"settings": {
"gitlens.showWelcomeOnInstall": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"r.bracketedPaste": true,
"r.plot.useHttpgd": true,
"r.rterm.linux": "/usr/local/bin/radian",
"r.rterm.option": [
"--no-save",
"--no-restore"
],
"r.workspaceViewer.showObjectSize": true,
"resmon.show.battery": false,
"resmon.show.cpufreq": false
}
}
},

// Set 'remoteUser' to 'root' to connect as root instead.
"remoteUser": "vscode",

"remoteEnv": {
// Pip: Install packages to the user site
"PIP_USER": "1",
// A comma separated list of packages to install
"R_PACKAGES": "future"
}
}
81 changes: 81 additions & 0 deletions .devcontainer/debian-testing-clang-libcpp/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "R devel (Debian testing, Clang, libc++)",
"build": {
"dockerfile": "../Debian.Dockerfile",
"context": "..",
"args": {
"BASE_IMAGE": "debian",
"BASE_IMAGE_TAG": "testing",
"COMPILER": "clang",
"CXX_STDLIB": "libc++",
"CRAN": "https://cloud.r-project.org",
"R_VERSION": "devel",
// "NCPUS": "1",
"USE_ZSH_FOR_ROOT": "unset-to-use-bash",
"SET_LANG": "en_US.UTF-8",
"SET_TZ": "Etc/UTC"
}
},

"onCreateCommand": "onCreateCommand.sh",
"postCreateCommand": "postCreateCommand.sh",
"postStartCommand": "postStartCommand.sh",

"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true,
"upgradePackages": false,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
},
// A comma separated list of packages to install
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "qpdf"
}
},

"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"[email protected]",
"editorconfig.editorconfig",
"GitHub.vscode-pull-request-github",
"grapecity.gc-excelviewer",
"mhutchie.git-graph",
"mutantdino.resourcemonitor",
"redhat.vscode-yaml",
"REditorSupport.r",
"timonwong.shellcheck",
"exiasr.hadolint",
"ms-azuretools.vscode-docker",
"ms-vscode.cpptools"
],
"settings": {
"gitlens.showWelcomeOnInstall": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"r.bracketedPaste": true,
"r.plot.useHttpgd": true,
"r.rterm.linux": "/usr/local/bin/radian",
"r.rterm.option": [
"--no-save",
"--no-restore"
],
"r.workspaceViewer.showObjectSize": true,
"resmon.show.battery": false,
"resmon.show.cpufreq": false
}
}
},

// Set 'remoteUser' to 'root' to connect as root instead.
"remoteUser": "vscode",

"remoteEnv": {
// Pip: Install packages to the user site
"PIP_USER": "1",
// A comma separated list of packages to install
"R_PACKAGES": "future"
}
}
83 changes: 83 additions & 0 deletions .devcontainer/debian-unstable-clang-18-libcpp/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "R devel (Debian unstable, Clang 18, libc++)",
"build": {
"dockerfile": "../Debian.Dockerfile",
"context": "..",
"args": {
"BASE_IMAGE": "debian",
"BASE_IMAGE_TAG": "unstable",
"COMPILER": "clang",
"COMPILER_VERSION": "18",
"CXX_STDLIB": "libc++",
"CRAN": "https://cloud.r-project.org",
"R_VERSION": "devel",
// "NCPUS": "1",
"INSTALL_COMMON_UTILS": "true",
"USE_ZSH_FOR_ROOT": "unset-to-use-bash",
"SET_LANG": "en_US.UTF-8",
"SET_TZ": "Etc/UTC"
}
},

"onCreateCommand": "onCreateCommand.sh",
"postCreateCommand": "postCreateCommand.sh",
"postStartCommand": "postStartCommand.sh",

"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true,
"upgradePackages": false,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
},
// A comma separated list of packages to install
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "qpdf"
}
},

"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"[email protected]",
"editorconfig.editorconfig",
"GitHub.vscode-pull-request-github",
"grapecity.gc-excelviewer",
"mhutchie.git-graph",
"mutantdino.resourcemonitor",
"redhat.vscode-yaml",
"REditorSupport.r",
"timonwong.shellcheck",
"exiasr.hadolint",
"ms-azuretools.vscode-docker",
"ms-vscode.cpptools"
],
"settings": {
"gitlens.showWelcomeOnInstall": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"r.bracketedPaste": true,
"r.plot.useHttpgd": true,
"r.rterm.linux": "/usr/local/bin/radian",
"r.rterm.option": [
"--no-save",
"--no-restore"
],
"r.workspaceViewer.showObjectSize": true,
"resmon.show.battery": false,
"resmon.show.cpufreq": false
}
}
},

// Set 'remoteUser' to 'root' to connect as root instead.
"remoteUser": "vscode",

"remoteEnv": {
// Pip: Install packages to the user site
"PIP_USER": "1",
// A comma separated list of packages to install
"R_PACKAGES": "future"
}
}
82 changes: 82 additions & 0 deletions .devcontainer/debian-unstable-clang-libcpp/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"name": "R devel (Debian unstable, Clang, libc++)",
"build": {
"dockerfile": "../Debian.Dockerfile",
"context": "..",
"args": {
"BASE_IMAGE": "debian",
"BASE_IMAGE_TAG": "unstable",
"COMPILER": "clang",
"CXX_STDLIB": "libc++",
"CRAN": "https://cloud.r-project.org",
"R_VERSION": "devel",
// "NCPUS": "1",
"INSTALL_COMMON_UTILS": "true",
"USE_ZSH_FOR_ROOT": "unset-to-use-bash",
"SET_LANG": "en_US.UTF-8",
"SET_TZ": "Etc/UTC"
}
},

"onCreateCommand": "onCreateCommand.sh",
"postCreateCommand": "postCreateCommand.sh",
"postStartCommand": "postStartCommand.sh",

"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true,
"upgradePackages": false,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
},
// A comma separated list of packages to install
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "qpdf"
}
},

"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"[email protected]",
"editorconfig.editorconfig",
"GitHub.vscode-pull-request-github",
"grapecity.gc-excelviewer",
"mhutchie.git-graph",
"mutantdino.resourcemonitor",
"redhat.vscode-yaml",
"REditorSupport.r",
"timonwong.shellcheck",
"exiasr.hadolint",
"ms-azuretools.vscode-docker",
"ms-vscode.cpptools"
],
"settings": {
"gitlens.showWelcomeOnInstall": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"r.bracketedPaste": true,
"r.plot.useHttpgd": true,
"r.rterm.linux": "/usr/local/bin/radian",
"r.rterm.option": [
"--no-save",
"--no-restore"
],
"r.workspaceViewer.showObjectSize": true,
"resmon.show.battery": false,
"resmon.show.cpufreq": false
}
}
},

// Set 'remoteUser' to 'root' to connect as root instead.
"remoteUser": "vscode",

"remoteEnv": {
// Pip: Install packages to the user site
"PIP_USER": "1",
// A comma separated list of packages to install
"R_PACKAGES": "future"
}
}

0 comments on commit f5a668b

Please sign in to comment.