Skip to content

Commit cc9966c

Browse files
committed
More internal docs
1 parent 95773d5 commit cc9966c

File tree

2 files changed

+48
-8
lines changed

2 files changed

+48
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@
4343
/src/library/zip/src/tools/cmdzip
4444
/tools/build/linux/pak_*.tar.gz
4545
/tools/build/linux/*.done
46+
/vignettes/internals.html
47+
/vignettes/internals.md

vignettes/internals.Rmd renamed to vignettes/internals.qmd

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
title: "pak internals"
3-
output: github_document
4-
editor_options:
5-
markdown:
6-
wrap: sentence
7-
canonical: true
3+
format:
4+
gfm:
5+
toc: true
6+
toc-depth: 2
87
---
98

109
# The embedded library
@@ -40,7 +39,7 @@ order, into `/library` in the package we are building.
4039
* The source package is bigger. Still not very big.
4140
* pak always needs a compiler now when it is being installed from source.
4241

43-
## Undating embedded packages
42+
## Updating embedded packages
4443

4544
The `embed.R` file has some tools for
4645
* listing the versions of the embedded packages,
@@ -65,6 +64,14 @@ again, with a special argument, to install dependencies into the user
6564
cache library. If the same version of a dependency is already installed,
6665
then that dependency is skipped, to make `load_all()` fairly quick.
6766

67+
## Embedding dev packages from GitHub
68+
69+
There is no support for packages from GitHub currently, that needs to
70+
be done manually:
71+
- package has to be added manually,
72+
- it has to be updated manually.
73+
I might add some support for them later, when I start to use them.
74+
6875
## Cross compilation
6976

7077
pak supports cross-compilation now. You need to pass `--host=<platform>`
@@ -160,6 +167,12 @@ Othewise it runs daily:
160167

161168
## GitHub Packages
162169

170+
All builds (via `Makefile`) upload the built packages to GitHub Packages:
171+
<https://github.com/r-lib/pak/pkgs/container/pak>.
172+
They also update `manifest.json` at
173+
<https://github.com/r-lib/pak/tree/packages>.
174+
`manifest.json` is the ground truth for the repository.
175+
163176
## GitHub Pages
164177

165178
The challenge is that the site is very close to the 1GB limit, sometimes
@@ -176,6 +189,31 @@ https://raw.githubusercontent.com/r-lib/pak/repo/bin/macosx/...
176189
```
177190
etc.
178191

179-
### Challenges
192+
## Challenges
193+
194+
### Concurrency
195+
196+
Dealing with concurrency on GHA is a challenge on GHA.
197+
GitHub Packages requires that we push all architectures (=pak builds) at
198+
the same time. (The package files do not need to be present of the
199+
client if they stay the same.) So we treat `manifest.json` as the ground
200+
truth, and we update it for the pak build(s) that we are about to push.
201+
202+
After pushing to GitHub Packages, we update `manifest.json` and push
203+
that to GitHub. If the push is not clean, then we need to do the whole
204+
update process again. With many concurrent builds finishing around the
205+
same time, this happens a lot, so in the end we do a lot of pushes to
206+
GitHub Packages.
207+
208+
An alternative would be to store each pak build in its own package at
209+
GitHub Packages, instead of one multi-arch package. But it is also
210+
nice to have a single package, instead of about a hundred one. (One
211+
for each platform for each R version, for each stream.)
212+
213+
### Cleanup
180214

181-
TODO
215+
Old packages are not cleaned up on GitHub Packages, so ideally we
216+
would need to clean them up regularly, to avoid using too much
217+
space. E.g. we could clean up packages that are older than (say) a
218+
week, and that are not referenced from the `manifest.json` file.
219+
But we don't do that currently.

0 commit comments

Comments
 (0)