-
Notifications
You must be signed in to change notification settings - Fork 7
Panic with glob use #40
Comments
I can see how globs can make things complicated. Maybe add logging support and just warn the user that its not being handled, until support can be implemented? |
Hi! Thanks for opening an issue That being said, you are completely right by saying that we should not panic on glob imports. As you suggested, logging something is IMO the most appropriate solution for now. We'll also need to update the readme to clarify the ongoing rewrite situation. Thanks! |
While I'm not as closely tied into what problems you have run into, I find that unfortunate. One of the appealing aspects of |
To be clear, the TLDR: in order to get macro expansion to work, we're parsing the output of
Yes. I agree with you. I don't like forcing people to use nightly either. This really is not optimal for people who want to use cargo-breaking as a library, but i see no other stable option which allow us to be correct and to not have to reimplement everything on our own (well, actually we could use Something that i'd like to experiment with is using the rustdoc json output to generate the diagnostics. I already have some pet projects and a couple of blogposts to write about it, and i'm confident that this would make cargo-breaking development easier. The problem is that this is nightly-only too (because |
For myself, I find delegating to a nightly toolchain (with a generally wide gamut of support) much more palatable than only running with a specific nightly. I am also willing to accept some level of loss of completeness rather than build against a specific nightly toolchain. I recognize different people might weigh things out differently, depending on their circumstances. That said, |
I agree. After thinking about it more, i think this is still not completely safe: the output of That being said, i do think that the output of The only loss of information i can think of is the exact size of a given type. In my opinion that's not a big deal, since size can be platform-dependant, and is not stable across compilations (see the doc of The "rustdoc approach" would be really awesome. It deserves a POC before i start re-re-implementing everything again. I currently don't time for this. I will give it a try in January. |
Once I get my clap3 rc0 out next week (was hoping I might start it as a separate crate and see about merging so I can iterate with CI and Issues :). |
I think this is a key part. Similarly, the "cargo expand" output is unstable ... but its fairly stable. I imagine rustdoc fits between "cargo expand" and rustc-backend in terms of stability while keeping the level of work relatively low compared to "cargo expand", being a worthwhile trade off. |
You can checkout my prototype, cargo-api. Example commands
So far, it can extract APIs into a hopefully workable data model but no diffing is implemented yet. Interesting flags
Interesting implementation details
rustdoc limitations:
|
Hi @epage I have discussed with my employer about the future of We don't want our tool to compete with yours. It would be a waste of time. So instead of continuing cargo-breaking maintenance, we decided that I should contribute to cargo-api instead, if that's good to you :) If you don't plan to maintain cargo-api, that's fine. I'll rewrite cargo-breaking instead. What we really do not want to happen is two tools using similar approach to do the same thing competing with each other. |
That sounds great! I agree about collaborating and not duplicating efforts. My intention with I think the only questions are:
Somehow visibility on it got raised, so I have heard from one or two other parties interested in the concept. I'm hoping they'll contribute rather than say "eh, someone else started the project I was going to do, I'll let them take care of it all". |
Let address each point separately:
Something we could do is trying to find what's common between our two projects. From my understanding, we both focus on what API item has changed between now and a given git revision (or tag, whatever) in a project. We could collaborate to write a generic library (with a generic-enough name) which addresses this. Once we get a prototype, we could build tools which use this library. For instance, i could use it in order to guess the next crate version, or someone else could automatically generate changelogs (looking at you cargo-release 👀). The name cargo-breaking does not feel right for an API change detection library, but (IMO) it feels right for breaking change detection and appropriate versioning.
We could build the change detection library anywhere. Both me and my colleague have no requirement over this. The crate-ci org would be a good idea since it is central and neutral, just as the library needs to be.
Once again, we could go with MIT/Apache (which is fairly common afaik) for the "central" library and let everyone use the license they want for their final binary crate. The only reason why we use MPL is because when we started working on cargo-breaking, we wanted to avoid problems where big orgs start selling services built with our code. Our business plan has shifted since this, and we don't care anymore these days. I think this partially addresses this comment. |
If you want to focus collaboration on the btw I'd recommend checking out |
Just read about https://github.com/rust-lang/rust-semverver which may or may not come in handy |
I recently started https://crates.io/crates/cargo-semver-checks which is rustdoc-based and may also be of interest. From my chat with @epage the other day, it sounded like its query-based checking model offers some advantages over alternative options, and he'd be interested (time permitting) to help with CLI usability & ease of adoption improvements in TL;DR of the query-based approach: every semver check is implemented as a strongly-typed declarative query. The query language is a GraphQL derivative, using GraphQL syntax but with semantics that allow better expressiveness and performance, and is provided by a project called Trustfall. This lowers the cost of writing and maintaining checks, which in turn has at least two positives:
It's still early days for |
Hey, I've been following the cargo-semver-checks updates very closely and it's a really interesting approach! I'll have to dig much deeper to understand how trustfall works, but I totally agree our limited time and efforts could be used to focus on one crate. Let's see what @scrabsha and @zdimension think, But IIRC @zdimension had a look previously and thought the way you folks tackled this is brilliant, so I'd be surprised if they weren't willing to focus on cargo-semver-checks as well :) |
Trying to figure out why its not working with clap (syn parse error), I'm trying out various projects of mine and got a panic with
toml_edit
The text was updated successfully, but these errors were encountered: