1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-20 00:46:34 +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:
Austin Traver 2023-08-07 23:28:40 -07:00 committed by GitHub
parent 03cac66d5c
commit e69f1a93a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 12 deletions

View file

@ -44,19 +44,23 @@ jobs:
plugin:
name: Plugin NRO
runs-on: ubuntu-latest
container:
image: jugeeya/cargo-skyline:3.2.0-no-dkp
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
target: x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
name: Rust Cache
with:
prefix-key: "plugin"
cache-all-crates: true
- name: Install Skyline
run: |
cargo install cargo-skyline
cargo-skyline skyline update-std
- name: Build release NRO
id: build_release
run: cargo-skyline skyline build --release
env:
HOME: /root
- name: Upload plugin artifact
uses: actions/upload-artifact@v3
with:
@ -66,19 +70,22 @@ jobs:
name: Plugin NRO (Outside Training Mode)
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
container:
image: jugeeya/cargo-skyline:3.2.0-no-dkp
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
target: x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
name: Rust Cache
with:
prefix-key: "plugin"
- name: Build outside_training_mode NRO
cache-all-crates: true
- name: Install Skyline
run: |
cargo-skyline skyline build --release --features outside_training_mode
env:
HOME: /root
cargo install cargo-skyline
cargo-skyline skyline update-std
- name: Build outside_training_mode NRO
run: cargo-skyline skyline build --release --features outside_training_mode
- name: Upload plugin (outside training mode) artifact
uses: actions/upload-artifact@v3
with:

View file

@ -1,9 +1,9 @@
use std::convert::TryInto;
use std::ffi::{c_char, c_void};
use std::time::{SystemTime, UNIX_EPOCH};
use once_cell::sync::OnceCell;
use serde::{Deserialize, Serialize};
use skyline::libc::c_void;
use skyline::nn::{account, oe, time};
use crate::common::release::CURRENT_VERSION;
@ -180,7 +180,7 @@ pub fn smash_version() -> String {
unsafe {
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()
.into_owned()
}