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

feat(op, fs): ✨ Intergated statx into monoio #268

Merged
merged 17 commits into from
Jul 23, 2024
Merged

Conversation

Lzzzzzt
Copy link
Collaborator

@Lzzzzzt Lzzzzzt commented Jun 6, 2024

Add statx support for monoio

Add Statx<T> struct to support Op, just implement for SharedFd and CString to support different use cases.

So there are two types: FdStatx and PathStatx, both of them are implement OpAble Trait.

Currently, they can work on linux with iouring and legacy feature, and not support macos and windows, due to these two platforms don't have the statx syscall, it may use the stat syscall and transform the result to the statx

Also, to test the Statx<T> work correctly, I add some new struct to fs module like Metadata, Permissions and FileType.

There is another reason to add these struct, I can't transform the statx struct to the Metadata and other types in std::fs.

So these struct provide nearly the same API like std::fs's

I also add some basic test in tests dir.

Currently, all these changes above only work on linux

@CLAassistant
Copy link

CLAassistant commented Jun 6, 2024

CLA assistant check
All committers have signed the CLA.

@Lzzzzzt
Copy link
Collaborator Author

Lzzzzzt commented Jun 6, 2024

#267

ihciah
ihciah previously approved these changes Jun 7, 2024
@ihciah
Copy link
Member

ihciah commented Jun 7, 2024

It seems test failed for i686 and aarch64...

@Lzzzzzt
Copy link
Collaborator Author

Lzzzzzt commented Jun 7, 2024

the problem in aarch64 may fixed, but the i686's i don't know why this would happen, maybe disable the statx in i686?

@Lzzzzzt
Copy link
Collaborator Author

Lzzzzzt commented Jun 23, 2024

the error happen due to the cross's bug, i have test in newest cross version, it works fine.

@Lzzzzzt Lzzzzzt requested a review from ihciah June 24, 2024 08:03
@Lzzzzzt
Copy link
Collaborator Author

Lzzzzzt commented Jun 24, 2024

image

and the run.sh is

#!/bin/bash

# Define the list of architectures to test
architectures=(
    "x86_64-unknown-linux-gnu"
    "i686-unknown-linux-gnu"
    "aarch64-unknown-linux-gnu"
    "armv7-unknown-linux-gnueabihf"
    "riscv64gc-unknown-linux-gnu"
    "s390x-unknown-linux-gnu"

    "x86_64-apple-darwin"
    "aarch64-apple-darwin"
)

# Loop through each architecture and run the tests
for arch in "${architectures[@]}"; do

    cross test --lib --bins --tests --target "$arch" --no-default-features --features "async-cancel,bytes,legacy,macros,utils" > /dev/null 2>&1

    if [ $? -eq 0 ]; then
        echo "Success for $arch"
    else
        echo "Failure for $arch"
    fi
done

the failure of riscv is #1423

Copy link
Member

@ihciah ihciah left a comment

Choose a reason for hiding this comment

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

Thank you! I'll merge it first, and I'll look at the testing issue.

