Skip to content
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

define MSRV and check for it in CI #1098

Merged
merged 4 commits into from
Oct 15, 2024
Merged

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Oct 14, 2024

Define 1.76 as our MSRV currently and add a new container image that we use in CI to test that.

Copy link
Contributor

openshift-ci bot commented Oct 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Luap99
Copy link
Member Author

Luap99 commented Oct 14, 2024

@mheon @baude PTAL

@@ -22,6 +22,12 @@ Netavark is a tool for configuring networking for Linux containers. Its features
- [Podman](https://podman.io/docs) 4.0+
- [protoc](https://grpc.io/docs/protoc-installation/)

## MSRV (Minimum Supported Rust Version)

Copy link
Member

Choose a reason for hiding this comment

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

Add a sentence here: "Netavark is guaranteed to build on this Rust version and later." or similar

Copy link
Member Author

Choose a reason for hiding this comment

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

Given rust weird stance on backwards compatibility I find guaranteed to be a very strong word, i.e. it is not so recent that I think rust 1.80 failed to compile older version of the time crate
rust-lang/rust#127343 (comment)

i.e. it is impossible to build aardvark-dns 1.10.0 with rust v1.80 or newer. To their credit they provide a helpful error but still

error[E0282]: type annotations needed for `Box<_>`
  --> /home/pholzing/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.30/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo update`

And given we to not test all rust versions there might be some weird stuff in between so I think I rather s/guaranteed/supposed in your sentence

Copy link
Member

Choose a reason for hiding this comment

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

"We test that Netavark will build on the following Rust version. Newer versions should also build, and if they do not, the issue should be reported and will be fixed. Older versions are not guaranteed to build and issues will not be fixed"?

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good

DOCKERFILE="$(dirname "${BASH_SOURCE[0]}")/Dockerfile.Rust"

# get the tag from the Dockerfile so we do not duplicate it
TAG=$(awk -F':' '/FROM/{print $NF}' $DOCKERFILE)
Copy link
Member

Choose a reason for hiding this comment

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

What would you think of if [[ -z "$TAG" ]]; then echo "FOO! empty tag"; exit 1; fi or equivalent?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes sure

Define the MSRV as 1.76 and document it the README.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Add a new image based of the offical rust image so we can expliclty
check for the MSRV and not depend on distro version where we never
really know what version we are getting.

We cannot use the offical image directly as we need protobuf to be
installed so create a new Dockerfile and add a script to push it to
quay.io/libpod.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Ensure we can build our MSRV and delete the old ubuntu/centos task
instead that was often way to outdated.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
We no longer test these here so remove them to avoid any confusion.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@mheon
Copy link
Member

mheon commented Oct 14, 2024

LGTM

@baude
Copy link
Member

baude commented Oct 15, 2024

this is awesome

@baude
Copy link
Member

baude commented Oct 15, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 15, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit d02a620 into containers:main Oct 15, 2024
30 checks passed
@Luap99 Luap99 deleted the msrv branch October 15, 2024 14:21
Luap99 added a commit to Luap99/aardvark-dns that referenced this pull request Oct 15, 2024
Like done in netavark,
containers/netavark#1098.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@edsantiago
Copy link
Member

...and you even remembered to update the descriptions on quay, for this and the other two images. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants