summaryrefslogtreecommitdiff
path: root/bin/just-mr.py
AgeCommit message (Collapse)Author
2023-03-08just-mr: fix options mismatchesPaul Cristian Sarbu
... both with respect to just options and the man page specifications. Option -L of just-mr was reassigned as a short name for --local-launcher, matching its use in just. Its place is now correctly held by the full name option --checkout-locations, as per the section-1 man page.
2023-03-06just-mr.py: Remove unused function argumentPaul Cristian Sarbu
2023-01-24just-mr.py: Make disdir content reproducible and consistentPaul Cristian Sarbu
In Python the json of a dict does not guarantee an order, while in our internal just-mr implementation the json always has the keys sorted. Also, the JSON dump in Python does not by default use the most compact representation. This change fixes these issues and makes the two just-mr versions produce the same distdir content id.
2023-01-20Add gc subcommandSascha Roloff
2022-12-23just-mr: fix distdir computationKlaus Aehlig
just-mr is designed to store everything that can be reported as git tree entirely in git only. To avoid recomputation, just-mr keeps index files mapping the description of a repository to the corresponding git trees. For these index files to be useful, the computation of the key has to be independent of the presence of the respective archives in CAS. This will become even more important once garbage collection will be added. Fix this for distdir repositories.
2022-12-12Just-mr: Fix handling and meaning of --just optionPaul Cristian Sarbu
The value of --just option should be used as-is, as it might be a var in PATH. The `execvp` call will handle this. The Python script and man page have been updated accrodingly.
2022-12-06just-mr: Fix norc handling in Python scriptPaul Cristian Sarbu
If norc options is given then no checks for the rc_path (e.g., whether it points to a file or not) should even be considered.
2022-12-02just-mr: fix format-string interpolationKlaus Aehlig
2022-11-07just-mr: remove leftoverAlberto Sartori
2022-10-21just-mr: Fix use of wrong file path for checkout locationsOliver Reiche
2022-10-20just-mr: Warn on inefficient Git operationsOliver Reiche
2022-10-20just-mr: Support for just-mrrc fileOliver Reiche
2022-10-20just-mr: Implement just-mr launchersOliver Reiche
2022-10-19Apply sharding as used in git to files stored in the just cache directory.Sascha Roloff
This commit also introduces an incompatible change, since it modifies the way how files are stored in the just cache directory. This modification reduces the number of files per directory and only introduces a maximum number new directories to avoid possible performance bottlenecks.
2022-10-19Add generation directory as part of the just cache root.Sascha Roloff
This change is introduced to be prepared for future changes such as garbage collection. It is an incompatible change compared to earlier just versions since it modifies the local path to the just cache directory, where among others the CASes, action cache, target-level cache are located.
2022-10-12Add copyright and license notice to all source and header filesKlaus Aehlig
Signed-off-by: Goetz Brasche <goetz.brasche@huawei.com>
2022-10-05just-mr.py: for the fetch subcommand acutally fetchKlaus Aehlig
A checkout does not necessarily fetch an archive: if we already have the git tree for that archive, this is enough to create a build root. For the fetch command, however, we need to have the actual archive as we have to copy it to the distdir. Of course, we only create the git tree once we got hold of the archive. However, with the introduction of CAS purging, the invariant that we have the archive whenever we can create a build root will no longer be true. This is acutally a feature as the git trees can be stored more compactly if we accumulate different release archives of the same upstream project. However, it also means that we explicitly have to fetch the archive in the fetch subcommand. Do this.
2022-07-28Add setup-env option to just-mrPaul Cristian Sarbu
2022-07-28Fix style in just-mrPaul Cristian Sarbu
2022-07-26Fix just-mr bug: ensure git cache folder present for git opsPaul Cristian Sarbu
2022-07-25just-mr: retry `git tag -f` if neededKlaus Aehlig
just-mr uses git tags to ensure that git roots used in the repository configuration handed out do not get garbage collected. Here, the tag encodes the commit to be kept; hence we can safely do this operation forcefully: we would only reset the tag to its old value. However, this tagging still is not free of races: git seems to first check for the existence of the tag and if not present tries creation under the assumption that no other process does so (and fails if this is the case). As our tagging is idempotent, we can safely retry it to work around this git race.
2022-07-20just-mr: Fix use of local Git repos with relative pathOliver Reiche
... by computing the absolute path (required to successfully identified them as a Git root) and enforcing that tag creation is only performed for the default Git root from the cache directory.
2022-07-20just-mr: Git root must always be a directoryOliver Reiche
... and not only located on the file system. This change enables the use of Git bundles as "non-local" repositories.
2022-07-07just-mr: more safely create directoriesKlaus Aehlig
While the just binary itself was carefully created to work correctly in the presence of several instances running simultaneously, the just-mr.py script started as proof-of-concept out of the need to conveniently generate a multi-repository configuration for just. Nevertheless, it is now actually used, so parallel running instances have to be taken seriously. Moreover, we have to ensure that in case of failures, we don't leave the local build root in a state giving a false impression on how an unpacked archive looks like. Both can be avoided by always working on temporary directories and, should a persistent location be needed, only renaming to the final desitantion once everything is set up correclty.
2022-06-30just-mr: retry removal of temporary directoriesKlaus Aehlig
When converting a directory to git, just-mr.py shells out to git to to the actual conversion. However, not in all cases git waits for its children, in particular when deciding to implicitly run git-gc ("Auto packing the repository in background for optimum performance.") This causes problems, as we assume that after git finishes we safely can remove the temporary directory from which we pulled; however, the shutils.rmtree function we call for this assumes the directory to be removed not to be changed by other processes---like git removing the file gc.pid. Work around this, by retrying the removal of no longer needed temporary directories.
2022-06-23Fix handling of existing tmp paths in just-mrPaul Cristian Sarbu
2022-06-23Add distdir repo type in just-mrPaul Cristian Sarbu
2022-06-23Extract useful logic into own functions in just-mrPaul Cristian Sarbu
2022-06-23Fix style of just-mrPaul Cristian Sarbu
2022-06-13just-mr: Support gitification of local non-git pathsOliver Reiche
2022-05-05just-mr: extend git environmentKlaus Aehlig
... and also use it for "git init" and "git add" as well, to avoid effects of unusual git configurations.
2022-04-27just-mr: support additional hashes for fetched filesKlaus Aehlig
While git's (sha1-based) blob identifier is good for daily use and strong enough to avoid accidental hash collisions (after all, we're using git to version our sources), sha1 is no longer considered safe enough to verify files downloaded through an unsecure channel. Therefore, support additional checksum verification when obtaining a file from the network.
2022-04-27use kebab-case for all cmd line argsAlberto Sartori
2022-04-25upgrade from optparse to argparseAlberto Sartori
2022-04-21just-mr: correctly set times and permissions in CASKlaus Aehlig
2022-04-21add compatibility with original remote build protocolAlberto Sartori
2022-04-19just-mr: Refer to ROOT via absolute pathOliver Reiche
... so accessing the CAS from a different cwd wont fail if the local_build_root was provided as relative path.
2022-04-07just-mr: fix run_cmd interfaceKlaus Aehlig
... so that the calls using stdin/stdout redirect also work properly.
2022-03-23multi-repo setup tool: add pragma to transfrom file roots to gitKlaus Aehlig
... and in this way enable them to present themselves to our tool als fully specified content (which will be useful once we add target caching). If that file root is under git anyway (like the rules or external target files in this repository) computing that git root is also a relatively cheap operation.
2022-02-22Initial self-hosting commitKlaus Aehlig
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>