@ihciah ihciah merged commit dbdb3d8 into bytedance:master Jul 23, 2024
2 of 26 checks passed
@Lzzzzzt Lzzzzzt deleted the statx branch August 2, 2024 09:35
renovate bot referenced this pull request in spiraldb/vortex Aug 20, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [monoio](https://togithub.com/bytedance/monoio) |
workspace.dependencies | patch | `0.2.3` -> `0.2.4` |

---

### Release Notes

<details>
<summary>bytedance/monoio (monoio)</summary>

### [`v0.2.4`](https://togithub.com/bytedance/monoio/releases/tag/0.2.4)

[Compare
Source](https://togithub.com/bytedance/monoio/compare/0.2.3...0.2.4)

#### What's Changed

- readme: typo fix by [@&#8203;tshepang](https://togithub.com/tshepang)
in
[https://github.com/bytedance/monoio/pull/258](https://togithub.com/bytedance/monoio/pull/258)
- enhance: remove redundant check and improve efficiency by
[@&#8203;ihciah](https://togithub.com/ihciah) in
[https://github.com/bytedance/monoio/pull/260](https://togithub.com/bytedance/monoio/pull/260)
- fix: read_u128\_le() returns u16 instead of u128 . by
[@&#8203;liuxin231](https://togithub.com/liuxin231) in
[https://github.com/bytedance/monoio/pull/262](https://togithub.com/bytedance/monoio/pull/262)
- Fix docs.rs build by [@&#8203;hatoo](https://togithub.com/hatoo) in
[https://github.com/bytedance/monoio/pull/264](https://togithub.com/bytedance/monoio/pull/264)
- Feat: BoxFuture which implements Send by
[@&#8203;har23k](https://togithub.com/har23k) in
[https://github.com/bytedance/monoio/pull/271](https://togithub.com/bytedance/monoio/pull/271)
- ci/fix: modify ci.yml to let `cargo fmt/clippy` only runs on nightly
channel by [@&#8203;Lzzzzzt](https://togithub.com/Lzzzzzt) in
[https://github.com/bytedance/monoio/pull/273](https://togithub.com/bytedance/monoio/pull/273)
- feat(op, fs): ✨ Intergated `statx` into monoio by
[@&#8203;Lzzzzzt](https://togithub.com/Lzzzzzt) in
[https://github.com/bytedance/monoio/pull/268](https://togithub.com/bytedance/monoio/pull/268)
- ci: Make rustfmt and clippy happy by
[@&#8203;Xuanwo](https://togithub.com/Xuanwo) in
[https://github.com/bytedance/monoio/pull/279](https://togithub.com/bytedance/monoio/pull/279)
- docs: correct JoinHandle link in the doc of spawn() by
[@&#8203;SteveLauC](https://togithub.com/SteveLauC) in
[https://github.com/bytedance/monoio/pull/265](https://togithub.com/bytedance/monoio/pull/265)
- ci: using main branch of cross by
[@&#8203;Lzzzzzt](https://togithub.com/Lzzzzzt) in
[https://github.com/bytedance/monoio/pull/283](https://togithub.com/bytedance/monoio/pull/283)
- make clippy happy by [@&#8203;Lzzzzzt](https://togithub.com/Lzzzzzt)
in
[https://github.com/bytedance/monoio/pull/284](https://togithub.com/bytedance/monoio/pull/284)
- ci: Disable test for i686 unknown linux target by
[@&#8203;Xuanwo](https://togithub.com/Xuanwo) in
[https://github.com/bytedance/monoio/pull/286](https://togithub.com/bytedance/monoio/pull/286)
- fix: don't register file fd in `File::from_std` by
[@&#8203;NKID00](https://togithub.com/NKID00) in
[https://github.com/bytedance/monoio/pull/277](https://togithub.com/bytedance/monoio/pull/277)
- feat(op, fs): ✨ add `MkDirAt` opcode in io-uring and
`create_dir(_all)` by [@&#8203;Lzzzzzt](https://togithub.com/Lzzzzzt) in
[https://github.com/bytedance/monoio/pull/270](https://togithub.com/bytedance/monoio/pull/270)
- feat: unlink op, remove_file and remove_dir by
[@&#8203;NKID00](https://togithub.com/NKID00) in
[https://github.com/bytedance/monoio/pull/288](https://togithub.com/bytedance/monoio/pull/288)
- feat: support `opcode::RenameAt` by
[@&#8203;Lzzzzzt](https://togithub.com/Lzzzzzt) in
[https://github.com/bytedance/monoio/pull/289](https://togithub.com/bytedance/monoio/pull/289)

#### New Contributors

- [@&#8203;tshepang](https://togithub.com/tshepang) made their first
contribution in
[https://github.com/bytedance/monoio/pull/258](https://togithub.com/bytedance/monoio/pull/258)
- [@&#8203;liuxin231](https://togithub.com/liuxin231) made their first
contribution in
[https://github.com/bytedance/monoio/pull/262](https://togithub.com/bytedance/monoio/pull/262)
- [@&#8203;hatoo](https://togithub.com/hatoo) made their first
contribution in
[https://github.com/bytedance/monoio/pull/264](https://togithub.com/bytedance/monoio/pull/264)
- [@&#8203;Lzzzzzt](https://togithub.com/Lzzzzzt) made their first
contribution in
[https://github.com/bytedance/monoio/pull/273](https://togithub.com/bytedance/monoio/pull/273)
- [@&#8203;Xuanwo](https://togithub.com/Xuanwo) made their first
contribution in
[https://github.com/bytedance/monoio/pull/279](https://togithub.com/bytedance/monoio/pull/279)
- [@&#8203;SteveLauC](https://togithub.com/SteveLauC) made their first
contribution in
[https://github.com/bytedance/monoio/pull/265](https://togithub.com/bytedance/monoio/pull/265)
- [@&#8203;NKID00](https://togithub.com/NKID00) made their first
contribution in
[https://github.com/bytedance/monoio/pull/277](https://togithub.com/bytedance/monoio/pull/277)

**Full Changelog**:
bytedance/monoio@0.2.3...0.2.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/spiraldb/vortex).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants