mod shard_trees¶
- module shard_trees¶
Easyconfig trees for build-list lines whose easyconfigs EasyBuild fetches from GitHub.
eb X.eb --from-commit=SHAdownloads the easybuild-easyconfigs archive of that commit, readsX.ebfrom it, and appends itseasybuild/easyconfigsto the robot path.eb X.eb --from-pr=Ndownloads the easyconfig files pull request N changes, at its head, and appends them the same way. A dependency comes from the robot path when it is there and from the fetched files otherwise.stack shardresolves such a line the same way.A tree is found, in this order, in an explicit
COMMIT=DIRorN=DIRentry, in the cache directory, or by downloading it into the cache. A commit is served from https://codeload.github.com/<repo>/tar.gz/<sha>; a commit on a fork that a pull request carries is served through the upstream repository too. Only the.ebfiles undereasybuild/easyconfigs/are extracted. A pull request’s head commit and changed files come fromapi.github.comand the file text fromraw.githubusercontent.com; its cache entry is keyed by the head commit, so a pull request that moves is fetched again.A tree is written under a temporary name and renamed into place, so a cache entry that exists is complete, and two planners filling one cache at once both end with the same entry.
Variables
- const CACHE_DOWNLOAD_FAILED: &str¶
Prefix on a commit download that received no HTTP status.
run_stack_shard_withtreats a message that starts with this as a failure and writes nothing. An HTTP status, including 404, stays a per-line warning: the server answered, and the commit is simply absent.
- const EASYCONFIGS_REPO: &str¶
The repository
--from-commitand--from-prread.
- const MANIFEST: &str¶
File in a downloaded commit tree listing
sha256 relative/path.ebfor every easyconfig in it, so a planner can skip the files the robot path already has without reading them.
Functions
- fn extract_easyconfigs(archive: &[u8], dest: &Path) -> Result<usize, String>¶
Extract the
.ebfiles undereasybuild/easyconfigs/of a GitHub archive (<repo>-<sha>/first) intodest, at the same relative paths. Returns how many were written.
- fn overlay_candidates(tree: &Path, base: &BTreeMap<String, String>) -> Result<(Vec<crate::domain::Candidate>, Vec<String>), String>¶
The easyconfigs of
treethat differ from the robot path’s: a file whose name and content match the robot path’s effective easyconfig of that name resolves the same either way and is left out.basemaps a file name to the SHA-256 of the robot path’s file. A tree’sMANIFEST, when present, stands in for reading its files. Returns the parsed candidates and the files that did not parse.
Structs and Unions
- struct TreeSources<'a>¶
Where the trees of fetched lines come from.
- commit_trees: BTreeMap<String, PathBuf>¶
--commit-tree COMMIT=DIR: a commit, full or abbreviated, to an easyconfigs directory.
- pr_trees: BTreeMap<u64, PathBuf>¶
--pr-tree N=DIR: a pull request to a directory of its easyconfigs.
- cache: Option<PathBuf>¶
--commit-cache DIR: trees found or downloaded there.
- repo: String¶
owner/nameof the easyconfigs repository.
Implementations
- impl TreeSources<'_>¶
Functions
- fn any(&self) -> bool¶
Whether any source is configured.
- fn commit_tree(&self, sha: &str) -> Result<PathBuf, String>¶
The easyconfigs directory of
sha, or why there is none.
- fn explicit_commit_tree(&self, sha: &str) -> Option<Result<PathBuf, String>>¶
The
--commit-treedirectory ofsha, when one names it.
- fn pr_tree(&self, number: u64) -> Result<PathBuf, String>¶
The directory of pull request
number’s easyconfigs at its head, or why there is none.