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

add renameat2 and flags #1508

Closed
wants to merge 1 commit into from
Closed

Conversation

phi-gamma
Copy link
Contributor

This used to be PR #554.

Adapted to match the current state of libc. Also, adapt for the
fact that in Linux, the flags argument is of type unsigned,
not int.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@phi-gamma
Copy link
Contributor Author

Note that I changed the definition of the flags to match the
signature of the syscall argument. IMO this is the right thing
to do since renameat2() is the sole syscall the macros
are used with.

This means the type now diverges from those in
src/fuchsia/mod.rs. Not sure whether this is an issue
for you guys.

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 11, 2019

This means the type now diverges from those in
src/fuchsia/mod.rs. Not sure whether this is an issue
for you guys.

Not an issue, but @josephlr might want to take a look at those.

Looking at the CI errors, these are apparently broken on musl. You might want to move these to the gnu module. Other than that, this looks good to merge to me.

@josephlr
Copy link
Contributor

Not an issue, but @josephlr might want to take a look at those.

Seems fine. This divergence is expected and shouldn't break anything.

phi-gamma added a commit to phi-gamma/openat that referenced this pull request Sep 12, 2019
See rust-lang/libc#1508

The type of the RENAME_* constants has been adjusted to match the type
(unsigned int) of the syscall parameter.

Signed-off-by: Philipp Gesang <phg@phi-gamma.net>
phi-gamma added a commit to phi-gamma/openat that referenced this pull request Sep 12, 2019
The renameat2 syscall is available as a glibc wrapper since the libc
crate now supports glibc 2.28+.

See rust-lang/libc#1508
@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 13, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 13, 2019

📌 Commit 8463a87 has been approved by gnzlbg

@bors
Copy link
Contributor

bors commented Sep 13, 2019

⌛ Testing commit 8463a87 with merge ae9350e...

bors added a commit that referenced this pull request Sep 13, 2019
add renameat2 and flags

This used to be PR #554.

Adapted to match the current state of *libc*. Also, adapt for the
fact that in Linux, the *flags* argument is of type *unsigned*,
not *int*.
@bors
Copy link
Contributor

bors commented Sep 13, 2019

💔 Test failed - status-azure

@phi-gamma
Copy link
Contributor Author

Regarding the CI issues: I have rustfmt 1.3 (stable) here which doesn’t catch
that formatting issue, so I applied the changes as the version in CI suggests.

Can’t comment on that linker error on sparc or what seems to be an update
problem on arm.

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 16, 2019

cargo +nightly fmt --all should use the nightly rustfmt if you have a nightly toolchain installed, even if it is not your default.

@phi-gamma
Copy link
Contributor Author

Sorry, there is no nightly toolchain on stock Fedora 30 and rustup
is allergic against the system toolchain. I’m going to have to do that
at home later.

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 16, 2019

@cuviper might be able to give some advice.

I don't think this problem has a great solution. Every stable rustfmt point release produces different formatting as well, due to bugs being fixed, etc. So picking one single rustfmt version isn't really a great solution to this problem either :/ I'm open to suggestions. We definitely have some freedom about which rustfmt version we pick.

We could also just use rustfmt in an advisory position, and just reformat the library before each release. But sadly rustfmt isn't always idempotent (e.g. cargo fmt --all might produce output that fails a subsequent cargo fmt --all -- --check), so I worry that would create a higher maintanence burden. I obviously find it easier if we only merge PRs that are properly formatted.

@mati865
Copy link
Contributor

mati865 commented Sep 16, 2019

Rustup can be made to live alongside system Rust toolchain: https://github.com/rust-lang/rustup.rs#working-with-distribution-rust-packages

@cuviper
Copy link
Member

cuviper commented Sep 16, 2019

Yeah, I also use rustup that way myself.

Picking a rustfmt version for CI is hard, but I don't think tracking nightly is the best. If nothing else, it's annoying for contributors if they have to fix unrelated formatting in their PR, just because it changed in nightly. Implicitly tracking stable is a little better because that changes less frequently. But I think it's best to choose an explicit stable version, even if as a maintainer you always bump it to latest stable -- that act of bumping can catch up on any formatting changes at the same time.

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 16, 2019

FWIW the main reason libc uses nightly rustfmt is that you need nightly rust to run libc tests, so you already need to do cargo +nightly test --all to prepare a PR if nightly isn't your default toolchain.

@cuviper
Copy link
Member

cuviper commented Sep 16, 2019

Sure, that's reasonable.

@phi-gamma
Copy link
Contributor Author

@mati865: Those instructions proved incomplete for me; rustup outright
refuses to work unless I pass RUSTUP_INIT_SKIP_PATH_CHECK=yes.

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 21, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 21, 2019

📌 Commit fea39c1 has been approved by gnzlbg

@bors
Copy link
Contributor

bors commented Sep 21, 2019

⌛ Testing commit fea39c1 with merge 8e81c08...

bors added a commit that referenced this pull request Sep 21, 2019
add renameat2 and flags

This used to be PR #554.

Adapted to match the current state of *libc*. Also, adapt for the
fact that in Linux, the *flags* argument is of type *unsigned*,
not *int*.
@bors
Copy link
Contributor

bors commented Sep 21, 2019

💔 Test failed - checks-cirrus-freebsd-12

@gnzlbg
Copy link
Contributor

gnzlbg commented Oct 15, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Oct 15, 2019

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: Support vxWorks in libc-test #1543

@bors
Copy link
Contributor

bors commented Oct 15, 2019

📌 Commit fea39c1 has been approved by gnzlbg

@bors
Copy link
Contributor

bors commented Oct 16, 2019

⌛ Testing commit fea39c1 with merge be44a92...

bors added a commit that referenced this pull request Oct 16, 2019
add renameat2 and flags

This used to be PR #554.

Adapted to match the current state of *libc*. Also, adapt for the
fact that in Linux, the *flags* argument is of type *unsigned*,
not *int*.
@bors
Copy link
Contributor

bors commented Oct 16, 2019

💔 Test failed - status-azure

@bors
Copy link
Contributor

bors commented Nov 18, 2019

⌛ Testing commit fea39c1 with merge 13664cc...

bors added a commit that referenced this pull request Nov 18, 2019
add renameat2 and flags

This used to be PR #554.

Adapted to match the current state of *libc*. Also, adapt for the
fact that in Linux, the *flags* argument is of type *unsigned*,
not *int*.
@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 18, 2019

@bors r- retry

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 18, 2019

@bors: retry

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 28, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 28, 2019

📌 Commit fea39c1 has been approved by gnzlbg

bors added a commit that referenced this pull request Nov 28, 2019
add renameat2 and flags

This used to be PR #554.

Adapted to match the current state of *libc*. Also, adapt for the
fact that in Linux, the *flags* argument is of type *unsigned*,
not *int*.
@bors
Copy link
Contributor

bors commented Nov 28, 2019

⌛ Testing commit fea39c1 with merge 9d1230e...

@bors
Copy link
Contributor

bors commented Nov 28, 2019

💔 Test failed - status-azure

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 29, 2019

@bors: retry


There is a failure in sparc64, and it appears legit, but lets try one more time.

@bors
Copy link
Contributor

bors commented Nov 29, 2019

⌛ Testing commit fea39c1 with merge d22b2de...

bors added a commit that referenced this pull request Nov 29, 2019
add renameat2 and flags

This used to be PR #554.

Adapted to match the current state of *libc*. Also, adapt for the
fact that in Linux, the *flags* argument is of type *unsigned*,
not *int*.
@bors
Copy link
Contributor

bors commented Nov 29, 2019

💔 Test failed - status-azure

@bors
Copy link
Contributor

bors commented Feb 20, 2020

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

This used to be PR rust-lang#554.

Adapted to match the current state of *libc*. Also, adapt for the
fact that in Linux, the *flags* argument is of type *unsigned*,
not *int*.
@bors
Copy link
Contributor

bors commented Feb 28, 2020

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

@fbernier
Copy link

Hey, seems like there was an issue merging this in but the build is now gone. Can we try again and I'll check out the failure if there's one?

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.

None yet

10 participants