@@ -43,25 +43,30 @@ define fetch-releases-tag
43
43
$(if $(wildcard $(BIN_DIR ) /$(2 ) ) , \
44
44
$(info $(call warnx, $(3 ) is found. Skipping downloading.) ) , \
45
45
$(eval LATEST_RELEASE := $(shell wget -q https://api.github.com/repos/sysprog21/rv32emu-prebuilt/releases -O- \
46
- | grep '"tag_name"' \
47
- | grep "$(1 ) " \
48
- | head -n 1 \
49
- | sed -E 's/.* "tag_name": "([^"]+) ".* /\1/') ) \
46
+ | grep '"tag_name"' \
47
+ | grep "$(1 ) " \
48
+ | head -n 1 \
49
+ | sed -E 's/.* "tag_name": "([^"]+) ".* /\1/') ) \
50
50
$(if $(LATEST_RELEASE ) ,, \
51
51
$(error Fetching tag of latest releases failed) \
52
52
) \
53
53
)
54
54
endef
55
55
56
+ LATEST_RELEASE ?=
57
+
56
58
ifeq ($(call has, PREBUILT) , 1)
57
- ifeq ($(call has, SYSTEM), 1)
58
- $(call fetch-releases-tag,Linux-Image,rv32emu-linux-image-prebuilt.tar.gz,Linux image)
59
- else ifeq ($(call has, ARCH_TEST), 1)
60
- $(call fetch-releases-tag,sail,rv32emu-prebuilt-sail-$(HOST_PLATFORM),Sail model)
61
- else
62
- $(call fetch-releases-tag,ELF,rv32emu-prebuilt.tar.gz,Prebuilt blob)
59
+ # On macOS/arm64 Github runner, let's leverage the ${{ secrets.GITHUB_TOKEN }} to prevent 403 rate limit error.
60
+ # Thus, the LATEST_RELEASE tag is defined at Github job steps, no need to fetch them here.
61
+ ifeq ($(LATEST_RELEASE),)
62
+ ifeq ($(call has, SYSTEM), 1)
63
+ $(call fetch-releases-tag,Linux-Image,rv32emu-linux-image-prebuilt.tar.gz,Linux image)
64
+ else ifeq ($(call has, ARCH_TEST), 1)
65
+ $(call fetch-releases-tag,sail,rv32emu-prebuilt-sail-$(HOST_PLATFORM),Sail model)
66
+ else
67
+ $(call fetch-releases-tag,ELF,rv32emu-prebuilt.tar.gz,Prebuilt benchmark)
68
+ endif
63
69
endif
64
-
65
70
PREBUILT_BLOB_URL = https://github.com/sysprog21/rv32emu-prebuilt/releases/download/$(LATEST_RELEASE )
66
71
else
67
72
# Since rv32emu only supports the dynamic binary translation of integer instruction in tiered compilation currently,
0 commit comments