mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-07-09 20:47:03 +00:00
Fix builds of modpack on M1 Mac (#572)
* Fix builds of modpack on M1 Mac * Check if actions work now * Fix clippy * Use foreign function interface * Update rust.yml * Format code * Revert change to workflow * Revert change to workflow * Update workflow * Update workflow * One additional tweak * Update formatting * Experiment with caching config * Install the latest stdlib before building * Remove unused environment variable
This commit is contained in:
27
.github/workflows/rust.yml
vendored
27
.github/workflows/rust.yml
vendored
@ -44,19 +44,23 @@ jobs:
|
|||||||
plugin:
|
plugin:
|
||||||
name: Plugin NRO
|
name: Plugin NRO
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: jugeeya/cargo-skyline:3.2.0-no-dkp
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@nightly
|
||||||
|
with:
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
name: Rust Cache
|
name: Rust Cache
|
||||||
with:
|
with:
|
||||||
prefix-key: "plugin"
|
prefix-key: "plugin"
|
||||||
|
cache-all-crates: true
|
||||||
|
- name: Install Skyline
|
||||||
|
run: |
|
||||||
|
cargo install cargo-skyline
|
||||||
|
cargo-skyline skyline update-std
|
||||||
- name: Build release NRO
|
- name: Build release NRO
|
||||||
id: build_release
|
id: build_release
|
||||||
run: cargo-skyline skyline build --release
|
run: cargo-skyline skyline build --release
|
||||||
env:
|
|
||||||
HOME: /root
|
|
||||||
- name: Upload plugin artifact
|
- name: Upload plugin artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@ -66,19 +70,22 @@ jobs:
|
|||||||
name: Plugin NRO (Outside Training Mode)
|
name: Plugin NRO (Outside Training Mode)
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: jugeeya/cargo-skyline:3.2.0-no-dkp
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@nightly
|
||||||
|
with:
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
name: Rust Cache
|
name: Rust Cache
|
||||||
with:
|
with:
|
||||||
prefix-key: "plugin"
|
prefix-key: "plugin"
|
||||||
- name: Build outside_training_mode NRO
|
cache-all-crates: true
|
||||||
|
- name: Install Skyline
|
||||||
run: |
|
run: |
|
||||||
cargo-skyline skyline build --release --features outside_training_mode
|
cargo install cargo-skyline
|
||||||
env:
|
cargo-skyline skyline update-std
|
||||||
HOME: /root
|
- name: Build outside_training_mode NRO
|
||||||
|
run: cargo-skyline skyline build --release --features outside_training_mode
|
||||||
- name: Upload plugin (outside training mode) artifact
|
- name: Upload plugin (outside training mode) artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
use std::ffi::{c_char, c_void};
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
use once_cell::sync::OnceCell;
|
use once_cell::sync::OnceCell;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use skyline::libc::c_void;
|
|
||||||
use skyline::nn::{account, oe, time};
|
use skyline::nn::{account, oe, time};
|
||||||
|
|
||||||
use crate::common::release::CURRENT_VERSION;
|
use crate::common::release::CURRENT_VERSION;
|
||||||
@ -180,7 +180,7 @@ pub fn smash_version() -> String {
|
|||||||
unsafe {
|
unsafe {
|
||||||
oe::GetDisplayVersion(&mut smash_version);
|
oe::GetDisplayVersion(&mut smash_version);
|
||||||
|
|
||||||
std::ffi::CStr::from_ptr(smash_version.name.as_ptr() as *const i8)
|
std::ffi::CStr::from_ptr(smash_version.name.as_ptr() as *const c_char)
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.into_owned()
|
.into_owned()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user