目录
xu_zh

feat(nix): add nix devshell support (#60)

Basically, just do whatever setup-tools.sh does, using nix.

We can run nix develop to enter devshells.

Also, we can use nix-direnv and run direnv allow . to let direnv auto management.

I’ll add docs to XiangShan-doc if needed.

Showcase using direnv:

$ direnv allow workspace/xs-env # this will be needed only the first time

$ cd workspace/xs-env/XiangShan # direnv will build & activate devshell each time you enter xs-env and subdirectories
direnv: loading ~/workspace/xs-env/.envrc
direnv: using flake
=== Welcome to XiangShan devshell! ===
Version info:
- Verilator 5.028 2024-08-21 rev v5.028
- Mill Build Tool version 0.12.3
- gcc (GCC) 14.2.1 20250322
- riscv64-unknown-linux-gnu-gcc (GCC) 14.2.1 20250322
- openjdk version "21.0.7" 2025-04-15
You can press Ctrl + D to exit devshell.
direnv: export +AR +AS +CC +CLASSPATH +CONFIG_SHELL +CXX +DETERMINISTIC_BUILD +HOST_PATH +IN_NIX_SHELL +JAVA_HOME +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_riscv64_unknown_linux_gnu +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_riscv64_unknown_linux_gnu +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS +NIX_STORE +NM +OBJCOPY +OBJDUMP +PYTHONHASHSEED +PYTHONNOUSERSITE +PYTHONPATH +RANLIB +READELF +SDL2_PATH +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +TEMP +TEMPDIR +TMP +TMPDIR +_PYTHON_HOST_PLATFORM +_PYTHON_SYSCONFIGDATA_NAME +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

$
2个月前103次提交
目录README.md

XiangShan Frontend Develop Environment

CI

TLDR

使用以下脚本来布署香山开发环境,**部署脚本只需运行一次.**:

This script will setup XiangShan develop environment automatically. Note that ./setup-tools.sh and setup.sh only need to be run ONCE.

git clone https://github.com/OpenXiangShan/xs-env
cd xs-env
sudo -s ./setup-tools.sh # use apt to install dependencies, you may modify it to use different pkg manager
source setup.sh # prepare tools, test develop env using a small project

由于香山 master 分支更新频繁,此仓库中的 submodule 默认追踪香山主线分支上的一个稳定提交,并不是香山及其他工具的最新版本。要更新各子仓库到最新版本,可以运行:

Due to the frequent updates of the Xiangshan master branch, the submodule in this repo tracks a stable commit on the Xiangshan master branch by default, not the latest version of Xiangshan and the other tools. To update each submodule to the latest version, run:

source update-submodule.sh

环境部署成功后,每次要使用开发环境时,只需使用以下命令配置环境变量

After XiangShan Develop Environment setup, use the following script every time before using XiangShan Develop Environment.

cd xs-env
source ./env.sh # setup XiangShan environment variables

Document

详细使用方式请参考完整文档:

For further instructions, see:

XiangShan Frontend Develop Environment Document

关于
184.7 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号