-
Notifications
You must be signed in to change notification settings - Fork 38
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
Decouple library from platformio and refactor code #9
Conversation
This is already in a pretty good shape. Let me test it a bit tmr and if no big issues, I'll probably merge it. Renaming the crate itself and the other changes can be separate PRs. |
Ok, I've tested it and it compiles but I've run into some different problems when actually running the code (my test project, and the
But other than that, it compiles and links fine so it should be ready to be merged.
I don't quite understand. Do you mean we should keep the package and library name as There's also the question if the |
As per our conversation in the channel, let's try to find out what really is causing this behavior. We might be uncovering an issue which was always there and so far worked only based on pure coincidence, or something has changed indeed.
Hopefully I've fixed that now. Will check in more detail tmr.
You mean, putting aside the pthread_rwlock_ errors?
(If that's possible.)
^^^ That's precisely the topic I was trying to not deal with as part of that first commit. |
I think that works. You can at least name the library differently than the package. So the dependency name would remain the same but in the code, we would refer to
This would also mean that the user would have to install both |
Rename package to `embuild`. Move binary entrypoints to `bin` folder. Rename `pio.rs` to `lib.rs` Seperate pio-specific code into the `pio` module. Move `cargo::build` into the `build` module. Add `build::LinkArgsBuilder`. Rename all constants with `CARGO_PIO_*` to `EMBUILD_*` Add `utils` and `python`. Rename `cargo::Cargo` to `CargoCmd`. Correct almost all clippy warnings.
Move cargo output functions into the `cargo` module. Move pio linker args manipulation from `LinkArgs` into `pio::project` (`impl TryFrom`).
Another question is if we shouldn't rename |
Rename `use_linkproxy` to `force_linkproxy`. Warn if the linker does not match what `embuild` expects. Don't force linkproxy for pio linker args.
OK so this one I figured out. TL;DR: It was working purely coincidentally, and has nothing to do with recent changes to rustc/cargo, and all to do with a change I did the other day to
Long explanation:
The drama comes from the fact that I'm (still) using the Now the reason why it did work before is because of this which I removed yesterday - which in turn was used in Anyway. Declaring a |
OK fine, let's bite the bullet. Could you - as part of this PR - create sub-crates for
It is a bit annoying though. And is here to stay, because of See why I was hesitant to have these things implemented immediately? Feature creep and the need to take decisions on stuff that we might be better prepared to address later (i.e. when Oh well. I guess if too inconvenient for users, we can always restore the |
I'm fine with that. Users will never have to invoke the |
I thought about it some more, and I think separating Finally, if it's really too much to install two crates then like you said, we could just add this bin to either |
OK. As I said - let's bite the bullet. :) |
(I can rename the repo myself once these changes land.) |
Yup, I'm on it right now. |
Move readme to `cargo-pio` Add readmes
Okay, I've created the sub-crates, moved the current README into the I also want to know what you think about renaming |
Remove `vec::` prefix
But.. no big deal! I'm fine with |
Yeah, that's too bad. But I think its better than Okay, so I think this should be good enough right now to be merged. |
First batch for #8.
LinkArgs
,CfgArgs
,CInclArgs
Sorry for spamming you with PRs. I'm creating this primarily that we can discuss things about the code, as well as to keep things more organized for me.
Note: This first commit does more than in my previous PR.