Git Product home page Git Product logo

cargo-skyline's People

Contributors

blu-dev avatar dependabot[bot] avatar jam1garner avatar jugeeya avatar nnubes256 avatar raytwo avatar roccodev avatar tech-ticks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cargo-skyline's Issues

Completion/code analysis for cargo-skyline projects?

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

Broken pipe error in build command when printing in proc macro

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.

Remake skyline-rs template

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

Avoid having to update crates.io index when compiling already built projects

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.

Implementation ideas for ``cargo skyline emu``

As discussed in DMs, here's a draft of what would be needed and broad ideas for how process should unfold:

  • Locating Ryujinx
    Considering Ryujinx can only be downloaded as an archive on the official website (afaik), there isn't much choice but to ask the user for the location of the software on their system. However, we could try calling the process by expecting it to be in the PATH environment variable, and then ask if it isn't.
  • Locating the game
    Similarly, we can't assume the path for the NSP or even the filename, so we can only ask the user for the full path.
    One thing that could be interesting is having a env variable pointing to the location of the user's NSPs and look for the a nsp with the titleid from cargo.toml in the filename and assume it is the correct one.
    Considering the NSP to boot will be different for each game you're trying to mod, a way to configure this on a plugin basis would be optimal (cargo.toml metadata?).
  • Installing Skyline and the plugin
    Copying the files must be done in the sdcard and mods directories and can be located in different places depending on Ryujinx's boot mode:
    • Normal: the path is always %appdata%\Ryujinx\
    • Portable: the 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:

  1. Check if the Ryujinx path is configured.
    • ⭕ Proceed.
    • ❌ Either prompt the user for it (abort if they don't provide the expected path) or just abort with a help message on how to configure it.
  2. Check if the game's NSP can be found.
  • First, check if the path for the NSP is configured (project-specific configuration/cargo.toml metadata).
    • ⭕ Does the file actually exist (the user could've moved or renamed it?)
      • ⭕ Proceed
      • ❌ Abort with help message/Ask for the NSP's path and configure on the spot.
    • ❌ Check for the environment variable for the NSP directory. Does it exists?
      • ⭕ Read every entry in the directory, check if a filename had a nsp extension and the file stem container the titleid. If not, abort with help message.
      • ❌ Abort with help message/Ask for the NSP's path and configure on the spot.
  1. Reproduce the 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.
  2. Run the Ryujinx executable and pass the NSP's path as the first argument to immediately boot into it.

I'm obviously missing a few edge cases here, so feel free to suggest changes.

Error 550 when performing a FTP transfer with the titleid directory being missing

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.

Std fork failed to clone when running update-std

As the title says, running update-std --deep on the current beta version of cargo-skyline 3 on Windows leads to an error message following ``path the rust std already exists and is not an empty directory"

Screenshot of the error message descrbed

Connection Refused Error

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)

cargo skyline build fails with latest std

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...

warn when .cargo/config is present

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

Wrong error when a plugin dependency has a bad URL

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.