Skip to content

Commit eee70da

Browse files
committed
add the ability to include a revision
1 parent 0161131 commit eee70da

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ alaska_option(ALASKA_SIZE_BITS 32)
4343
alaska_option(CMAKE_BUILD_TYPE Release)
4444
alaska_option_nodef(ALASKA_ENABLE_COMPONENTS "compiler;compiler-rts")
4545

46+
47+
alaska_option(ALASKA_REVISION unknown)
48+
4649
set(ALASKA_VERSION 2)
4750

4851

runtime/core/Runtime.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ namespace alaska {
6060

6161

6262
void Runtime::dump(FILE *stream) {
63+
#define xstr(s) str(s)
64+
#define str(s) #s
65+
fprintf(stream, "Revision: " xstr(ALASKA_REVISION) "\n");
66+
#undef xstr
67+
#undef str
68+
6369
for (auto *tc: this->tcs) {
6470
fprintf(stream, "tc%d allocations:%zu, rate:%.1f/s", tc->id, tc->allocation_rate.read(), tc->allocation_rate.digest());
6571

tools/build_yukon.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ export LD=$ROOT/bin/riscv64-unknown-linux-gnu-ld
1111

1212
make clean
1313

14-
ls $ROOT/sysroot
14+
REV="$(whoami)-$(git rev-parse --short HEAD)"
15+
if [[ $(git diff --stat) != '' ]]; then
16+
REV="${REV}-dirty"
17+
fi
18+
1519

1620
cmake ../ \
21+
-DALASKA_REVISION="${REV}" \
1722
-DALASKA_ENABLE_COMPILER=OFF \
1823
-DALASKA_ENABLE_TESTING=OFF \
1924
-DALASKA_CORE_ONLY=ON \

0 commit comments

Comments
 (0)