Skip to content

Commit

Permalink
merge in devel branch
Browse files Browse the repository at this point in the history
Merge branch 'devel' into update/docs

# Conflicts:
#	docs/tutorials/multi_r_compilation.md
  • Loading branch information
hturner committed Jun 19, 2024
2 parents 5618567 + a0804e6 commit b9757e7
Show file tree
Hide file tree
Showing 20 changed files with 255 additions and 199 deletions.
14 changes: 14 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Set site library for full use of VSCode-R extension.
# This is where packages required by VSCode-R extension are installed, specifically
# - jsonlite and rlang for R Session Watcher (needed to open HTML help pages)
# - languageserver for code completion
# - httpgd for http graphics device
# These are built and installed for the default R version when container is built.

.Library.site <- "/usr/local/lib/R/site-library"
# .libPaths() already includes site library for default R version.
.libPaths(c(.libPaths(), .Library.site))

# For PNG graphics uncomment following lines
# options(vsc.use_httpgd = FALSE,
# vsc.dev.args = list(width = 800, height = 600))
18 changes: 10 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "R-Dev-Env",
"image": "ghcr.io/r-devel/r-dev-env:add-version-number-to-container",
"image": "ghcr.io/r-devel/r-dev-env:devel",
"hostRequirements": {
"cpus": 4
},

"customizations": {
"vscode": {
"vscode": {
"settings": {
"r.lsp.diagnostics": false,
"r.plot.useHttpgd": true,
"r.rpath.linux": "/usr/bin/R",
"r.rterm.linux": "/usr/bin/R",
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
"r.rterm.linux": "/usr/bin/R",
"terminal.integrated.sendKeybindingsToShell": true,
"svn.multipleFolders.enabled": true,
"r.lsp.diagnostics": false
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
"workbench.welcomePage.walkthroughs.openOnInstall": false
},
"extensions": [
"REditorSupport.r",
Expand All @@ -25,7 +28,6 @@
"ms-vscode.cpptools",
"MS-vsliveshare.vsliveshare"
]

}
},
"postCreateCommand":"cat /workspaces/r-dev-env/scripts/welcome_msg.sh >> ~/.bashrc && bash /workspaces/r-dev-env/scripts/localscript.sh"
Expand Down
130 changes: 66 additions & 64 deletions .github/workflows/build-and-publish-image.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,66 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build and publish Docker image

on:
pull_request:
branches: ["devel"]
types: [closed]
paths:
- 'dockerfile'
- 'reinstall-cmake.sh'


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract version number
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{ env.VERSION }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
"CONTAINER_VERSION=${{ env.VERSION }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build and publish Docker image

on:
workflow_dispatch:
pull_request:
branches: ["devel"]
types: [closed]
paths:
- '.github/workflows/build-and-publish-image.yml'
- 'Dockerfile'
- 'reinstall-cmake.sh'


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract version number
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{ env.VERSION }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
build-args: |
CONTAINER_VERSION=${{ env.VERSION }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions .github/workflows/build-mkdocs-website.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Build MKDocs website

on:
workflow_dispatch:
pull_request:
branches: ["devel"]
types: [closed]
paths:
- 'build-mkdocs-website.yml'
- 'docs/**/**'
- 'mkdocs.yml'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Build and publish Docker image(Schedule Workflow)
name: Build and publish Docker image (Schedule Workflow)

on:
pull_request:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ R-4.1.3.tar.gz
R-devel/
R-devel.tar.gz
/venv
.cache/
.cache/
.Rproj.user
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ RUN sed -i.bak "/^#.*deb-src.*universe$/s/^# //g" /etc/apt/sources.list \
&& apt -y install subversion \
&& apt -y build-dep r-base-dev \
&& apt -y install r-base-dev \
&& Rscript -e "install.packages('languageserver', repos='https://cran.rstudio.com')"
&& Rscript -e "install.packages('languageserver', repos='https://cran.rstudio.com')" \
&& Rscript -e "install.packages('httpgd', repos='https://cran.rstudio.com')"

RUN apt install shellcheck
RUN apt install -y ccache
#RUN /usr/sbin/update-ccache-symlinks
#RUN echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a /home/vscode/.bashrc
ENV BUILDDIR='/workspaces/r-dev-env/build'
ENV TOP_SRCDIR='/workspaces/r-dev-env/svn'


ENV BUILDDIR="/workspaces/r-dev-env/build/r-devel"
ENV TOP_SRCDIR="/workspaces/r-dev-env/svn/r-devel"
ENV PATCHDIR='/workspaces/r-dev-env/patches'
ARG CONTAINER_VERSION
ENV CONTAINER_VERSION ${CONTAINER_VERSION}
ENV CONTAINER_VERSION ${CONTAINER_VERSION}
File renamed without changes.
3 changes: 3 additions & 0 deletions INIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file is used as a marker to indicate when a codespace is first opened.

See `scripts/welcome_message.sh` for use.
4 changes: 3 additions & 1 deletion docs/contributor_guide/contributing_to_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ source ./venv/bin/activate

5. Now install libraries and dependencies for mkdocs
```
pip install mkdocs mkdocs-material[imaging]
pip install mkdocs "mkdocs-material[imaging]"
```

6. After setting up the virtual environment and installing necessary libraries, navigate to the root directory of the project where the `mkdocs.yml` file is located.
Expand All @@ -32,3 +32,5 @@ This will compile the documentation and serve it locally. You can access the doc

9. Preview Changes: As you make changes, the local development server will automatically detect them and update the preview in real-time. Refresh your browser to see the changes.

**N.B.** There is a known issue with mkdocs not alwayds finding Cairo. The issue and suggested fixes are on the [MkDocs Image Processing](https://squidfunk.github.io/mkdocs-material/plugins/requirements/image-processing/) page.

3 changes: 1 addition & 2 deletions docs/tutorials/multi_r_compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ You can build multiple R versions in the same Codespaces environment.
Enter the number corresponding to the selected version:
```
!!! Note
!!! Note
`BUILDDIR` and `TOP_SRCDIR` will be set to the defaults using the label `r-devel`
whenever a new bash terminal is opened, e.g. when the codespace is restarted.
Expand Down
51 changes: 49 additions & 2 deletions docs/tutorials/svn_help.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
# SVN Help Command
## Checking out a different revision

svn commands and desc somewhere here
You can check out a specific revision of the R sources with

```bash
svn checkout -r 1234 https://svn.r-project.org/R/trunk/ $TOP_SRCDIR
```

### Finding the last revision that passed check

Occasionally, the latest revision of the R sources does not pass `make check`.
In this case, it can be a good idea to revert to an earlier revision until the R Core Team have made further updates to fix the issue.

Visit the [Build from SVN](https://github.com/r-devel/r-svn/actions/workflows/build-svn.yaml) page that summarises attempted builds of R using GitHub actions on the unofficial GitHub mirror.
Find the latest run that completed successfully (green checkmark) and use the commit message to search for the corresponding Subversion revision.
For example, to search the last 10 revisions for the log message "More @apifun and such annotations"

```bash
cd $TOP_SRCDIR
svn log --limit 10 --search "More @apifun and such annotations"
```
```
/workspaces/r-dev-env/svn/r-devel $ svn log --limit 10 --search "More @apifun and such annotations"
------------------------------------------------------------------------
r86726 | luke | 2024-06-12 18:00:19 +0000 (Wed, 12 Jun 2024) | 2 lines
More @apifun and such annotations.
------------------------------------------------------------------------
r86723 | luke | 2024-06-11 20:31:36 +0000 (Tue, 11 Jun 2024) | 2 lines
More @apifun and such annotations.
------------------------------------------------------------------------
```

If you have already attempted to build R, you can re-run the make with the version identified in your search as follows:

```
svn checkout -r 86726 https://svn.r-project.org/R/trunk/ $TOP_SRCDIR
cd $BUILDDIR
make
make check
```

Otherwise, follow the full instructions in [Building R](./building_r.md), updating the svn checkout command to use the required revision.

## Further Subversion Help

For further help on Subversion, refer to the online book [Version Control with Subversion](https://svnbook.red-bean.com/).
11 changes: 5 additions & 6 deletions scripts/localscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
mkdir -p /home/vscode/.local/bin
mkdir -p $PATCHDIR

chmod +x /workspaces/r-dev-env/scripts/rterm.sh
chmod +x /workspaces/r-dev-env/scripts/multi_r.sh
chmod +x /workspaces/r-dev-env/scripts/which_r.sh
chmod +x /workspaces/r-dev-env/scripts/set_build_r.sh

mv /workspaces/r-dev-env/scripts/rterm.sh /home/vscode/.local/bin/rterm
cp /workspaces/r-dev-env/scripts/multi_r.sh /home/vscode/.local/bin/multi_r
cp /workspaces/r-dev-env/scripts/which_r.sh /home/vscode/.local/bin/which_r
cp /workspaces/r-dev-env/scripts/set_build_r.sh /home/vscode/.local/bin/set_build_r

#remove git directory
cd /workspaces/r-dev-env
# remove git directory
rm -rf .git
Loading

0 comments on commit b9757e7

Please sign in to comment.