You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a5450ea
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat: the cache collects the work directories of plans that describe (#977)
* feat: the cache collects the work directories of plans that describe
`mcpp emit build-database`, `mcpp pack --list-formats` and the pin check of
`mcpp publish` plan a project without writing into it, each in a directory
of the home: `cache/build-database/<key>`, `cache/pack-formats/<key>` and
`cache/publish-plan/<key>`, one per project. Nothing removed one. `cache gc`,
`prune` and `clean` read only the build cache, so the directory of a project
that no longer exists stayed for ever: one home held 626 of them, 3.4 GB,
and another 1.9 GB under pack-formats (mcpp#969).
The three commands now take their directory from one function,
mcpp::bmi_cache::plan_work_dir. It creates the directory and records each
use on its `.mcpp-plan` record: the record is written with the project root
when the directory is new, and otherwise its time is set by
mcpp::home::mark_used, the same rule the build cache's entries follow.
The cache's maintenance walks these directories as entries of kind `work`:
- `mcpp cache list` shows each one, named by the command and the project
its record names.
- The collection after a build, `cache prune --older-than`,
`cache gc --older-than` and `gc --max-size` collect a directory by its
record's time. A directory written before the record is dated by its own
time.
- `mcpp cache clean --work` empties the three areas, and `--all` now
includes them. A bare `cache clean` still drops package entries only.
Removing a directory costs the next plan of that project only writing it
again (SPEC-005 R2.1 already calls the directory a cache).
e2e 1119 seeds the three areas in a fresh home and checks the listing,
the collection by age and by size, and the clean flags. e2e 921 checks
that `emit build-database` records the project in its work directory.
docs/09 and docs/04 describe the store and the flag, in English and Chinese.
Closes#969.
* test: write the plan record in binary mode so Windows adds no carriage return
The product writes and reads .mcpp-plan in binary; the e2e case seeded it
in text mode, so on Windows the project label ended in a carriage return.
* cache: clean --all removes every kind of entry, the work directories of plans included
A flag of their own was one more word for the surface while the outputs of
build programs, the units and the patched variants had none: --all stated
every kind and left all four. It now removes what cache list shows.
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
* fix: a missing mcpp.lock is named, and a component of emit sbom states the package
The reader read a file that is not there as an empty lock, and the two
commands that report or assert the record were written for a reader that
fails: --locked named every package as one that is not in the lock, and
emit sbom gave the root alone without its note. load_existing states the
absence, and both read it. The refusal of --locked carries a help line and
writes no lock.
An entry's name is the lock's key: it may carry the namespace as a prefix,
and marks a variant (+p<digest>) and a version only build programs hold
(+b<digest>). emit sbom wrote the key as the package's name, so one package
had the purl pkg:mcpp/compat/compat.zlib and a build program's version was
a package of another name. short_name, moved from the lock's writer, and
package_name state the package; a purl percent-encodes its segments; one
identity under two spellings is one component; a version only build
programs hold names them in mcpp:build-program properties.
Closes#891, closes#892.
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
* fix: a range that reaches no key because of a pre-release names the pin
A range matches a pre-release only when it names one of the same version,
so no range reached a package whose one key is 0.0.0-651a425, and the
refusal listed that key without the cause. For the highest pre-release
whose release the range admits and which the range does not see, the
refusal states the rule and its help line is the exact pin. A pre-release
the range sees and excludes, or one outside the range, stays an ordinary
miss. prerelease_visible is exported for the question.
Closes#370.
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
* ci(fresh-install): the tumbleweed leg refreshes before it installs
zypper install continues on stale or empty metadata when its own refresh
fails, and the leg failed with "No provider of 'binutils' found", naming a
package instead of the repository that could not be read. The refresh is
its own command, retried once, and the install runs only after it succeeds.
Closes#523.
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
---------
Co-authored-by: Sunrisepeak <speakshen@163.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/09-commands-by-scenario.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ them. Confusing them costs a full rebuild.
32
32
|---|---|---|---|
33
33
|`target/<triple>/<fingerprint>/`, `target/.build-mcpp/{out,host}/`| one project | a configuration fingerprint changes and opens a new directory; a build program's outputs and the build programs are kept per configuration |`mcpp clean`, `mcpp clean --stale`|
34
34
| the build cache (`mcpp cache dir`) | the whole machine | any project compiles a dependency or a `std` module, or builds a host tool, or compiles the `mcpp` module its build program imports | collected after a build when unused for `[cache] unused_days`; `mcpp cache gc`, `mcpp cache prune`, `mcpp cache clean`|
35
+
| the work directories of plans (`<home>/cache/{build-database,pack-formats,publish-plan}/`) | the whole machine, one per project |`mcpp emit build-database`, `mcpp pack --list-formats` or `mcpp publish` plans a project | collected with the build cache's entries, by last use; `mcpp cache clean --all`|
35
36
36
37
`mcpp clean` removes `target/` entirely, and the next build recompiles
37
38
everything. `mcpp clean --stale` removes only the fingerprint directories that
@@ -129,6 +130,20 @@ mcpp cache gc --older-than 60d --dry-run # what would go, cache and store
129
130
mcpp cache gc --older-than 60d
130
131
```
131
132
133
+
`mcpp emit build-database`, `mcpp pack --list-formats` and `mcpp publish`'s
134
+
check of a library's pins plan a project without writing into it, each in a work directory of the home, one
135
+
per project: `<home>/cache/build-database/`, `cache/pack-formats/` and
136
+
`cache/publish-plan/`. A plan records its use in the directory's `.mcpp-plan`,
137
+
whose one line is the project root. `mcpp cache list` shows each directory as
138
+
an entry of kind `work`, named by the command and that project; the
139
+
collection after a build, `mcpp cache prune`, `mcpp cache gc --older-than` and
140
+
`gc --max-size` collect it by last use, as they collect a package entry.
141
+
`mcpp cache clean --all` removes every entry of the cache, these and the
142
+
outputs of build programs, the units and the patched variants included; the
143
+
flags `--deps`, `--std` and `--tools` each remove one kind and leave them. A
144
+
directory written before the record is dated by its own time. Removing one costs the
145
+
next plan of that project nothing but writing it again (mcpp#969).
146
+
132
147
## The versions a package publishes
133
148
134
149
`mcpp search` matches a substring and appends what each hit publishes, merged
0 commit comments