1
1
---
2
2
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
8
7
---
9
8
10
9
# The embedded library
@@ -40,7 +39,7 @@ order, into `/library` in the package we are building.
40
39
* The source package is bigger. Still not very big.
41
40
* pak always needs a compiler now when it is being installed from source.
42
41
43
- ## Undating embedded packages
42
+ ## Updating embedded packages
44
43
45
44
The ` embed.R ` file has some tools for
46
45
* listing the versions of the embedded packages,
@@ -65,6 +64,14 @@ again, with a special argument, to install dependencies into the user
65
64
cache library. If the same version of a dependency is already installed,
66
65
then that dependency is skipped, to make ` load_all() ` fairly quick.
67
66
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
+
68
75
## Cross compilation
69
76
70
77
pak supports cross-compilation now. You need to pass ` --host=<platform> `
@@ -160,6 +167,12 @@ Othewise it runs daily:
160
167
161
168
## GitHub Packages
162
169
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
+
163
176
## GitHub Pages
164
177
165
178
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/...
176
189
```
177
190
etc.
178
191
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
180
214
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