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 backtrace definitions and support for statvfs #3361

Closed
wants to merge 1 commit into from
Closed

Add backtrace definitions and support for statvfs #3361

wants to merge 1 commit into from

Conversation

0323pin
Copy link
Contributor

@0323pin 0323pin commented Sep 25, 2023

Replaces #3359

This allows successful build and use of file deletion, a.k.a. move to trash

Tested with a source build of simp with the trash feature enabled.
Without this commit, simp fails to build on NetBSD when the trash feature is enabled.

Also, I've added the new symbols to semver and made sure these functions are available on a minimal NetBSD environment.

@rustbot
Copy link
Collaborator

rustbot commented Sep 25, 2023

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

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@0323pin
Copy link
Contributor Author

0323pin commented Sep 25, 2023

@JohnTitor Single commit now. No other changes were done.

@0323pin 0323pin mentioned this pull request Sep 25, 2023
3 tasks
@JohnTitor
Copy link
Member

Thank you so much! @bors r+

@bors
Copy link
Contributor

bors commented Sep 25, 2023

📌 Commit db2eabd has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 25, 2023

⌛ Testing commit db2eabd with merge b1e4658...

bors added a commit that referenced this pull request Sep 25, 2023
Add backtrace definitions and support for statvfs

Replaces #3359

This allows successful build and use of file deletion, a.k.a. _move to trash_

Tested with a source build of `simp` with the **trash** feature enabled.
Without this commit, `simp` fails to build on NetBSD when the **trash** feature is enabled.

Also, I've added the new symbols to semver and made sure these functions are available on a minimal NetBSD environment.
@0323pin
Copy link
Contributor Author

0323pin commented Sep 25, 2023

Thank you so much!

You're welcome. On my TODO list, learn how to squash non-consecutive commits (if it's even possible?).

Thanks

@bors
Copy link
Contributor

bors commented Sep 25, 2023

💔 Test failed - checks-actions

@0323pin
Copy link
Contributor Author

0323pin commented Sep 25, 2023

@JohnTitor Hmm ... this failure seems unrelated.

This failure was already present yesterday on merged #3284

@JohnTitor
Copy link
Member

Nah, it's different. The cause is that rustc removed an apple target and the fix is here: #3362
I'll retry once the above is merged :)

@0323pin
Copy link
Contributor Author

0323pin commented Sep 25, 2023

Thanks!

@0323pin
Copy link
Contributor Author

0323pin commented Sep 25, 2023

EDIT: Why?!? Merge order, should I sync my branch? I still believe this is unrelated to my PR.

@JohnTitor
Copy link
Member

We have to retry by calling bors:
@bors retry

@bors
Copy link
Contributor

bors commented Sep 25, 2023

⌛ Testing commit db2eabd with merge 087aa3b...

bors added a commit that referenced this pull request Sep 25, 2023
Add backtrace definitions and support for statvfs

Replaces #3359

This allows successful build and use of file deletion, a.k.a. _move to trash_

Tested with a source build of `simp` with the **trash** feature enabled.
Without this commit, `simp` fails to build on NetBSD when the **trash** feature is enabled.

Also, I've added the new symbols to semver and made sure these functions are available on a minimal NetBSD environment.
@0323pin
Copy link
Contributor Author

0323pin commented Sep 25, 2023

We have to retry by calling bors: @bors retry

Cheers! Soon bed time here 😪 but. I'll wait for the test.

@bors
Copy link
Contributor

bors commented Sep 25, 2023

💔 Test failed - checks-actions

@0323pin
Copy link
Contributor Author

0323pin commented Sep 26, 2023

@JohnTitor I had a closer look at this locally but, I'm getting only a warning not an error using Rust-1.72

~> cargo build --release
    Updating crates.io index
   Compiling libc v0.2.148 (/home/pin/Downloads/libc)
warning: function `statvfs` is never used
    --> src/unix/bsd/netbsdlike/netbsd/mod.rs:3188:20
     |
3188 |             pub fn statvfs(path: *const ::c_char, buf: *mut statvfs) -> ::c_int;
     |                    ^^^^^^^
     |
     = note: `#[warn(dead_code)]` on by default

warning: function `fstatvfs` is never used
    --> src/unix/bsd/netbsdlike/netbsd/mod.rs:3189:20
     |
3189 |             pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
     |                    ^^^^^^^^

