Skip to content

Commit a5655b3

Browse files
author
Felix "xq" Queißner
committed
Removes additional fetching from git
1 parent 20012c1 commit a5655b3

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
with:
2121
fetch-tags: true # required for "git describe"
2222

23-
- name: Fetch more data from git
24-
run: |
25-
# fetch everything back till the $(ZIG_VERSION) tag.
26-
# https://stackoverflow.com/a/58082274
27-
git fetch --shallow-exclude ${{ env.ZIG_VERSION }}
28-
git fetch --deepen=2
23+
# - name: Fetch more data from git
24+
# run: |
25+
# # fetch everything back till the $(ZIG_VERSION) tag.
26+
# # https://stackoverflow.com/a/58082274
27+
# git fetch --shallow-exclude ${{ env.ZIG_VERSION }}
28+
# git fetch --deepen=2
2929

3030
- name: Setup Zig
3131
uses: goto-bus-stop/setup-zig@v2
@@ -54,12 +54,12 @@ jobs:
5454
with:
5555
fetch-tags: true # required for "git describe"
5656

57-
- name: Fetch more data from git
58-
run: |
59-
# fetch everything back till the $(ZIG_VERSION) tag.
60-
# https://stackoverflow.com/a/58082274
61-
git fetch --shallow-exclude ${{ env.ZIG_VERSION }}
62-
git fetch --deepen=2
57+
# - name: Fetch more data from git
58+
# run: |
59+
# # fetch everything back till the $(ZIG_VERSION) tag.
60+
# # https://stackoverflow.com/a/58082274
61+
# git fetch --shallow-exclude ${{ env.ZIG_VERSION }}
62+
# git fetch --deepen=2
6363

6464
- name: Setup Zig
6565
uses: goto-bus-stop/setup-zig@v2

tools/bundle.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,12 @@ def build_zig_tools():
168168
# Determines the correct version:
169169
def get_version_from_git() -> str:
170170

171-
raw_git_out = slurp("git", "describe", "--match", "*.*.*", "--tags", "--abbrev=9", cwd=REPO_ROOT).strip().decode()
171+
raw_git_out = slurp("git", "describe", "--match", "*.*.*", "--tags", "--abbrev=9", cwd=REPO_ROOT, allow_failure=True)
172+
if raw_git_out is not None:
173+
raw_git_out = raw_git_out.strip().decode()
174+
else:
175+
print("failed to get version from git, using 'development'", file=sys.stderr)
176+
return "development"
172177

173178
def render_version(major,minor,patch,counter,hash):
174179
return f"{major}.{minor}.{patch}-{counter}-{hash}"

tools/lib/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
VERBOSE = False
55

6-
def execute_raw(*args,hide_stderr = False,**kwargs):
6+
def execute_raw(*args,hide_stderr: bool = False, allow_failure: bool = False **kwargs):
77
args = [ str(f) for f in args]
88
if VERBOSE:
99
print(*args)
1010
res = subprocess.run(args, **kwargs, check=False)
1111
if res.stderr is not None and (not hide_stderr or res.returncode != 0):
1212
sys.stderr.buffer.write(res.stderr)
13-
if res.returncode != 0:
13+
if not allow_failure and res.returncode != 0:
1414
sys.stderr.write(f"command {' '.join(args)} failed with exit code {res.returncode}")
1515
sys.exit(res.returncode)
1616
return res

0 commit comments

Comments
 (0)