Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust svdtools for CI #701

Merged
merged 1 commit into from Feb 13, 2022
Merged

Rust svdtools for CI #701

merged 1 commit into from Feb 13, 2022

Conversation

burrbull
Copy link
Contributor

No description provided.

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@burrbull
Copy link
Contributor Author

bors try

@bors
Copy link
Contributor

bors bot commented Feb 11, 2022

🔒 Permission denied

Existing reviewers: click here to make burrbull a reviewer

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@burrbull burrbull changed the title mmaps from svdtools Rust svdtools Feb 11, 2022
@burrbull burrbull marked this pull request as ready for review February 11, 2022 17:56
@github-actions
Copy link

Memory map comparison

@burrbull burrbull changed the title Rust svdtools Rust svdtools for CI Feb 11, 2022
@burrbull
Copy link
Contributor Author

@adamgreig Can't test mmaps as they action uses old version of ci.

on:
push:
branches: [ staging, trying, master ]
branches: [ staging, trying, master, bors/staging, bors/trying ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's bors/staging and bors/trying for? I think bors only pushes to plain staging and trying?

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, it will be good to get CI swapped over to the Rust tools.

I don't think the caching is doing what I want - the old caching actions were to cache the svd2rust binary (and could also cache the svdtools binary); I don't really care about caching the crate's own dependencies as they're extremely small and quick to build, while building svd2rust from source every time takes ages. I think the rust-cache action used here would not cache svd2rust and only cache things like bare-metal and cortex-m, which isn't as useful.

- name: Copy svd2rust to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
working-directory: ${{ matrix.crate }}
key: svdtools-${{ env.SVDTOOLS_VERSION }}-svd2tust-${{ env.SVD2RUST_VERSION }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
key: svdtools-${{ env.SVDTOOLS_VERSION }}-svd2tust-${{ env.SVD2RUST_VERSION }}
key: svdtools-${{ env.SVDTOOLS_VERSION }}-svd2rust-${{ env.SVD2RUST_VERSION }}

.github/workflows/ci.yaml Show resolved Hide resolved
@github-actions
Copy link

Memory map comparison

bors bot added a commit to rust-embedded/svd that referenced this pull request Feb 12, 2022
195: encode dimIndex ranges r=adamgreig a=burrbull

cc `@adamgreig` 
Partially related to stm32-rs/stm32-rs#701 (comment)

Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this is pretty close now but I have a couple of questions about the cache:

  • Right now cargo reinstalls svdtools, svd2rust, and form every time the job runs, because that step isn't disabled if the cache was present. We could add an if to that step that skips it if the cache was loaded, like it used to have, otherwise we have to recompile svd2rust every time. The rust-cache action has a cache-hit output that should work for this just like the old step.

  • Right now the nightlies job uses form, but uses the same cache key as the CI job, so if we did this it might load a cache that doesn't have form installed. Maybe it's better to have all the jobs install svdtools, svd2rust, and form, and then share a cache key, and only re-install when changed, so we have a single cache with all three tools in it. Or use a separate cache key for the nightlies job.

@burrbull
Copy link
Contributor Author

Thanks! I think this is pretty close now but I have a couple of questions about the cache:

* Right now cargo reinstalls svdtools, svd2rust, and form every time the job runs, because that step isn't disabled if the cache was present. We could add an `if` to that step that skips it if the cache was loaded, like it used to have, otherwise we have to recompile svd2rust every time. The rust-cache action has a `cache-hit` output that should work for this just like the old step.

* Right now the nightlies job uses form, but uses the same cache key as the CI job, so if we did this it might load a cache that doesn't have form installed. Maybe it's better to have all the jobs install svdtools, svd2rust, and form, and then share a cache key, and only re-install when changed, so we have a single cache with all three tools in it. Or use a separate cache key for the nightlies job.

On second question I doesn't have answer as I haven't test it.
Of first question. It rebuilds tools only when create new cache (when change cache name). Then:

 Downloading crates ...
  Downloaded svdtools v0.2.1
     Ignored package `svdtools v0.2.1` is already installed, use --force to override
 Downloading crates ...
  Downloaded svd2rust v0.21.0
     Ignored package `svd2rust v0.21.0` is already installed, use --force to override

@adamgreig
Copy link
Member

Ah, cool, that makes sense! Very neat.

I think this means the nightlies job will reinstall form every time instead of using the cached one, so maybe we should install form in the main CI job too so that it will be present in the cache. It adds a little time when the cache is rebuilt, but shouldn't be too bad normally. I don't think we need to put the form version in the key or anything.

@github-actions
Copy link

Memory map comparison

@adamgreig
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Feb 13, 2022
@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@burrbull
Copy link
Contributor Author

burrbull commented Feb 13, 2022

So. You are right. Now it rebuilds form each time.

Needs to clean cache somehow.

@bors
Copy link
Contributor

bors bot commented Feb 13, 2022

try

Build succeeded:

@adamgreig
Copy link
Member

Ah, that's annoying. Maybe just put "form-0.8.0" into the cache key after all, since that will trigger it to build it properly now?

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@adamgreig
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Feb 13, 2022
@bors
Copy link
Contributor

bors bot commented Feb 13, 2022

try

Build succeeded:

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

bors merge

@bors
Copy link
Contributor

bors bot commented Feb 13, 2022

Build succeeded:

@bors bors bot merged commit 28708f1 into stm32-rs:master Feb 13, 2022
@burrbull burrbull deleted the mmaps branch August 14, 2022 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants