-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Merge the ctest2
repository into libc
#4283
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
Conversation
allow deprecated declarations on non-msvc targets
Without this, the entries added in rust-lang#960 are never tested.
Add target_endian to the set of #[cfg()] items that are considered.
Add support for unions without typedefs
improve docs of cfg method
Being able to call `const fn` on stable is a relatively new addition. CC rust-lang#1075
Revert bump in the minimum supported Rust version
Minimal support for fn types in extern statics
Add support for arrays in extern statics
update libc test
Skip signedness checks for type aliases of non-integer types
Add support for alternative network stack io-sock on QNX 7.1
fix: Declare explicit "C" ABI on `extern` blocks/fns
chore: Release v0.4.10
chore: Configure Renovate
@tgross35: no appropriate reviewer found, use |
@JohnTitor would you be okay with libc absorbing ctest2, or do you have any concerns? You can continue to maintain it here if you wish of course. |
Also, does anyone know of a better way to merge unrelated histories? The blame works fine but the log appears empty. |
I think I've done something like this in the past using |
r? @JohnTitor I of course don't want to poach your fork without your okay, so I'll assign you :) if you're fine going forward, I'll get the history better integrated as Alex suggested before merging. |
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.
Yeah, no objection. Thank you!
Some crates use ctest2 in their tests, so maybe I should add a deprecation notice and encourage to migrate in the |
2c44840
to
f1f0fbf
Compare
Github closed this on me when I pushed some unrelated history and won't let me reopen. Recreated as #4361 |
Merged! 🎉 https://github.com/rust-lang/libc/tree/d5278fd7a746572c0c0b31d4a3d74366fbf5243e/ctest. Thanks Alex and Yuki for the help here.
I wound up using For future reference since I'm sure I'll need to do this again at some point: # This was done on a fresh clone from ctest2
# Move to a subdirectory
git filter-repo --to-subdirectory-filter ctest
# Prefix all tags with `ctest-`
git filter-repo --tag-rename ':ctest-'
# The default merge messages are "merge pull request #nnn from user/branch"
# GH links these incorrectly in the new repo, so rename from `#nnn` to
# `JohnTitor/ctest2#nnn` (doesn't work for anything from the original `ctest`
# repo, but close enough).
echo 'regex:(^|\s)(#\d+)==>\1JohnTitor/ctest2\2' > messages.txt
git filter-repo --replace-message messages.txt
# After configuring a new remote (mine), push everything
git push --force --tags --prune tg-ctest2
# Now in the `libc` directory...
# Add that remote, fetch to update, etc
git remote add origin tg-ctest2 ...
# Merge, put something reasonable in the message
git merge tg-ctest2/... --allow-unrelated-histories
# Add whatever fixup commits are needed so CI passes,
# then push to `main` or use a PR.
# Tags didn't come through, so I just pushed them directly to rust-lang/libc
git push upstream tag 'ctest-*' |
…orb-libm Absorb the libm repository into `compiler-builtins`. This was done using `git-filter-repo` to ensure hashes mentioned in commit messages were correctly rewritten, I used the same strategy to merge `ctest` into `libc` [1] and it worked quite well. Approximately: # `git filter-repo` requires a clean clone git clone https://github.com/rust-lang/libm.git # Move all code to a `libm` subdirectory for all history git filter-repo --to-subdirectory-filter libm # The default merge messages are "merge pull request #nnn from # user/branch". GH links these incorrectly in the new repo, so # rewrite messages from `#nnn` to `rust-lang/libm#nnn`. echo 'regex:(^|\s)(#\d+)==>\1rust-lang/libm\2' > messages.txt git filter-repo --replace-message messages.txt # Re-add a remote and push as a new branch git remote add upstream https://github.com/rust-lang/libm.git git switch -c merge-into-builtins-prep git push --set-upstream upstream merge-into-builtins-prep # Now in a compiler-builtins, add `libm` as a remote git remote add libm https://github.com/rust-lang/libm.git git fetch libm # Do the merge that creates this commit git merge libm/merge-into-builtins-prep --allow-unrelated-histories The result should be correct git history and blame for all files, with messages that use correct rewritten hashes when they are referenced. There is some reorganization and CI work needed, but that will be a follow up. After this merges I will need to push tags from `libm`, which I have already rewritten to include a `libm-` prefix. Old tags in compiler-builtins should likely also be rewritten to add a prefix (we already have this for newer tags), but this can be done at any point. * Original remote: https://github.com/rust-lang/libm.git * Default HEAD: c94017af75c3ec4616d5b7f9b6b1b3826b934469 ("Migrate all crates except `libm` to edition 2024") * HEAD after rewriting history: 15fb630 ("Migrate all crates except `libm` to edition 2024") [1]: rust-lang/libc#4283 (comment)
…orb-libm Absorb the libm repository into `compiler-builtins`. This was done using `git-filter-repo` to ensure hashes mentioned in commit messages were correctly rewritten, I used the same strategy to merge `ctest` into `libc` [1] and it worked quite well. Approximately: # `git filter-repo` requires a clean clone git clone https://github.com/rust-lang/libm.git # Move all code to a `libm` subdirectory for all history git filter-repo --to-subdirectory-filter libm # The default merge messages are "merge pull request #nnn from # user/branch". GH links these incorrectly in the new repo, so # rewrite messages from `#nnn` to `rust-lang/libm#nnn`. echo 'regex:(^|\s)(#\d+)==>\1rust-lang/libm\2' > messages.txt git filter-repo --replace-message messages.txt # Re-add a remote and push as a new branch git remote add upstream https://github.com/rust-lang/libm.git git switch -c merge-into-builtins-prep git push --set-upstream upstream merge-into-builtins-prep # Now in a compiler-builtins, add `libm` as a remote git remote add libm https://github.com/rust-lang/libm.git git fetch libm # Do the merge that creates this commit git merge libm/merge-into-builtins-prep --allow-unrelated-histories The result should be correct git history and blame for all files, with messages that use correct rewritten hashes when they are referenced. There is some reorganization and CI work needed, but that will be a follow up. After this merges I will need to push tags from `libm`, which I have already rewritten to include a `libm-` prefix. Old tags in compiler-builtins should likely also be rewritten to add a prefix (we already have this for newer tags), but this can be done at any point. * Original remote: https://github.com/rust-lang/libm.git * Default HEAD: c94017af75c3ec4616d5b7f9b6b1b3826b934469 ("Migrate all crates except `libm` to edition 2024") * HEAD after rewriting history: 15fb630 ("Migrate all crates except `libm` to edition 2024") [1]: rust-lang/libc#4283 (comment)
…orb-libm Absorb the libm repository into `compiler-builtins`. This was done using `git-filter-repo` to ensure hashes mentioned in commit messages were correctly rewritten, I used the same strategy to merge `ctest` into `libc` [1] and it worked quite well. Approximately: # `git filter-repo` requires a clean clone git clone https://github.com/rust-lang/libm.git # Move all code to a `libm` subdirectory for all history git filter-repo --to-subdirectory-filter libm # The default merge messages are "merge pull request #nnn from # user/branch". GH links these incorrectly in the new repo, so # rewrite messages from `#nnn` to `rust-lang/libm#nnn`. echo 'regex:(^|\s)(#\d+)==>\1rust-lang/libm\2' > messages.txt git filter-repo --replace-message messages.txt # Re-add a remote and push as a new branch git remote add upstream https://github.com/rust-lang/libm.git git switch -c merge-into-builtins-prep git push --set-upstream upstream merge-into-builtins-prep # Now in a compiler-builtins, add `libm` as a remote git remote add libm https://github.com/rust-lang/libm.git git fetch libm # Do the merge that creates this commit git merge libm/merge-into-builtins-prep --allow-unrelated-histories The result should be correct git history and blame for all files, with messages that use correct rewritten hashes when they are referenced. There is some reorganization and CI work needed, but that will be a follow up. After this merges I will need to push tags from `libm`, which I have already rewritten to include a `libm-` prefix. Old tags in compiler-builtins should likely also be rewritten to add a prefix (we already have this for newer tags), but this can be done at any point. * Original remote: https://github.com/rust-lang/libm.git * Default HEAD: c94017af75c3ec4616d5b7f9b6b1b3826b934469 ("Migrate all crates except `libm` to edition 2024") * HEAD after rewriting history: 15fb6307f6dc295fb965d1c4f486571cc18ab6b3 ("Migrate all crates except `libm` to edition 2024") [1]: rust-lang/libc#4283 (comment)
…orb-libm Absorb the libm repository into `compiler-builtins`. This was done using `git-filter-repo` to ensure hashes mentioned in commit messages were correctly rewritten, I used the same strategy to merge `ctest` into `libc` [1] and it worked quite well. Approximately: # `git filter-repo` requires a clean clone git clone https://github.com/rust-lang/libm.git # Move all code to a `libm` subdirectory for all history git filter-repo --to-subdirectory-filter libm # The default merge messages are "merge pull request #nnn from # user/branch". GH links these incorrectly in the new repo, so # rewrite messages from `#nnn` to `rust-lang/libm#nnn`. echo 'regex:(^|\s)(#\d+)==>\1rust-lang/libm\2' > messages.txt git filter-repo --replace-message messages.txt # Re-add a remote and push as a new branch git remote add upstream https://github.com/rust-lang/libm.git git switch -c merge-into-builtins-prep git push --set-upstream upstream merge-into-builtins-prep # Now in a compiler-builtins, add `libm` as a remote git remote add libm https://github.com/rust-lang/libm.git git fetch libm # Do the merge that creates this commit git merge libm/merge-into-builtins-prep --allow-unrelated-histories The result should be correct git history and blame for all files, with messages that use correct rewritten hashes when they are referenced. There is some reorganization and CI work needed, but that will be a follow up. After this merges I will need to push tags from `libm`, which I have already rewritten to include a `libm-` prefix. Old tags in compiler-builtins should likely also be rewritten to add a prefix (we already have this for newer tags), but this can be done at any point. * Original remote: https://github.com/rust-lang/libm.git * Default HEAD: c94017af75c3ec4616d5b7f9b6b1b3826b934469 ("Migrate all crates except `libm` to edition 2024") * HEAD after rewriting history: 15fb6307f6dc295fb965d1c4f486571cc18ab6b3 ("Migrate all crates except `libm` to edition 2024") [1]: rust-lang/libc#4283 (comment)
libc
's testing is pretty tightly coupled toctest2
, which is a reasonably simple crate that maps Rust syntax to C syntax and creates tests based off of that.ctest2
itself is a fork ofctest
.Unfortunately, relying on
ctest(2)
has been somewhat of a problem since it supports only a very outdated version of Rust's syntax, and there are a handful of other bugs. There have been some GSoC proposals to modernizelibc
and its test crates; movingctest
to a rust-lang repo makes that easier and should come with some maintenance benefits.On Zulip, @alexcrichton confirmed ownership of the original
ctest
crate could be transferred to rust-lang so we can continue publishing under that name, for other repos that make use ofctest
/ctest2
.This pull only brings over the repo source and history as it currently exists. I will need to follow up with integration of the CI and release workflows.