From 1465cedd007b11dceb5d86ff092e9411e66ecc04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 8 Dec 2024 11:45:44 +0100 Subject: [PATCH 1/5] docs: Instructions and supporting script for a clean working copy --- .github/README.md | 15 +++ .github/local/dot-gitignore | 213 ++++++++++++++++++++++++++++++++++++ .github/local/post-checkout | 5 + .github/local/setup.sh | 11 ++ 4 files changed, 244 insertions(+) create mode 100644 .github/local/dot-gitignore create mode 100755 .github/local/post-checkout create mode 100755 .github/local/setup.sh diff --git a/.github/README.md b/.github/README.md index ddd313cf407..180d4c72bf7 100644 --- a/.github/README.md +++ b/.github/README.md @@ -31,3 +31,18 @@ Build scripts for GitHub actions are always stored in the [workflows](./workflow The [examples](./examples) directory contains scripts to show how to build R locally. Basically these scripts just let you run the same steps as the CI in [build-svn.yaml](./workflows/build-svn.yaml) for a given platform: - [build-r-macos.sh](./examples/build-r-macos.sh): do a full prep, build, and check on MacOS. + +## Develop locally + +For local development, `git status` should accurately reflect the state of the repository. +A default clone will have the following two problems: + +- A large amount of untracked unignored files. +- A change in `Makefile.in` necessitated by having to build from a Git clone. + +The [local](./local) directory contains files to help with these issues: + +- [dot-gitignore](./local/dot-gitignore): A `.gitignore` file ready to copy to the root of the project. +- [post-checkout](./local/post-checkout): A script to update the `SVNINFO` file after each checkout or commit. + +Run the [setup.sh](./local/setup.sh) script for automated setup. diff --git a/.github/local/dot-gitignore b/.github/local/dot-gitignore new file mode 100644 index 00000000000..0458e9eef3a --- /dev/null +++ b/.github/local/dot-gitignore @@ -0,0 +1,213 @@ +/.gitignore +*.o +*.d +*.a +*.so +*.dylib +/src/library/Recommended/* +/.cache/ +/.editorconfig +/Makeconf +/Makefile +/Makefile.in.bak +/Makefrag.cc +/Makefrag.cc_lo +/Makefrag.cxx +/Makefrag.m +/SVNINFO +/SVN-REVISION +/bin/ +/compile_commands.json +/config.log +/config.status +/cran.rstudio.com/ +/doc/FAQ +/doc/Makefile +/doc/NEWS +/doc/NEWS.2.rds +/doc/NEWS.3.rds +/doc/NEWS.rds +/doc/R.1 +/doc/RESOURCES +/doc/Rscript.1 +/doc/html/Makefile +/doc/html/NEWS.html +/doc/html/index.html +/doc/html/resources.html +/doc/manual/Makefile +/etc/Makeconf +/etc/Makefile +/etc/Renviron +/etc/javaconf +/etc/ldpaths +/include/ +/libconftest.dSYM/ +/library/ +/libtool +/m4/Makefile +/non-tarball +/po/Makefile +/share/Makefile +/share/zoneinfo/ +/src/Makefile +/src/appl/Makedeps +/src/appl/Makefile +/src/extra/Makefile +/src/extra/blas/Makefile +/src/extra/intl/Makedeps +/src/extra/intl/Makefile +/src/extra/intl/charset.alias +/src/extra/intl/charsetalias.h +/src/extra/intl/libgnuintl.h +/src/extra/tre/Makedeps +/src/extra/tre/Makefile +/src/extra/tzone/Makedeps +/src/extra/tzone/Makefile +/src/extra/xdr/Makefile +/src/include/Makefile +/src/include/R.ts +/src/include/R_ext/Altrep.ts +/src/include/R_ext/Applic.ts +/src/include/R_ext/Arith.ts +/src/include/R_ext/BLAS.ts +/src/include/R_ext/Boolean.ts +/src/include/R_ext/Callbacks.ts +/src/include/R_ext/Complex.ts +/src/include/R_ext/Connections.ts +/src/include/R_ext/Constants.ts +/src/include/R_ext/Error.ts +/src/include/R_ext/GetX11Image.ts +/src/include/R_ext/GraphicsDevice.ts +/src/include/R_ext/GraphicsEngine.ts +/src/include/R_ext/Itermacros.ts +/src/include/R_ext/Lapack.ts +/src/include/R_ext/Linpack.ts +/src/include/R_ext/Makefile +/src/include/R_ext/MathThreads.ts +/src/include/R_ext/Memory.ts +/src/include/R_ext/Parse.ts +/src/include/R_ext/Print.ts +/src/include/R_ext/PrtUtil.ts +/src/include/R_ext/QuartzDevice.ts +/src/include/R_ext/RS.ts +/src/include/R_ext/RStartup.ts +/src/include/R_ext/Rallocators.ts +/src/include/R_ext/Random.ts +/src/include/R_ext/Rdynload.ts +/src/include/R_ext/Riconv.ts +/src/include/R_ext/Utils.ts +/src/include/R_ext/Visibility.ts +/src/include/R_ext/eventloop.ts +/src/include/R_ext/libextern.ts +/src/include/R_ext/stamp-R +/src/include/R_ext/stats_package.ts +/src/include/R_ext/stats_stubs.ts +/src/include/Rconfig.h +/src/include/Rconfig.tsa +/src/include/Rdefines.ts +/src/include/Rembedded.ts +/src/include/Rinterface.ts +/src/include/Rinternals.ts +/src/include/Rmath.h +/src/include/Rmath.h0 +/src/include/Rmath.tsa +/src/include/Rversion.h +/src/include/Rversion.tsa +/src/include/config.h +/src/include/libintl.h +/src/include/stamp-R +/src/include/stamp-h +/src/library/.vignettes/ +/src/library/Makefile +/src/library/base/DESCRIPTION +/src/library/base/Makefile +/src/library/base/all.R +/src/library/compiler/DESCRIPTION +/src/library/compiler/Makefile +/src/library/compiler/all.R +/src/library/datasets/DESCRIPTION +/src/library/datasets/Makefile +/src/library/grDevices/DESCRIPTION +/src/library/grDevices/Makefile +/src/library/grDevices/all.R +/src/library/grDevices/src/Makedeps +/src/library/grDevices/src/Makefile +/src/library/grDevices/src/cairo/Makefile +/src/library/graphics/DESCRIPTION +/src/library/graphics/Makefile +/src/library/graphics/all.R +/src/library/graphics/src/Makedeps +/src/library/graphics/src/Makefile +/src/library/grid/DESCRIPTION +/src/library/grid/Makefile +/src/library/grid/all.R +/src/library/grid/src/Makedeps +/src/library/grid/src/Makefile +/src/library/methods/DESCRIPTION +/src/library/methods/Makefile +/src/library/methods/all.R +/src/library/methods/src/Makedeps +/src/library/methods/src/Makefile +/src/library/parallel/DESCRIPTION +/src/library/parallel/Makefile +/src/library/parallel/all.R +/src/library/parallel/src/Makedeps +/src/library/parallel/src/Makefile +/src/library/profile/Makefile +/src/library/splines/DESCRIPTION +/src/library/splines/Makefile +/src/library/splines/all.R +/src/library/splines/src/Makedeps +/src/library/splines/src/Makefile +/src/library/stats/DESCRIPTION +/src/library/stats/Makefile +/src/library/stats/all.R +/src/library/stats/src/Makedeps +/src/library/stats/src/Makefile +/src/library/stats4/DESCRIPTION +/src/library/stats4/Makefile +/src/library/stats4/all.R +/src/library/tcltk/DESCRIPTION +/src/library/tcltk/Makefile +/src/library/tcltk/src/Makefile +/src/library/tools/DESCRIPTION +/src/library/tools/Makefile +/src/library/tools/all.R +/src/library/tools/src/Makedeps +/src/library/tools/src/Makefile +/src/library/translations/DESCRIPTION +/src/library/translations/Makefile +/src/library/utils/DESCRIPTION +/src/library/utils/Makefile +/src/library/utils/all.R +/src/library/utils/src/Makedeps +/src/library/utils/src/Makefile +/src/main/Makedeps +/src/main/Makefile +/src/main/R.bin +/src/modules/Makefile +/src/modules/X11/Makefile +/src/modules/internet/Makedeps +/src/modules/internet/Makefile +/src/modules/lapack/Makedeps +/src/modules/lapack/Makefile +/src/nmath/Makedeps +/src/nmath/Makefile +/src/nmath/standalone/Makefile +/src/scripts/Makefile +/src/scripts/R.fe +/src/scripts/R.sh +/src/scripts/Rcmd +/src/scripts/javareconf +/src/scripts/mkinstalldirs +/src/scripts/pager +/src/scripts/rtags +/src/unix/Makedeps +/src/unix/Makefile +/src/unix/Rscript +/src/unix/Rscript.dSYM/ +/stamp-java +/tests/Embedding/Makefile +/tests/Examples/Makefile +/tests/Makefile +/tools/Makefile diff --git a/.github/local/post-checkout b/.github/local/post-checkout new file mode 100755 index 00000000000..ead26b4ce5e --- /dev/null +++ b/.github/local/post-checkout @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "post-checkout: Updating SVNINFO" +./.github/scripts/svn-info.sh > SVNINFO + diff --git a/.github/local/setup.sh b/.github/local/setup.sh new file mode 100755 index 00000000000..819689a8dbf --- /dev/null +++ b/.github/local/setup.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -ex + +cd $(dirname $0)/../.. +rm -f .gitignore +cp .github/local/dot-gitignore .gitignore + +cd .git/hooks +rm -f post-checkout +cp ../../.github/local/post-checkout . From 43bb84390a957cb8185f7d5e9b30f76592b79328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 8 Dec 2024 11:47:09 +0100 Subject: [PATCH 2/5] Backticks --- .github/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/README.md b/.github/README.md index 180d4c72bf7..bcc034a53ef 100644 --- a/.github/README.md +++ b/.github/README.md @@ -28,9 +28,9 @@ Build scripts for GitHub actions are always stored in the [workflows](./workflow ## Build locally -The [examples](./examples) directory contains scripts to show how to build R locally. Basically these scripts just let you run the same steps as the CI in [build-svn.yaml](./workflows/build-svn.yaml) for a given platform: +The [`examples`](./examples) directory contains scripts to show how to build R locally. Basically these scripts just let you run the same steps as the CI in [`build-svn.yaml`](./workflows/build-svn.yaml) for a given platform: - - [build-r-macos.sh](./examples/build-r-macos.sh): do a full prep, build, and check on MacOS. + - [`build-r-macos.sh`](./examples/build-r-macos.sh): do a full prep, build, and check on MacOS. ## Develop locally @@ -40,9 +40,9 @@ A default clone will have the following two problems: - A large amount of untracked unignored files. - A change in `Makefile.in` necessitated by having to build from a Git clone. -The [local](./local) directory contains files to help with these issues: +The [`local`](./local) directory contains files to help with these issues: -- [dot-gitignore](./local/dot-gitignore): A `.gitignore` file ready to copy to the root of the project. -- [post-checkout](./local/post-checkout): A script to update the `SVNINFO` file after each checkout or commit. +- [`dot-gitignore`](./local/dot-gitignore): A `.gitignore` file ready to copy to the root of the project. +- [`post-checkout`](./local/post-checkout): A script to update the `SVNINFO` file after each checkout or commit. -Run the [setup.sh](./local/setup.sh) script for automated setup. +Run the [`setup.sh`](./local/setup.sh) script for automated setup. From 56d36aee6d49adb06fa605ffb1b9d462ff60753f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 8 Dec 2024 11:53:33 +0100 Subject: [PATCH 3/5] Mention bear --- .github/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/README.md b/.github/README.md index bcc034a53ef..0434cf0c2c0 100644 --- a/.github/README.md +++ b/.github/README.md @@ -46,3 +46,9 @@ The [`local`](./local) directory contains files to help with these issues: - [`post-checkout`](./local/post-checkout): A script to update the `SVNINFO` file after each checkout or commit. Run the [`setup.sh`](./local/setup.sh) script for automated setup. + +For creating `compile_commands.json` for use with LSPs (autocompletion in your IDE), use the [bear](https://github.com/rizsotto/Bear) tool: + +```sh +bear -- make -j4 +``` From 5bb26efc7633fa79d63be181140746f0bbecefee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 8 Dec 2024 11:59:04 +0100 Subject: [PATCH 4/5] Editing instructions --- .github/local/dot-gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/local/dot-gitignore b/.github/local/dot-gitignore index 0458e9eef3a..520a59d0555 100644 --- a/.github/local/dot-gitignore +++ b/.github/local/dot-gitignore @@ -1,3 +1,6 @@ +# Copied from .github/local/dot-gitignore, do not edit by hand +# Instead, edit the original file and run .github/local/setup.sh to update this file + /.gitignore *.o *.d From 428a5b3a1996b51d9d11f908514cda70a5f1c48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 8 Dec 2024 12:26:34 +0100 Subject: [PATCH 5/5] More ignores --- .github/local/dot-gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/local/dot-gitignore b/.github/local/dot-gitignore index 520a59d0555..b0580086160 100644 --- a/.github/local/dot-gitignore +++ b/.github/local/dot-gitignore @@ -7,6 +7,8 @@ *.a *.so *.dylib +*.inn +*.html /src/library/Recommended/* /.cache/ /.editorconfig @@ -214,3 +216,8 @@ /tests/Examples/Makefile /tests/Makefile /tools/Makefile +/doc/NEWS.pdf +/doc/manual/htmlxref.cnf +/doc/manual/stamp-images-html +/doc/manual/version.texi +/src/library/stamp-docs