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

ci: Check various FreeBSD versions #4159

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

tgross35
Copy link
Contributor

Since we suport multiple versions and this is tier 2, we should make sure that we can build with a couple versions. This does not run tests.

This introduces an environment variable for an easy way to override the version for testing.

@rustbot
Copy link
Collaborator

rustbot commented Nov 27, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@bors
Copy link
Contributor

bors commented Nov 27, 2024

☔ The latest upstream changes (presumably #4157) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot rustbot added the O-unix label Nov 27, 2024
@tgross35 tgross35 force-pushed the freebsd-build-check branch from 5c96709 to bb493a3 Compare November 27, 2024 08:30
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Nov 27, 2024
@tgross35 tgross35 force-pushed the freebsd-build-check branch from bb493a3 to 9300c04 Compare November 27, 2024 08:33
@tgross35
Copy link
Contributor Author

tgross35 commented Nov 27, 2024

@asomers could you take a look at this? I don't think we should check all versions with all architectures on CI but we can at least check them all with the T1 i686 and x86_64.

The first commit adds the config, the second just runs edition fixes as a followup to #4132.

@tgross35 tgross35 mentioned this pull request Nov 27, 2024
3 tasks
Copy link
Contributor

@asomers asomers left a comment

Choose a reason for hiding this comment

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

This looks good to me. There are a few other FreeBSD arches too, but you got the most important ones.

ci/verify-build.sh Outdated Show resolved Hide resolved
}

freebsd_versions="\
11 \
12 \
Copy link
Contributor

Choose a reason for hiding this comment

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

This will test 12 twice, once at line 69-70 and once at 82-83.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have any idea how best to avoid this? It wouldn't be that bad if there isn't anything straightforward.

Copy link
Contributor

Choose a reason for hiding this comment

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

The default version of "12" is set in build.rs. So you can simply leave 12 off of the list. But then it would have to be manually updated in case the default ever changes. So if object files are retained between runs, then running cargo check twice should be fast enough, I think.

Copy link
Contributor Author

@tgross35 tgross35 Nov 27, 2024

Choose a reason for hiding this comment

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

That's about the same conclusion I came to, it should be fast enough that it's better to not worry about forgetting to update the default.

I updated to only test on the Tier2 architectures. Thanks for taking a look at this!

Since we suport multiple versions and this is tier 2, we should make
sure that we can build with a couple versions. This does not run tests.

Additionally, introduce an environment variable for an easy way to
override the version for testing.

This includes an unrelated cleanup adjustment in `verify-build.sh`
For versions 10, 11, 12, 13, 14, 15, and architectures aarch64, i686,
powerpc64, riscv64gc, and x86_64, I ran the following:

    RUST_LIBC_UNSTABLE_FREEBSD_VERSION=15 cargo fix \
        -Zbuild-std=core \
        --features extra_traits \
        --allow-dirty \
        --edition \
        --broken-code \
        --lib \
        --target aarch64-unknown-freebsd
@tgross35 tgross35 force-pushed the freebsd-build-check branch from 1e25591 to 9a942b3 Compare November 27, 2024 17:08
@tgross35 tgross35 marked this pull request as ready for review November 27, 2024 18:48
@tgross35 tgross35 added this pull request to the merge queue Nov 27, 2024
Merged via the queue into rust-lang:main with commit 8075133 Nov 27, 2024
45 checks passed
@tgross35 tgross35 deleted the freebsd-build-check branch November 27, 2024 19:14
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 28, 2024
Since we suport multiple versions and this is tier 2, we should make
sure that we can build with a couple versions. This does not run tests.

Additionally, introduce an environment variable for an easy way to
override the version for testing.

This includes an unrelated cleanup adjustment in `verify-build.sh`

(backport <rust-lang#4159>)
(cherry picked from commit 9c2f78e)
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 28, 2024
For versions 10, 11, 12, 13, 14, 15, and architectures aarch64, i686,
powerpc64, riscv64gc, and x86_64, I ran the following:

    RUST_LIBC_UNSTABLE_FREEBSD_VERSION=15 cargo fix \
        -Zbuild-std=core \
        --features extra_traits \
        --allow-dirty \
        --edition \
        --broken-code \
        --lib \
        --target aarch64-unknown-freebsd

(backport <rust-lang#4159>)
(cherry picked from commit 2e4ac8f)

Not an exact cherry pick, I just reran the command.
@tgross35 tgross35 mentioned this pull request Nov 28, 2024
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants