summaryrefslogtreecommitdiff
path: root/bin/just-lock.py
AgeCommit message (Collapse)Author
2025-03-03just-lock: follow indirection when checking for computed rootsPaul Cristian Sarbu
When deciding if a repository is a computed root (i.e., of type "computed" or "tree structure"), first follow indirections. Otherwise we would try to read of the "type" entry of a string which, of course, crashes. Based on the similar fix for just-import-git.
2025-02-28just-lock: Parallelize cloning, subject to GILPaul Cristian Sarbu
Python's Global Interpreter Lock (GIL) hugely reduces the amount of parallelism one can achieve. However, as cloning repositories is I/O bound, the total runtime is improved by running it in parallel.
2025-02-28just-lock imports: Parallelize checkouts, subject to GILPaul Cristian Sarbu
Python's Global Interpreter Lock (GIL) hugely reduces the amount of parallelism one can achieve. However, as the checkout methods are I/O bound, the total runtime is improved by running them in parallel.
2025-02-28just-lock git-tree imports: Separate checkout logic into own methodPaul Cristian Sarbu
This will allow it to be run mostly asynchronously with other checkouts in the future.
2025-02-28just-lock archive imports: Separate checkout logic into own methodPaul Cristian Sarbu
This will allow it to be run mostly asynchronously with other checkouts in the future.
2025-02-28just-lock git imports: Separate checkout logic into own methodPaul Cristian Sarbu
This will allow it to be run mostly asynchronously with other checkouts in the future.
2025-02-28just-lock: Improve thread safety in Git operationsPaul Cristian Sarbu
Similarly to how it is done in just-mr: - lock against concurrent git-tag calls; - extend git-fetch call with arguments that ensure thread-safe operation.
2025-02-28just-lock: Always use os.environ.copy()Paul Cristian Sarbu
2025-02-28just-lock git imports: Improve cache hit ratePaul Cristian Sarbu
...by first retrieving only the desired commit id from the definitive remote in order to allow it to be checked against the local Git cache. This massively reduces the average network traffic from regenerating the just-mr configuration in justbuild projects that always require the latest version of their dependencies.
2025-02-28just-lock: Allow stderr capture and reporting when running commandsPaul Cristian Sarbu
2025-02-28just-lock: Properly format multi-line logsPaul Cristian Sarbu
2025-02-28just-lock: Fix missing fail conditionPaul Cristian Sarbu
2025-02-28just-lock clone: Fix wrong order in resolving treesPaul Cristian Sarbu
Match correctly the behavior of just-mr, i.e., resolve the special entries of the relevant subtree of the original tree instead of taking the subtree of the resolved original tree. This also means that the clones of archives can directly stage the relevant subdir of the unpacked content and forward any 'special' pragma (same as for other cloned repository types).
2025-02-24just-lock: Implement 'generic' source typePaul Cristian Sarbu
2025-02-24just-lock: Allow input argument for method running commandsPaul Cristian Sarbu
2025-02-24just-lock: Avoid unnecessary chances for unwanted side-effectsPaul Cristian Sarbu
...in handling mutable objects. In particular, treat mutable function variables, as well as any references they might contain, as constant.
2025-02-24just-lock: Fix parsing of optional container fieldsPaul Cristian Sarbu
...with not-None defaults. While there, fix wrong command environment set in 'git tree' imports.
2025-02-20just-lock: Add support for cloning 'git tree' repositoriesPaul Cristian Sarbu
2025-02-20just-lock: Add test for cloning archive-related repositoriesPaul Cristian Sarbu
...such as 'archive', 'zip', 'foreign file', and 'distdir'.
2025-02-20just-lock: Add support for cloning 'distdir' repositoriesPaul Cristian Sarbu
2025-02-20just-lock: Add support for cloning 'foreign file' repositoriesPaul Cristian Sarbu
2025-02-20just-lock: Add support for cloning 'archive' and 'zip' repositoriesPaul Cristian Sarbu
For these repositories the clone will contain only the subdir of the resolved unpacked archive.
2025-02-20just-lock: Add support for cloning 'git' repositoriesPaul Cristian Sarbu
2025-02-20just-lock: Initial implementation of --clone optionPaul Cristian Sarbu
This option stages locally the sources (i.e., workspace root) of a target repository found by following a list of bindings from a known starting repository. The final configuration will keep during deduplication the names of each starting repository and each target repository, with the output configuration updated to point to these local clones. Precomputed repositories cannot be cloned. Implementation is split in multiple commits. This commit contains the main logic for handling cloning. Currently only support for 'file' repositories is implemented. The code structure allows it to be subsequently extended to all other repository types.
2025-02-20just-lock: Add utility doing own parsing before fetching archivePaul Cristian Sarbu
Preparatory commit for implementation of '--clone' option.
2025-02-20just-lock: Add option to set a just binary to usePaul Cristian Sarbu
2025-02-20just-lock: Support special pragma for plain importsPaul Cristian Sarbu
Marking a source repository 'as plain' means that the whole source repository tree will get imported as a repository type corresponding to the source type. In this case, additional pragmas than those supported by the inndividual imports might need to be set. Solve this by supporting the just-mr-style 'pragma' field also in the source description, for all sources also accepting the 'as plain' field. Currently support only the 'special' pragma. Document change and add test for plain imports that checks this feature.
2025-02-20just-lock: Improve handling of pragmas in 'repos' import descriptionPaul Cristian Sarbu
In particular, any transitive 'file'-type repository will inherit any given '{to_git: true}' pragma in the import description objects. Note that this technically can only happen for transitive 'file' repositories imported from a 'file' source, so in all other cases such a pragma would not have any effect. Document change and extend the import from 'file' source test to check this feature.
2025-02-20just-lock: Fix missing inherited pragmasPaul Cristian Sarbu
Transitive 'file'-type repositories should inherit any pragmas suported by the new repository type they are rewritten as. Extend import tests to avoid regressing on this issue in the future.
2025-01-29just-lock: Search for archives to fetch also in Git cachePaul Cristian Sarbu
...before trying remotes.
2025-01-29just-lock: Run commit check command only on existing repositoriesPaul Cristian Sarbu
While there, improve docstrings of methods operating on Git repositories to specify when the underlying Git repositories are expected to be present.
2025-01-29just-lock: Add support for 'tree structure' rootsPaul Cristian Sarbu
Based on f0473730 and 22ef0a16
2025-01-29just-lock: Fix deduplication of 'computed' rootsPaul Cristian Sarbu
Based on 76ce2123
2025-01-29just-lock: Normalize subdir before checking if non-upwardPaul Cristian Sarbu
2025-01-29just-lock: Improve error handling for importing to GitPaul Cristian Sarbu
2025-01-29just-lock: Ensure all commands use the run_cmd methodPaul Cristian Sarbu
2025-01-29just-lock config: Make field names consistent with just-mrPaul Cristian Sarbu
2025-01-20just-lock: Implement import source 'git-tree'Paul Cristian Sarbu
2025-01-17just-lock: Move import utilities code sectionPaul Cristian Sarbu
...below the GitCAS and CAS utilities, in order for those to be available for use when implementing the other import source types.
2025-01-17just-lock: Improve handling of 'subdir' pathsPaul Cristian Sarbu
Enforce 'subdir' field of 'archive' import source to also be non-upward. Normalize subdirs during rewrite of dependent 'file'-type repositories.
2025-01-16just-lock: Do not use temp dirs outside local build rootPaul Cristian Sarbu
2025-01-13import tools: Fix rewrite of unneeded fieldsPaul Cristian Sarbu
The rewrite logic assumes that for repositories taken as layers we will not have certain fields and so they are unconditionally reassigned. Fix this by extending the existing check for bindings to include also alternative roots and root files.
2025-01-10just-lock: Implement 'archive' import sourcePaul Cristian Sarbu
Use local CAS to cache fetched archives. Take the storage garbage collector shared lock to guard against unwanted generation rotations.
2025-01-10just-lock: Use the GitCAS during 'git' source importsPaul Cristian Sarbu
Add file locking logic; guard critical Git operations with the same approach as in Just and also take the repositories garbage collector shared lock to guard against unwanted generation rotations.
2025-01-10just-lock: Try also mirrors when importing known commit from Git reposPaul Cristian Sarbu
When commit to fetch is known, check mirrors before going to the main URL. While there, ensure the context for logging in the checkout method is not replaced, but appended to.
2025-01-10just-lock: Add attempts argument to method running commandsPaul Cristian Sarbu
2025-01-10just-lock: Improve docstrings and method signaturesPaul Cristian Sarbu
...to better reflect intent. In particular, improve the name of the variable storing the partial description to be used during rewrite of dependent 'file'-type repositories brought in by an import.
2025-01-10just-lock: Improve directory tree removalPaul Cristian Sarbu
2025-01-10just-lock: Fix 'repositories' field not updated in import loopPaul Cristian Sarbu
2024-12-17just-lock: Implement import source type 'file'Paul Cristian Sarbu