Skip to content

Commit

Permalink
Merge pull request #20 from oreiche/stable-1.4
Browse files Browse the repository at this point in the history
Stable 1.4
  • Loading branch information
oreiche authored Feb 13, 2025
2 parents 6078188 + dfbfdc2 commit 7066706
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 8 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## Release `1.4.3` (2025-02-05)

Bug fixes on top of `1.4.2`.

### Fixes

- `just-mr` repository garbage collection now properly removes
no longer needed directories.
- The "generic" rule now properly detects staging conflicts.
- The local api correctly handles not-found blobs, even in the absence
of a local git api.
- Documentation fixes.

## Release `1.4.2` (2025-01-13)

Bug fixes on top of `1.4.1`.
Expand Down
10 changes: 6 additions & 4 deletions doc/concepts/built-in-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ choice.

The `"deps"` argument is evaluated and has to evaluate to a list of
target names. The runfiles and artifacts of these targets form the
inputs of the action. Conflicts are not an error and resolved by giving
precedence to the artifacts over the runfiles; conflicts within
artifacts or runfiles are resolved in a latest-wins fashion using the
order of the targets in the evaluated `"deps"` argument.
inputs of the action. Conflicting definitions for individual paths
are not an error and resolved by giving precedence to the artifacts
over the runfiles; conflicts within artifacts or runfiles are
resolved in a latest-wins fashion using the order of the targets in
the evaluated `"deps"` argument. However, the input stage obtained
by those resolution rules has to be free of semantic conflicts.

The fields `"cmds"`, `"cwd"`, `"sh -c"`, `"out_dirs"`, `"outs"`, and `"env"`
are evaluated fields where `"cmds"`, `"out_dirs"`, and `"outs"`
Expand Down
9 changes: 9 additions & 0 deletions share/man/just-mr.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SYNOPSIS
**`just-mr`** \[*`OPTION`*\]... {**`setup`**|**`setup-env`**} \[**`--all`**\] \[*`main-repo`*\]
**`just-mr`** \[*`OPTION`*\]... **`fetch`** \[**`--all`**\] \[**`--backup-to-remote`**] \[**`-o`** *`fetch-dir`*\] \[*`main-repo`*\]
**`just-mr`** \[*`OPTION`*\]... **`update`** \[*`repo`*\]...
**`just-mr`** \[*`OPTION`*\]... **`gc-repo`**
**`just-mr`** \[*`OPTION`*\]... **`do`** \[*`JUST_ARG`*\]...
**`just-mr`** \[*`OPTION`*\]... {**`version`**|**`describe`**|**`analyse`**|**`build`**|**`install`**|**`install-cas`**|**`add-to-cas`**|**`rebuild`**|**`gc`**} \[*`JUST_ARG`*\]...

Expand Down Expand Up @@ -289,6 +290,14 @@ remote repository in the specified branch. The output configuration file
will otherwise remain the same at the JSON level with the input
configuration file.

gc-repo
-------

This subcommand rotates the generations of the repository cache.
Every root used is added to the youngest generation. Therefore upon
a call to **`gc-repo`** all roots are cleaned up that were not used
since the last **`gc-repo`**.

do
--

Expand Down
9 changes: 9 additions & 0 deletions src/buildtool/build_engine/target_map/built_in_rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1351,9 +1351,18 @@ void GenericRuleWithDeps(
for (auto const& dep : dependency_values) {
inputs = ExpressionPtr{Expression::map_t{inputs, (*dep)->RunFiles()}};
}
auto inputs_conflict = BuildMaps::Target::Utils::tree_conflict(inputs);
for (auto const& dep : dependency_values) {
inputs = ExpressionPtr{Expression::map_t{inputs, (*dep)->Artifacts()}};
}
// While syntactical conflicts are resolved in a latest wins (with artifacts
// after runfiles), semantic path conclicts are an error.
if (inputs_conflict) {
(*logger)(fmt::format("Input artifacts have staging conflict on {}",
nlohmann::json(*inputs_conflict).dump()),
/*fatal=*/true);
return;
}
std::vector<Tree::Ptr> trees{};
inputs = BuildMaps::Target::Utils::add_dir_for(
cwd_value->String(), inputs, &trees);
Expand Down
2 changes: 1 addition & 1 deletion src/buildtool/execution_api/local/local_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class LocalApi final : public IExecutionApi {
},
[&git_api = git_api_, &raw_tree](Artifact::ObjectInfo const& info,
int fd) {
return not git_api or
return git_api and git_api->IsAvailable(info.digest) and
git_api->RetrieveToFds({info}, {fd}, raw_tree);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/buildtool/main/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
auto version() -> std::string {
std::size_t major = 1;
std::size_t minor = 4;
std::size_t revision = 2;
std::size_t revision = 3;
std::string suffix = std::string{};
#ifdef VERSION_EXTRA_SUFFIX
suffix += VERSION_EXTRA_SUFFIX;
Expand Down
6 changes: 4 additions & 2 deletions src/buildtool/storage/repository_garbage_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ auto RepositoryGarbageCollector::TriggerGarbageCollection(
return false;
}
if (FileSystemManager::IsDirectory(remove_me)) {
if (not FileSystemManager::RemoveDirectory(remove_me)) {
if (not FileSystemManager::RemoveDirectory(remove_me,
/*recursively=*/true)) {
Logger::Log(LogLevel::Error,
"Failed to remove directory {}",
remove_me.string());
Expand Down Expand Up @@ -107,7 +108,8 @@ auto RepositoryGarbageCollector::TriggerGarbageCollection(
return false;
}
if (FileSystemManager::IsDirectory(remove_me)) {
if (not FileSystemManager::RemoveDirectory(remove_me)) {
if (not FileSystemManager::RemoveDirectory(remove_me,
/*recursively=*/true)) {
Logger::Log(LogLevel::Error,
"Failed to remove directory {}",
remove_me.string());
Expand Down

0 comments on commit 7066706

Please sign in to comment.