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

Added vita target support #6094

Merged
merged 2 commits into from
Oct 25, 2023
Merged

Added vita target support #6094

merged 2 commits into from
Oct 25, 2023

Conversation

nikarh
Copy link
Contributor

@nikarh nikarh commented Oct 20, 2023

This fixes the compilation for armv7-sony-vita-newlibeabihf target.

Other requirements for polling and networking to work on the target (merged but not released yet):

As well as setting mio_unsupported_force_poll_poll until #5866 is resolved (or if the outcome of #5866 would be to hardocde specific targets, I can hardcode it in this PR)

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-net Module: tokio/net labels Oct 20, 2023
@Darksonn
Copy link
Contributor

So, will this work once both this and tokio-rs/mio#1721 are released?

Regarding mio_unsupported_force_poll_poll, it's okay that it has the same status as other similar targets. The hard-coding fix would be nice, but make a dedicated PR for it.

@nikarh
Copy link
Contributor Author

nikarh commented Oct 20, 2023

So, will this work once both this and tokio-rs/mio#1721 are released?

Yes, right now I'm working with patch dependencies, and tokio works with these changes.

Regarding mio_unsupported_force_poll_poll, it's okay that it has the same status as other similar targets. The hard-coding fix would be nice, but make a dedicated PR for it.

Sure, that's not an issue for this particular target anyway.
Since building for vita requires a VITASDK toolchain and running a number of CLI tools on the resulting elf to make it runnable on the device, the recommended way to build for vita is using cargo-vita, and this tool itself already passes mio_unsupported_force_poll_poll to RUSTFLAGS for build

@Darksonn
Copy link
Contributor

Is this a platform it is easy to run in our CI?

@nikarh
Copy link
Contributor Author

nikarh commented Oct 20, 2023

Is this a platform it is easy to run in our CI?

It would be easy to run check and clippy (on nightly with buildstd, same as I did for socket2 and mio). Should I add it to this PR?

Running tests though would unfortunately be impossible without the actual physical device.

@Darksonn
Copy link
Contributor

Okay. In that case, please add the target here:

cross-check:
name: cross-check
needs: basics
runs-on: ubuntu-latest
strategy:
matrix:
target:
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- arm-linux-androideabi
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_stable }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --all-features --target ${{ matrix.target }}
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings

@nikarh
Copy link
Contributor Author

nikarh commented Oct 22, 2023

Okay. In that case, please add the target here:

cross-check:
name: cross-check
needs: basics
runs-on: ubuntu-latest
strategy:
matrix:
target:
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- arm-linux-androideabi
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_stable }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_stable }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --all-features --target ${{ matrix.target }}
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings

Sure, though as I mentioned above, check would require build-std on nightly, since vita is a Tier 3 target. I can add a new step for tier 3 targets like this:

  cross-check-tier3:
    name: cross-check-tier3
    needs: basics
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target:
          - armv7-sony-vita-newlibeabihf
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
          target: ${{ matrix.target }}

      - uses: Swatinem/rust-cache@v2
      - run: cargo hack check -Zbuild-std --workspace --feature-powerset --target ${{ matrix.target }}
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings

Since it will fail unless mio is released and bumped, I'll ask for a mio release, and add the CI step to this PR after that happens.

@nikarh
Copy link
Contributor Author

nikarh commented Oct 23, 2023

Bumped mio and added a CI step.

I don't particularly like how it tuned out - vita has no process support, and signal-hook-registry won't even compile. So we can't support process, signal and as a consequence full features in check. So check can't be done for --all-features, so I've used cargo hack check --each-feature because that way I can exclude features from check.

Also vita check job needs a more recent nightly than the one in the job, and bumping it fails docs step.

@Darksonn
Copy link
Contributor

I updated the nightly version. Please try again.

@nikarh
Copy link
Contributor Author

nikarh commented Oct 24, 2023

I updated the nightly version. Please try again.

Thanks! Rebased, squashed, and added job to tests-pass.needs

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks.

@Darksonn Darksonn merged commit f3949cc into tokio-rs:master Oct 25, 2023
71 checks passed
kodiakhq bot pushed a commit to pdylanross/fatigue that referenced this pull request Nov 10, 2023
Bumps tokio from 1.33.0 to 1.34.0.

Release notes
Sourced from tokio's releases.

Tokio v1.34.0
Fixed

io: allow clear_readiness after io driver shutdown (#6067)
io: fix integer overflow in take (#6080)
io: fix I/O resource hang (#6134)
sync: fix broadcast::channel link (#6100)

Changed

macros: use ::core qualified imports instead of ::std inside tokio::test macro (#5973)

Added

fs: update cfg attr in fs::read_dir to include aix (#6075)
sync: add mpsc::Receiver::recv_many (#6010)
tokio: added vita target support (#6094)

#5973: tokio-rs/tokio#5973
#6067: tokio-rs/tokio#6067
#6080: tokio-rs/tokio#6080
#6134: tokio-rs/tokio#6134
#6100: tokio-rs/tokio#6100
#6075: tokio-rs/tokio#6075
#6010: tokio-rs/tokio#6010
#6094: tokio-rs/tokio#6094



Commits

49eb26f chore: prepare Tokio v1.34.0 release (#6138)
19d96c0 io: increase ScheduledIo tick resolution (#6135)
30b2eb1 io: fix possible I/O resource hang (#6134)
8ec3e0d metrics: update stats when unparking in multi-thread (#6131)
161ecec stream: fix typo in peekable docs (#6130)
61fcc3b time: remove cached elapsed value from driver state (#6097)
944024e chore: update rust-version to 1.63 in all crates (#6126)
65f861f stream: add StreamExt::peekable (#6095)
4c85801 ci: fix docs on latest nightly (#6120)
ed32cd1 task: add tests for tracing instrumentation of tasks (#6112)
Additional commits viewable in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-net Module: tokio/net
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants