Skip to content

Refactor #53

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

Merged
merged 48 commits into from
Sep 2, 2018
Merged

Refactor #53

merged 48 commits into from
Sep 2, 2018

Conversation

ryankurte
Copy link
Collaborator

Work In Progress PR for SVD refactor (#46) so that we get CI build/test going.

ryankurte and others added 24 commits March 7, 2018 21:00
Also added some TODOs and FIXMEs
Changed some `use` statements to be more sane
Many TODOs in code now
Output now looks like this

```text
In field `EN`
Bit range invalid, ParseError
invalid digit found in string
```

Next is to do the same with registers and peripherals, however, one
problem is that if the object doesn't have a name, we have to tell which
"index" it is at. This causes some problems in how to actually send this
info over.

I've added my test for checking the output to make it easier for people
that want to see the progress.
Output now looks like the following

```text
In peripheral `TIMER0`
In register `CR`
In field `EN`
Bit range invalid, ParseError
invalid digit found in string
```
Some things that are still not implemented

* enumeration on:
*   peripherals
*   cluster children
*   fields
* remove all "unsafe" unwraps
* Improve error messages by manually formatting `Display` on `SVDErrorKind`
* etc.

This commit also fixes a regression on enumerated values where an error
would go by silently
Still needs parse->ElementExt unification, some erro handling, and a fair bit of encoding work
Trying out merge extension for non-element objects
Also added unproven feature to encoding
@Emilgardis
Copy link
Member

There are some usages of SVDError::Other which should be made into proper enums, but I feel that is not very important.

@ryankurte ryankurte requested a review from japaric August 29, 2018 20:58
@ryankurte ryankurte changed the title [WIP] Refactor Refactor Aug 29, 2018
Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

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

Tests don't compile and I don't like the way we currently hide Encode behind unproven. I'm working on changing it

@ryankurte
Copy link
Collaborator Author

I wasn't sure whether to do it everywhere or just at the top level, this seems better.
Thanks / lgtm!

Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

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

LGTM!

@ryankurte ryankurte merged commit c4db1d2 into master Sep 2, 2018
@ryankurte ryankurte deleted the refactor branch September 2, 2018 07:59
@ryankurte
Copy link
Collaborator Author

Oh oops, should I have used bors to do this..? :-/

@japaric
Copy link
Member

japaric commented Sep 3, 2018

@ryankurte yes, because we don't run CI on PRs. But it's OK, if you haven't break the build.

@ryankurte
Copy link
Collaborator Author

It looks like we don't currently build master either?
screen shot 2018-09-03 at 3 32 00 pm

As an aside, is there a reason for not running CI automatically / all the time (even alongside bors)? IMO it's a useful indicator, and aligns with expectations of how github/travis works for people new to rust (myself definitely included).

@japaric
Copy link
Member

japaric commented Sep 3, 2018

It looks like we don't currently build master either?

Yep, because it's redundant with what bors tests before landing the PR.

is there a reason for not running CI automatically / all the time

I have way too many repos and CI capacity (about 5 parallel builds) is shared across all of them. In my case, having a build trigger everything time PR is open or updated severely bottlenecked landing PRs using bors so I disabled PR builds across the board long time ago (before that I had to manually kill some still under review PR builds to land approved PRs).

I have PR builds enabled on the rust-embedded repos (*) because the org has its own build capacity (also 5 parallel builds) and there aren't too many repos there.

(*) Except for Cross because the build time is longer than 1 hour and has many jobs. If it was enabled each build would block the bors queue for at least 1 hour.

@ryankurte
Copy link
Collaborator Author

I have way too many repos and CI capacity

Ahh, that's a very relatable problem ^_^

I have PR builds enabled on the rust-embedded repos

I appreciate the change on rust-embedded! Is the plan to move this over at some point or keep it here?

@Emilgardis Emilgardis mentioned this pull request Sep 4, 2018
7 tasks
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.

5 participants