-
Notifications
You must be signed in to change notification settings - Fork 249
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
Build test components instead of relying on pre-built binaries #2163
Conversation
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.
LGTM. Thanks for doing this!
3dc6632
to
34fae68
Compare
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
34fae68
to
f3912c5
Compare
@@ -87,7 +87,7 @@ jobs: | |||
rust-cache: true | |||
|
|||
- name: Cargo Build | |||
run: cross build --target x86_64-unknown-linux-musl --workspace --release --all-targets --features openssl/vendored |
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.
@rajatjindal FYI: I have removed these flags since they are unnecessary for building a Spin executable. I noticed this when the build was failing due to the test-components
crate failing to build, but that crate does not need to be built to get a Spin executable.
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.
thank you for the heads up. these are also used in release workflow here https://github.com/fermyon/spin/blob/d41deb9eb33faeaa069d24a3922f26406c1cd2ca/.github/workflows/release.yml#L429C14-L429C20
you may want to remove those as well in that case
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
beb9161
to
b15fac9
Compare
Until now we've been relying on pre-built test component binaries for the runtime tests. This has the advantage of being very fast (the binaries are already built, and so there is no build phase at all). However, it also has the disadvantage of potentially getting out of sync with the source. This PR changes the test components to be built as a part of building Spin.
This is not without its drawbacks: for example, the test components are a part of the workspace meaning they will be built during
cargo build
. This does have the counter advantage though of making the test components part of rust-analyzer builds so that things like auto-complete work.Ultimately, I think this is the right way to go for now. In the future, we may want to reconsider whether we move these to a separate repository and pre-build the binaries with some check that those pre-built binaries do not get of sync with their source.