Skip to content

make arch-test fails unless ENABLE_ARCH_TEST is explicitly set #575

@vestata

Description

@vestata

I encountered an issue on an x86_64 machine(Ubuntu 24.04) when running make arch-test directly. The error output is as follows:

$ make arch-test 
  AR    build/softfloat/softfloat.a
  CC    build/map.o
  CC    build/utils.o
  CC    build/decode.o
  CC    build/io.o
  CC    build/syscall.o
  CC    build/emulate.o
  CC    build/riscv.o
  CC    build/log.o
  CC    build/elf.o
  CC    build/cache.o
  CC    build/mpool.o
  CC    build/syscall_sdl.o
  CC    build/main.o
  LD    build/rv32emu
Fetching SHA-1 of prebuilt binaries ... [OK]
Checking SHA-1 of prebuilt binaries ... [OK]
git submodule update --init tests/
cp: cannot stat 'build/rv32emu-prebuilt-sail-x86': No such file or directory
make: *** [mk/riscv-arch-test.mk:23: arch-test] Error 1

PR #547 introduced the ARCH_TEST feature.
In CI environment (.ci/riscv-tests.sh), this problem doesn't occur because ENABLE_ARCH_TEST is explicitly set to 1 before running make arch-test. However, the default ENABLE_ARCH_TEST is set to 0. As a result, if the repository is cloned or make distclean is executed and the rv32emu-prebuilt-sail-$(HOST_PLATFORM) file has not been downloaded previously, users who manually run make arch-test will encounter the error shown above.

When ENABLE_ARCH_TEST is set to 0, the condition for fetching rv32emu-prebuilt-sail-$(HOST_PLATFORM) is not met, and therefore the necessary file is not fetched.
The relevant snippet in mk/artifact.mk:

ifeq ($(call has, PREBUILT), 1)
    ifeq ($(call has, SYSTEM), 1)
        $(call fetch-releases-tag,Linux-Image,rv32emu-linux-image-prebuilt.tar.gz,Linux image)
    else ifeq ($(call has, ARCH_TEST), 1)
        $(call fetch-releases-tag,sail,rv32emu-prebuilt-sail-$(HOST_PLATFORM),Sail model)
    else
        $(call fetch-releases-tag,ELF,rv32emu-prebuilt.tar.gz,Prebuilt blob)
    endif

    PREBUILT_BLOB_URL = https://github.com/sysprog21/rv32emu-prebuilt/releases/download/$(LATEST_RELEASE)

Maybe we could:

  1. Update README.md to mention that users should set ENABLE_ARCH_TEST=1 when running make arch-test. For example:
make arch-test ENABLE_ARCH_TEST=1
  1. Modify Makefile to automatically set ENABLE_ARCH_TEST=1 when attempts to run make arch-test.

Related to #506

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions