-
Notifications
You must be signed in to change notification settings - Fork 62
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
Phil/workspace deps #691
Phil/workspace deps #691
Conversation
358da29
to
5d0ffb8
Compare
Changes all Rust crates to use workspace inheritance for specifying dependencies. Also updates some dependencies in order to standardize on the same versions of all direct dependencies across all crates.
5d0ffb8
to
f0cd66b
Compare
The latest Rust is needed in order to use workspace inheritance. The Go version was just kinda old and didn't match the version in the other stage.
Update insta, and updates a failing test due to breaking serialization change. Issue for the serialization change: mitsuhiko/insta#290
a1f4425
to
9ce3057
Compare
Adds a `SKIP_BUILD` option to the Makefile for the `catalog-test` and `end-to-end-test` tasks, to allow re-building of binaries to be skipped during CI. Also install protoc during Mac builds.
9ce3057
to
865fe4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks, but overall looks good.
I ran this locally to make sure it would build for me, and it seems like it does. Previously I could run make package
and it would (re-)build everything I needed. Now, it seems that has changed, and to get an equivalent "rebuild everything if needed" I need to use make linux-binaries
. This seems fine (although the nomenclature leaves something to be desired when building on mac), but will take a little bit of adjustment.
Updates all Cargo.toml files to inherit most of their `package` properties from the workspace root. For the most part, this only changes metadata. But one notable change is that some crates were upgraded from rust edition 2018 to 2021. There were no observed compile or test failures as a result. Now all crates are using the 2021 edition, which is the most recent one.
@williamhbaker thanks for the review. I took care of all the leftover comments, which had all been resolved.
Yeah, you're correct that |
For the most part...the
It's not immediately clear to me why |
9059c45
to
e5f6a18
Compare
e5f6a18
to
7d59d4e
Compare
It doesn't need to be. It's basically just away to make it easy to install on a variety of linux systems. If you link against glibc, then the binary can only run on systems having a glibc version that's at least as new as the version it was built with. We kinda need to statically link some other dependencies, like That said, if there was a good alternative to linux app packaging, then it might be worth moving to at some point. It's a little unfortunate to have to build some things with musl and others with glibc, and it'd be nice if we could just build everything with one or the other. I'm leaving that for a future exercise, though. |
Description:
Changes our Rust dependency configuration to use Workspace Inheritance. This is a very new feature, so this PR also increases the minimum supported rust version to 1.64 (the most recent stable release). All dependencies are now declared in in the root
Cargo.toml
file. Individual workspace crates now simply reference the workspace dependency using, for example,serde_json = { workspace = true }
.My initial position on how we should use this feature is to declare all dependencies in the root
Cargo.toml
. The rationale being that we should default to always ensuring that a single version of each dependency is used across all the crates in our workspace. If this becomes untenable, then we can revisit it later.This also updates all dependencies to use explicit version requirements. There are no longer any
version = "*"
dependencies. Turns out that it's really a pain to use a crate having*
dependencies as a dependency in an external crate. For example, depending on a workspace crate from another repo. Explicit version requirements make this much more robust. The*
dependencies were also a barrier to us ever publishing crates to crates.io, so removing them seemed to move us in the right direction.Many dependencies were updated as part of this, but not all of them. Notable updates are:
proto-gazette
to work around this.serde_json::value::RawValue
s are serialized. IMO the new behavior is preferable, but it did require updating a bunch of snapshots. issue hereFinally, I also made a few updates to the build in an attempt to reduce build times, which had gotten out of hand after the incorporate of animated-carnival:
catalog-test
andend-to-end
test to skip re-building stuff, and to only rely on the binaries that were output from the first two build stages.cargo build
command with multiple-p
arguments instead of invokingcargo build
separately for each desired output.There's definitely lots more room for improvement with builds, but I don't want to spend a ton of time on build right now. Also, there seems to be a ton of variability of timing run-to-run in GH actions, so we may benefit from some additional time to characterize the build performance as it is.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)