@@ -43,25 +43,30 @@ define fetch-releases-tag
4343 $(if $(wildcard $(BIN_DIR ) /$(2 ) ) , \
4444 $(info $(call warnx, $(3 ) is found. Skipping downloading.) ) , \
4545 $(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/') ) \
5050 $(if $(LATEST_RELEASE ) ,, \
5151 $(error Fetching tag of latest releases failed) \
5252 ) \
5353 )
5454endef
5555
56+ LATEST_RELEASE ?=
57+
5658ifeq ($(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
6369 endif
64-
6570 PREBUILT_BLOB_URL = https://github.com/sysprog21/rv32emu-prebuilt/releases/download/$(LATEST_RELEASE )
6671else
6772 # Since rv32emu only supports the dynamic binary translation of integer instruction in tiered compilation currently,
0 commit comments