Skip to content

Commit

Permalink
Merge branch 'just-buildsystem:master' into github-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
oreiche authored Dec 11, 2024
2 parents 4bde9a1 + c8634c7 commit 2421c36
Show file tree
Hide file tree
Showing 534 changed files with 13,233 additions and 4,316 deletions.
11 changes: 5 additions & 6 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ BreakBeforeBraces: Custom
ColumnLimit: 80
DerivePointerAlignment: false
IncludeCategories:
- Regex: '^(<|")(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdargh|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h'
Priority: 1
- Regex: '^(<|")(cstdlib|csignal|csetjmp|cstdarg|typeinfo|typeindex|type_traits|bitset|functional|utility|ctime|chrono|cstddef|initializer_list|tuple|any|optional|variant|new|memory|scoped_allocator|memory_resource|climits|cfloat|cstdint|cinttypes|limits|exception|stdexcept|cassert|system_error|cerrno|cctype|cwctype|cstring|cwchar|cuchar|string|string_view|array|vector|deque|list|forward_list|set|map|unordered_set|unordered_map|stack|queue|algorithm|execution|teratorslibrary|iterator|cmath|complex|valarray|random|numeric|ratio|cfenv|iosfwd|ios|istream|ostream|iostream|fstream|sstream|strstream|iomanip|streambuf|cstdio|locale|clocale|codecvt|regex|atomic|thread|mutex|shared_mutex|future|condition_variable|filesystem|ciso646|ccomplex|ctgmath|cstdalign|cstdbool)(>|")$'
Priority: 2
# The base style already correctly handles system includes
# C-style third-party includes
- Regex: '^<.*\.(h|hpp)>'
Priority: 3
Priority: 10
# General external and project includes
- Regex: '^".*"'
Priority: 4
Priority: 20
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
PenaltyBreakString: 100
Expand Down
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
## Release `1.4.0` (UNRELEASED)
## Release `1.5.0` (UNRELEASED)

A feature release on top of `1.4.0`, backwards compatible.

### Fixes

- Fixes ensuring proper pointer life time and access check.
- A race condition in the use of `libgit2` was fixed that could
result in a segmentation fault.
- Git operations are now properly locked against each other, also
between processes where necessary.
- `just install-cas` correctly exits with non-zero exit code on
failure, also if isntallation to stdout is requested.
- `just traverse` now exits unconditionally after traversal, also
in case of failure.
- Missing entries in the documentation have been added.

## Release `1.4.0` (2024-11-04)

A feature release on top of `1.3.0`, backwards compatible with
respect to rule language, build description, repository description,
Expand All @@ -8,6 +25,9 @@ local build root on upgrade.

### New features

- `just serve` now also works together with a compatible remote-execution
endpoint. This uses an extended version of the serve protocol, so
both, `just-mr` and `just serve` need to be at the new version.
- User-defined rules, as well as the built-in rule `"generic"` can
now specify a subdirectory in which an action is to be executed.
- `just-mr` now supports garbage collection for repository roots
Expand Down Expand Up @@ -75,6 +95,11 @@ local build root on upgrade.
file the user might have in their home directory
- Various improvements of the documentation.

## Release `1.4.0~beta1` (2024-10-30)

First beta release for the upcoming `1.4.0` release; see release
notes there.

## Release `1.3.0` (2024-05-08)

A feature release on top of `1.2.0`, backwards compatible.
Expand Down
19 changes: 11 additions & 8 deletions bin/bootstrap-traverser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import shutil
import subprocess
import sys
from typing import Any, Dict, List, Optional, cast
from typing import Any, Dict, List, NoReturn, cast

from argparse import ArgumentParser

Expand All @@ -32,7 +32,7 @@ def log(*args: str, **kwargs: Any) -> None:
print(*args, file=sys.stderr, **kwargs)


def fail(s: str) -> None:
def fail(s: str) -> NoReturn:
log(s)
sys.exit(1)

Expand Down Expand Up @@ -66,7 +66,7 @@ def link(src: str, dest: str) -> None:
os.symlink(src, dest)


def build_local(desc: Json, *, root: str, config: Json) -> Optional[str]:
def build_local(desc: Json, *, root: str, config: Json) -> str:
repo_name = desc["data"]["repository"]
repo: List[str] = config["repositories"][repo_name]["workspace_root"]
rel_path = desc["data"]["path"]
Expand All @@ -83,7 +83,7 @@ def build_tree(desc: Json, *, config: Json, root: str, graph: Json) -> str:
tree_dir_tmp = tree_dir + ".tmp"
tree_desc = graph["trees"][tree_id]
for location, desc in tree_desc.items():
link(cast(str, build(desc, config=config, root=root, graph=graph)),
link(build(desc, config=config, root=root, graph=graph),
os.path.join(tree_dir_tmp, location))
# correctly handle the empty tree
os.makedirs(tree_dir_tmp, exist_ok=True)
Expand All @@ -98,15 +98,18 @@ def run_action(action_id: str, *, config: Json, root: str, graph: Json) -> str:
os.makedirs(action_dir)
action_desc = graph["actions"][action_id]
for location, desc in action_desc.get("input", {}).items():
link(cast(str, build(desc, config=config, root=root, graph=graph)),
link(build(desc, config=config, root=root, graph=graph),
os.path.join(action_dir, location))
cmd = action_desc["command"]
env = action_desc.get("env")
log("Running %r with env %r for action %r" % (cmd, env, action_id))
for out in action_desc["output"]:
os.makedirs(os.path.join(action_dir, os.path.dirname(out)),
exist_ok=True)
subprocess.run(cmd, env=env, cwd=action_dir, check=True)
exec_dir = action_dir
if "cwd" in action_desc:
exec_dir = os.path.join(action_dir, action_desc["cwd"])
subprocess.run(cmd, env=env, cwd=exec_dir, check=True)
return action_dir


Expand All @@ -118,7 +121,7 @@ def build_action(desc: Json, *, config: Json, root: str, graph: Json) -> str:
return os.path.join(action_dir, desc["data"]["path"])


def build(desc: Json, *, config: Json, root: str, graph: Json) -> Optional[str]:
def build(desc: Json, *, config: Json, root: str, graph: Json) -> str:
if desc["type"] == "TREE":
return build_tree(desc, config=config, root=root, graph=graph)
if desc["type"] == "ACTION":
Expand All @@ -136,7 +139,7 @@ def traverse(*, graph: Json, to_build: Json, out: str, root: str,
os.makedirs(root, exist_ok=True)
create_blobs(graph["blobs"], root=root)
for location, artifact in to_build.items():
link(cast(str, build(artifact, config=config, root=root, graph=graph)),
link(build(artifact, config=config, root=root, graph=graph),
os.path.join(out, location))


Expand Down
2 changes: 2 additions & 0 deletions bin/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ def bootstrap() -> None:
dirs.remove('other_tools')
if 'archive' in dirs:
dirs.remove('archive')
if 'computed_roots' in dirs:
dirs.remove('computed_roots')
for f in files:
if f.endswith(".cpp"):
cpp_files.append(os.path.join(root, f))
Expand Down
Loading

0 comments on commit 2421c36

Please sign in to comment.