Skip to content

Commit

Permalink
svdtools: install rust version
Browse files Browse the repository at this point in the history
This change removes a dependency on python/pip and is more consistent
with the installation of the other supporting tools.
  • Loading branch information
tones111 committed Jan 5, 2025
1 parent 07f32b8 commit 7a7ce07
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ jobs:
with:
toolchain: stable

# Python Dependencies
- name: Install Python dependencies
run: |
pip3 install --user setuptools wheel
pip3 install --user svdtools
- name: Put pip binary directory into path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

# Rust Dependencies
- name: Cache Cargo installed binaries
uses: actions/cache@v4
Expand All @@ -44,13 +36,17 @@ jobs:
- name: Install atdf2svd
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install atdf2svd --version 0.5.0 --locked
- name: Install svdtools
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install svdtools --version 0.3.21 --locked
- name: Copy tools to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
mkdir ~/cargo-bin
cp ~/.cargo/bin/svd2rust ~/cargo-bin
cp ~/.cargo/bin/form ~/cargo-bin
cp ~/.cargo/bin/atdf2svd ~/cargo-bin
cp ~/.cargo/bin/svdtools ~/cargo-bin
- name: Put new cargo binary directory into path
run: echo "$HOME/cargo-bin" >> $GITHUB_PATH

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ svd/%.svd: vendor/%.atdf
svd/%.svd.patched: svd/%.svd .deps/%.d patch/%.yaml
@if [ -f patch/$*.yaml ] ; then \
echo -e "\tPATCH\t\t$*"; \
svd patch patch/$*.yaml; \
svdtools patch patch/$*.yaml; \
test -e $@; \
else \
echo -e "\t - No patches found for $*"; \
Expand Down Expand Up @@ -75,6 +75,6 @@ patch/%.yaml: .deps/%.d
.deps/%.d: patch/%.yaml
@mkdir -p .deps
@echo -e "\tMAKEDEPS\t$*"
@svd makedeps $< $@
@svdtools makedeps $< $@

-include $(DEPS)
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,7 @@ cargo install atdf2svd --version 0.5.0 --locked
cargo install svd2rust --version 0.28.0 --locked
cargo install form
rustup component add --toolchain nightly rustfmt
pip3 install --user svdtools

# check svdtools
svd --version
# if a "command not found" error is printed instead of a version,
# either svdtools is installed incorrectly, or its installation path is missing from the PATH variable.
# Temporary solution to PATH variable issue is to manually add the path. Like so:
export PATH=$PATH:~/.local/bin
cargo install svdtools
```

[atdf2svd]: https://github.com/Rahix/atdf2svd
Expand Down
2 changes: 1 addition & 1 deletion gen-intr-lut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for intr_path in "$@"; do
chip="$(basename "${intr_path%.svd.patched}")"
echo " \"$chip\" => match intr {"
# toupper() to be compliant with svd2rust interrupts name
svd interrupts --no-gaps $intr_path | awk '{print " \""toupper(substr($2, 1, length($2)-1))"\"" " => Some(" $1"),"}'
svdtools interrupts --no-gaps $intr_path | awk '{print " \""toupper(substr($2, 1, length($2)-1))"\"" " => Some(" $1"),"}'
echo " _ => None,"
echo " },"
done
Expand Down

0 comments on commit 7a7ce07

Please sign in to comment.