Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Initialize binutils submodule
run: |
git submodule init ext/binutils-gdb/binutils # initialize only this submodule
git submodule update ext/binutils-gdb/binutils # update it
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
[submodule "ext/riscv-isa-manual"]
path = ext/riscv-isa-manual
url = https://github.com/riscv/riscv-isa-manual
[submodule "ext/binutils-gdb/binutils"]
path = ext/binutils-gdb/binutils
url = https://github.com/bminor/binutils-gdb.git
branch = master
12 changes: 11 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "etc"

require "open3"
$root = Pathname.new(__FILE__).dirname.realpath
$lib = $root / "lib"

Expand Down Expand Up @@ -274,6 +274,15 @@ namespace :gen do
end
end

desc <<~DESC
Check all encodings against binutils

Part of the regression test.
DESC
task :encoding_validate do
sh ".home/.venv/bin/python ext/binutils-gdb/encoding.py"
end

desc <<~DESC
Run the regression tests

Expand All @@ -283,6 +292,7 @@ task :regress do
Rake::Task["idl_test"].invoke
Rake::Task["lib_test"].invoke
Rake::Task["validate"].invoke
Rake::Task["encoding_validate"].invoke
ENV["MANUAL_NAME"] = "isa"
ENV["VERSIONS"] = "all"
Rake::Task["gen:html_manual"].invoke
Expand Down
14 changes: 14 additions & 0 deletions bin/python
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

ROOT=$(dirname $(dirname $(realpath $BASH_SOURCE[0])))
CONTAINER_TAG=$(cat ${ROOT}/bin/.container-tag)
CONTAINER_PATH=${ROOT}/.singularity/image-${CONTAINER_TAG}.sif
HOME_OPT="--bind ${ROOT}/.home:${HOME}"

# Create virtual environment using absolute path
echo "Creating virtual environment..."
singularity exec ${HOME_OPT} ${CONTAINER_PATH} /usr/bin/python3 -m venv ${ROOT}/.home/.venv

# Install packages
echo "Installing packages..."
singularity exec ${HOME_OPT} ${CONTAINER_PATH} bash -c "source ${ROOT}/.home/.venv/bin/activate && pip install pyyaml"
7 changes: 7 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,16 @@ if [ ! -d ${ROOT}/node_modules ]; then
singularity run ${HOME_OPT} ${CONTAINER_PATH} npm i
fi

if [ ! -d ${ROOT}/.home/.venv ]; then
singularity run ${HOME_OPT} ${CONTAINER_PATH} python3 -m venv ${ROOT}/.home/.venv
singularity run ${HOME_OPT} ${CONTAINER_PATH} bash -c "source ${ROOT}/.home/.venv/bin/activate && pip install pyyaml"
fi

BUNDLE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle"
RUBY="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec ruby"
RAKE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec rake"
NPM="singularity run ${HOME_OPT} ${CONTAINER_PATH} npm"
NPX="singularity run ${HOME_OPT} ${CONTAINER_PATH} npx"
NODE="singularity run ${HOME_OPT} ${CONTAINER_PATH} node"
PYTHON="singularity run ${HOME_OPT} ${CONTAINER_PATH} bash -c 'source ${ROOT}/.home/.venv/bin/activate && python'"

1 change: 1 addition & 0 deletions ext/binutils-gdb/binutils
Submodule binutils added at 2e7d43
Loading
Loading