jam1garner / cargo-skyline Goto Github PK
View Code? Open in Web Editor NEWA cargo subcommand for working with Skyline plugins written in Rust
A cargo subcommand for working with Skyline plugins written in Rust
Whenever a dependency crate that prints to stdout inside a proc macro is compiled, cargo skyline build
fails with the following error:
Unable to parse cargo output stream
error: Broken pipe (os error 32)
The build works if the underlying command SKYLINE_ADD_NRO_HEADER=1 RUSTFLAGS="--cfg skyline_std_v3" cargo +skyline-v3 build --target ~/.cargo/skyline/aarch64-skyline-switch.json -Z build-std=core,alloc,std,panic_abort
is executed manually.
This issue might be specific to macOS.
When running a command performing FTP transfer (such as run
) to install a plugin for a titleid that hasn't been modded yet, cargo skyline
returns a panic with error code 550.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnexpectedStatus(550)', C:\Users\Raytwo\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-skyline-2.1.0\src\installer.rs:31:44
If I am not mistaken, this also happens if the romfs
subdirectory is missing.
git clone output from update-std is pretty ugly/not helpful to users/very long, so probably just make a little spinner thing instead idk idk idk
Current one has grown a bit crusty, might be worth making one from scratch to remove backwards compat files and other things that have accrued
I upgraded to 3.0.0, and updated the std, and now when I try to compile a plugin I get this error
error[E0277]: the trait bound `Box<sys::switch::locks::mutex::Mutex>: check::CondvarCheck` is not satisfied in `sync::condvar::Condvar`
--> C:\Users\m\.cargo\skyline\toolchain\skyline\lib\rustlib\src\rust\library\std\src\sync\barrier.rs:36:11
|
36 | cvar: Condvar,
| ^^^^^^^ within `sync::condvar::Condvar`, the trait `check::CondvarCheck` is not implemented for `Box<sys::switch::locks::mutex::Mutex>`
|
= help: the following other types implement trait `check::CondvarCheck`:
LazyBox<T>
sys::switch::locks::mutex::Mutex
note: required because it appears within the type `sync::condvar::Condvar`
--> C:\Users\m\.cargo\skyline\toolchain\skyline\lib\rustlib\src\rust\library\std\src\sync\condvar.rs:109:12
|
109 | pub struct Condvar {
| ^^^^^^^
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
|
36 | cvar: &Condvar,
| +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
36 | cvar: Box<Condvar>,
| ++++ +
error[E0277]: the trait bound `Box<sys::switch::locks::mutex::Mutex>: check::CondvarCheck` is not satisfied in `sync::condvar::Condvar`
--> C:\Users\m\.cargo\skyline\toolchain\skyline\lib\rustlib\src\rust\library\std\src\sync\condvar.rs:559:6
|
559 | impl Default for Condvar {
| ^^^^^^^ within `sync::condvar::Condvar`, the trait `check::CondvarCheck` is not implemented for `Box<sys::switch::locks::mutex::Mutex>`
|
= help: the following other types implement trait `check::CondvarCheck`:
LazyBox<T>
sys::switch::locks::mutex::Mutex
note: required because it appears within the type `sync::condvar::Condvar`
--> C:\Users\m\.cargo\skyline\toolchain\skyline\lib\rustlib\src\rust\library\std\src\sync\condvar.rs:109:12
|
109 | pub struct Condvar {
| ^^^^^^^
note: required by a bound in `core::default::Default`
--> C:\Users\m\.cargo\skyline\toolchain\skyline\lib\rustlib\src\rust\library\core\src\default.rs:102:20
|
102 | pub trait Default: Sized {
| ^^^^^ required by this bound in `core::default::Default`
error[E0277]: the trait bound `Box<sys::switch::locks::mutex::Mutex>: check::CondvarCheck` is not satisfied
--> C:\Users\m\.cargo\skyline\toolchain\skyline\lib\rustlib\src\rust\library\std\src\sys_common\condvar.rs:12:12
|
12 | check: CondvarCheck,
| ^^^^^^^^^^^^ the trait `check::CondvarCheck` is not implemented for `Box<sys::switch::locks::mutex::Mutex>`
|
= help: the following other types implement trait `check::CondvarCheck`:
LazyBox<T>
sys::switch::locks::mutex::Mutex
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.
error: could not compile `std` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
at the moment, when a .cargo/config is present, some commands, most notably cargo metadata
, error out because it cannot find the correct toolchain.
cargo-skyline should warn the user if that file is present
Is this normal? Do I temporarily disable anti-virus as I install?
Setting a plugin-dependency in cargo.toml in such a way that the url field is wrong ("idk" was used in this example), the following error is returned: ERROR: Failed to download latest release of Skyline. An internet connection is required.
For additional context, this happened on a Macbook Pro M1, the plugin did build, but not the upload part of the command.
--- stderr
error: override toolchain 'skyline' is not installed: the RUSTUP_TOOLCHAIN environment variable specifies an uninstalled toolchain```
While I'll leave the implementation details to you, one idea that comes to mind is being able to add a list of paths to the Cargo.toml file the same way we can specify the titleid for our plugin, and have these be copied in the archive when packaging.
As discussed in DMs, here's a draft of what would be needed and broad ideas for how process should unfold:
sdcard
and mods
directories and can be located in different places depending on Ryujinx's boot mode:
%appdata%\Ryujinx\
sdcard
and mods
directories are located in the same place as the executable (needs verification)Storing the paths could be done the same way the IP is stored for cargo install.
As for the cargo skyline emu
flow, probably something such as:
nsp
extension and the file stem container the titleid. If not, abort with help message.cargo run
process but with cargo install
dropping the files in the correct place instead of FTPing them. The IP should be set to 0.0.0.0
for the logger.I'm obviously missing a few edge cases here, so feel free to suggest changes.
Each time when executing a command that compiles a project with cargo-skyline 3.0.0, the following must go through before the actual compilation process begins:
Updating git repository `https://github.com/ultimate-research/libc-nnsdk.git`
Updating crates.io index
If this process fails for whatever reason, the compilation is quickly terminated. This makes it impossible on cargo-skyline 3.0.0 to compile projects without an internet connection. Additionally, the process may hang for a prolonged period of time on the second line, making compiling projects a waiting game. This behavior is uncommon, but bothersome when it does occur.
This process should only occur on fresh builds of the project (i.e., no target
folder or after a cargo clean
), or at least be reduced from having to be performed on every single compile.
The template repository being downloaded comes with its git history and contributors, it'd be better if users could start fresh instead of having to remember to clean it themselves.
People have been observing the following issue with the custom toolchain:
no such subcommand: +skyline-v3
Since cargo-skyline
uses rustup toolchain selectors under the hood I presume the rustup cargo shim has some bug with handling this.
Relevant rustup issue seems to be rust-lang/rustup#3036
I've been experimenting with cargo skyline a bit, but since you need to use cargo skyline build
to build and native builds are impossible due to compilation failure in libc-nnsdk
*, it seems that rust-analyzer and rls won't work with it. Is it possible to get a powerful completion environment with skyline-rs projects?
Intuitively I feel like the best way to do this would be to have cargo-skyline projects build natively on the stable channel, even if you couldn't actually do anything with the artifact, but I'm not sure how possible that would be/how much work it would take.
*
# stable
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/lambdadog/.cargo/git/checkouts/libc-nnsdk-887c2406398ea5ab/98c11e0/libc-nnsdk/src/lib.rs:5:1
|
5 | #![feature(untagged_unions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# nightly
error[E0557]: feature has been removed
--> /home/lambdadog/.cargo/git/checkouts/libc-nnsdk-887c2406398ea5ab/98c11e0/libc-nnsdk/src/lib.rs:5:12
|
5 | #![feature(untagged_unions)]
| ^^^^^^^^^^^^^^^ feature has been removed
|
= note: unions with `Copy` and `ManuallyDrop` fields are stable; there is no intent to stabilize more
When i try to use cargo skyline run
I get the following error:
Finished release [optimized] target(s) in 0.44s
Connecting to ip '192.168.2.107'...
An FTP Error Occurred: IoError: No connection could be made because the target machine actively refused it. (os error 10061)
PC and Switch are on the same network and I can ping the Switch.
Deploying and running via SD card work fine.
What could be the issue?
Edit: Looks like cargo skyline can't connect via ftp to install.
Switch is on
OFW 10.0.4
Atmosphere (Hekate)
(v0.12.0/19.05.2020)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.