warning: `libc` (lib) generated 2 warnings
    Finished release [optimized] target(s) in 7.51s

Please advice, thanks!

Add backtrace definitions and support for statvfs

Fix CI breakage, remove unused
@0323pin
Copy link
Contributor Author

0323pin commented Sep 26, 2023

@JohnTitor Can you please retry? Can I call bors myself?

~> cargo build --release
    Updating crates.io index
   Compiling libc v0.2.148 (/home/pin/Downloads/libc)
    Finished release [optimized] target(s) in 5.88s

@0323pin
Copy link
Contributor Author

0323pin commented Sep 26, 2023

@bors retry

@bors
Copy link
Contributor

bors commented Sep 26, 2023

@0323pin: 🔑 Insufficient privileges: not in try users

@0323pin
Copy link
Contributor Author

0323pin commented Sep 26, 2023

@JohnTitor So no, I can not call bors myself.

EDIT: At this point, it should actually be: Add backtrace definitions and support for getmntinfo and getvfsstat but, also at this point, I don't want to mess around anymore.

Please give bors another go 🙏

@0323pin
Copy link
Contributor Author

0323pin commented Sep 27, 2023

I see I need one last correction. Closing this once more and will open a new one.
Might take a day or two, want to run tests on it.

@0323pin 0323pin closed this Sep 27, 2023
bors added a commit that referenced this pull request Sep 29, 2023
backtrace definitions and support for getmntinfo and getvfsstat

After the failures of merging #3361 as a follow-up to #3359 I've spent sometime making sure everything is indeed supported and defined.

```
~> grep -r "MNT_WAIT" /usr/include/sys/fstypes.h; grep -r "MNT_NOWAIT" /usr/include/sys/fstypes.h; grep -r "MNT_LAZY" /usr/include/sys/fstypes.h
#define	MNT_WAIT	1	/* synchronously wait for I/O to complete */
#define	MNT_NOWAIT	2	/* start all I/O, but do not wait for it */
#define	MNT_LAZY 	3	/* push data not written by filesystem syncer */
```

```
~> grep -r "getmntinfo" /usr/include/sys/; grep -r "getvfsstat" /usr/include/sys/
/usr/include/sys/statvfs.h:int	getmntinfo(struct statvfs **, int)
/usr/include/sys/statvfs.h:    __RENAME(__getmntinfo90);
/usr/include/sys/fstypes.h: * waitfor flags to vfs_sync() and getvfsstat()
/usr/include/sys/statvfs.h:int	getvfsstat(struct statvfs *, size_t, int)
/usr/include/sys/statvfs.h:    __RENAME(__getvfsstat90);
/usr/include/sys/syscall.h:/* syscall: "compat_90_getvfsstat" ret: "int" args: "struct statvfs90 *" "size_t" "int" */
/usr/include/sys/syscall.h:#define	SYS_compat_90_getvfsstat	356
/usr/include/sys/syscall.h:/* syscall: "__getvfsstat90" ret: "int" args: "struct statvfs *" "size_t" "int" */
/usr/include/sys/syscall.h:#define	SYS___getvfsstat90	483
/usr/include/sys/syscallargs.h:struct compat_90_sys_getvfsstat_args {
/usr/include/sys/syscallargs.h:check_syscall_args(compat_90_sys_getvfsstat)
/usr/include/sys/syscallargs.h:struct sys___getvfsstat90_args {
/usr/include/sys/syscallargs.h:check_syscall_args(sys___getvfsstat90)
/usr/include/sys/syscallargs.h:int	compat_90_sys_getvfsstat(struct lwp *, const struct compat_90_sys_getvfsstat_args *, register_t *);
/usr/include/sys/syscallargs.h:int	sys___getvfsstat90(struct lwp *, const struct sys___getvfsstat90_args *, register_t *);
```

Also, I've made sure the code compiles with rustc 1.72.0 without warning or errors.

```
~> cargo build --release
    Updating crates.io index
   Compiling libc v0.2.148 (/home/pin/Git/libc)
    Finished release [optimized] target(s) in 8.87s
```

Moreover, the _move to trash_ functionality has again been verified using [simp](https://github.com/Kl4rry/simp) compiled with this commit as patch, in combination with the patch submited to [trash-rs](Byron/trash-rs#84).

`@JohnTitor` Please give bors another try
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

4 participants