Skip to content

Commit

Permalink
build: bump fbw dev env (#8585)
Browse files Browse the repository at this point in the history
* build: bump fbw dev env

* build: bump rust to 1.74.1 - 2023-12-07

* fix: clippy issues with 1.74

* fix: invalid elided lifetimes

* build: bump dev-env to include rust 1.74.1

* update build flags to match sdk config

* use new image digest

* remove --stack-guard-page

Does not work with our llvm installation and seems like the option is a custom addition by asobo

* apply review suggestions

* bump rust version to 1.78.0

* fix: lint

* fix: removed dead code only used in tests

* Revert "fix: removed dead code only used in tests"

This reverts commit a6288ca.

* Revert "fix: lint"

This reverts commit 11d3d80.

* Revert "bump rust version to 1.78.0"

This reverts commit fbecaeb.

---------

Co-authored-by: Saschl <[email protected]>
  • Loading branch information
tracernz and Saschl authored Jun 3, 2024
1 parent 1a6e658 commit c8778be
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(FBW_COMMON ${FBW_ROOT}/fbw-common/src/wasm)
include("${FBW_COMMON}/cpp-msfs-framework/cmake/TargetDefinition.cmake")

# compiler refinement
set(COMPILER_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined -target wasm32-unknown-wasi --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -mthread-model single -fno-exceptions -fms-extensions -fvisibility=hidden -ffunction-sections -fdata-sections -fno-stack-protector")
set(COMPILER_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined -target wasm32-unknown-wasi --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -mthread-model single -fno-exceptions -fms-extensions -fvisibility=hidden -ffunction-sections -fdata-sections -Werror=return-type -fno-stack-protector -fstack-size-section -mbulk-memory")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
Expand Down
5 changes: 5 additions & 0 deletions fbw-a32nx/src/wasm/fbw_a320/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ clang++ \
-fno-exceptions \
-fms-extensions \
-fvisibility=hidden \
-fdata-sections \
-fno-stack-protector \
-fstack-size-section \
-mbulk-memory \
-Werror=return-type \
-I "${MSFS_SDK}/WASM/include" \
-I "${MSFS_SDK}/SimConnect SDK/include" \
-I "${COMMON_DIR}/src" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2036,10 +2036,9 @@ mod tests {
}

fn test_bed_in_descent() -> CabinAirTestBed {
let test_bed = test_bed_in_cruise()
test_bed_in_cruise()
.vertical_speed_of(Velocity::new::<foot_per_minute>(-260.))
.iterate(40);
test_bed
.iterate(40)
}

mod a320_pressurization_tests {
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/wasm/systems/a320_systems/src/fuel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct A320Fuel {
fuel_system: FuelSystem<5>,
}
impl A320Fuel {
pub const A320_FUEL: [FuelInfo<'_>; 5] = [
pub const A320_FUEL: [FuelInfo<'static>; 5] = [
FuelInfo {
fuel_tank_id: "FUEL TANK CENTER QUANTITY",
position: (-4.5, 0., 1.),
Expand Down
4 changes: 2 additions & 2 deletions fbw-a32nx/src/wasm/systems/a320_systems/src/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct A320Payload {
impl A320Payload {
// Note: These constants reflect flight_model.cfg values and will have to be updated in sync with the configuration
pub const DEFAULT_PER_PAX_WEIGHT_KG: f64 = 84.;
const A320_PAX: [PaxInfo<'_>; 4] = [
const A320_PAX: [PaxInfo<'static>; 4] = [
PaxInfo {
max_pax: 36,
position: (20.5, 0., 5.),
Expand All @@ -97,7 +97,7 @@ impl A320Payload {
},
];

const A320_CARGO: [CargoInfo<'_>; 4] = [
const A320_CARGO: [CargoInfo<'static>; 4] = [
CargoInfo {
max_cargo_kg: 3402.,
position: (17.3, 0., 0.),
Expand Down
5 changes: 5 additions & 0 deletions fbw-a380x/src/wasm/fbw_a380/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ clang \
-fno-exceptions \
-fms-extensions \
-fvisibility=hidden \
-fdata-sections \
-fno-stack-protector \
-fstack-size-section \
-mbulk-memory \
-Werror=return-type \
-I "${MSFS_SDK}/WASM/include" \
-I "${COMMON_DIR}/fbw_common/src/zlib" \
"${COMMON_DIR}/fbw_common/src/zlib/adler32.c" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2786,10 +2786,9 @@ mod tests {
}

fn test_bed_in_descent() -> CabinAirTestBed {
let test_bed = test_bed_in_cruise()
test_bed_in_cruise()
.vertical_speed_of(Velocity::new::<foot_per_minute>(-260.))
.iterate(40);
test_bed
.iterate(40)
}

mod a380_pressurization_tests {
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/src/wasm/systems/a380_systems/src/fuel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct A380Fuel {
}

impl A380Fuel {
pub const A380_FUEL: [FuelInfo<'_>; 11] = [
pub const A380_FUEL: [FuelInfo<'static>; 11] = [
FuelInfo {
// LEFT_OUTER - Capacity: 2731.5
fuel_tank_id: "FUEL_TANK_QUANTITY_1",
Expand Down
4 changes: 2 additions & 2 deletions fbw-a380x/src/wasm/systems/a380_systems/src/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct A380Payload {
impl A380Payload {
// Note: These constants reflect flight_model.cfg values and will have to be updated in sync with the configuration
pub const DEFAULT_PER_PAX_WEIGHT_KG: f64 = 84.;
const A380_PAX: [PaxInfo<'_>; 14] = [
const A380_PAX: [PaxInfo<'static>; 14] = [
PaxInfo {
max_pax: 28,
position: (70.7, 0., 7.1),
Expand Down Expand Up @@ -179,7 +179,7 @@ impl A380Payload {
},
// PAX UPPER AFT: 18
];
const A380_CARGO: [CargoInfo<'_>; 3] = [
const A380_CARGO: [CargoInfo<'static>; 3] = [
CargoInfo {
max_cargo_kg: 28577.,
position: (62.4, 0., -0.95),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,17 +733,15 @@ impl ZoneController {
{
Self::UPPER_DUCT_TEMP_LIMIT_HIGH_KELVIN
} else {
let interpolation = (Self::UPPER_DUCT_TEMP_LIMIT_LOW_KELVIN
- Self::UPPER_DUCT_TEMP_LIMIT_HIGH_KELVIN)
(Self::UPPER_DUCT_TEMP_LIMIT_LOW_KELVIN - Self::UPPER_DUCT_TEMP_LIMIT_HIGH_KELVIN)
/ (Self::UPPER_DUCT_TEMP_TRIGGER_HIGH_CELSIUS
- Self::UPPER_DUCT_TEMP_TRIGGER_LOW_CELSIUS)
* (zone_measured_temperature.get::<kelvin>()
- ThermodynamicTemperature::new::<degree_celsius>(
Self::UPPER_DUCT_TEMP_TRIGGER_LOW_CELSIUS,
)
.get::<kelvin>())
+ Self::UPPER_DUCT_TEMP_LIMIT_HIGH_KELVIN;
interpolation
+ Self::UPPER_DUCT_TEMP_LIMIT_HIGH_KELVIN
},
)
}
Expand All @@ -766,17 +764,15 @@ impl ZoneController {
{
Self::LOWER_DUCT_TEMP_LIMIT_HIGH_KELVIN
} else {
let interpolation = (Self::LOWER_DUCT_TEMP_LIMIT_LOW_KELVIN
- Self::LOWER_DUCT_TEMP_LIMIT_HIGH_KELVIN)
(Self::LOWER_DUCT_TEMP_LIMIT_LOW_KELVIN - Self::LOWER_DUCT_TEMP_LIMIT_HIGH_KELVIN)
/ (Self::LOWER_DUCT_TEMP_TRIGGER_HIGH_CELSIUS
- Self::LOWER_DUCT_TEMP_TRIGGER_LOW_CELSIUS)
* (zone_measured_temperature.get::<kelvin>()
- ThermodynamicTemperature::new::<degree_celsius>(
Self::LOWER_DUCT_TEMP_TRIGGER_LOW_CELSIUS,
)
.get::<kelvin>())
+ Self::LOWER_DUCT_TEMP_LIMIT_HIGH_KELVIN;
interpolation
+ Self::LOWER_DUCT_TEMP_LIMIT_HIGH_KELVIN
},
)
}
Expand Down
2 changes: 1 addition & 1 deletion fbw-common/src/wasm/systems/systems/src/hydraulic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ impl Section {
}

fn delta_pressure_from_delta_volume(&self, delta_vol: Volume, fluid: &Fluid) -> Pressure {
return delta_vol / self.max_high_press_volume * fluid.bulk_mod();
delta_vol / self.max_high_press_volume * fluid.bulk_mod()
}

fn is_primed(&self) -> bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ struct InertialReference {
wind_direction_bnr: AdirsData<Angle>,
latitude: AdirsData<Angle>,
longitude: AdirsData<Angle>,
/// label 270
maint_word: AdirsData<u32>,
}
impl InertialReference {
Expand Down Expand Up @@ -1330,7 +1331,6 @@ impl InertialReference {
wind_speed_bnr: AdirsData::new_ir(context, number, Self::WIND_SPEED_BNR),
latitude: AdirsData::new_ir(context, number, Self::LATITUDE),
longitude: AdirsData::new_ir(context, number, Self::LONGITUDE),
/// label 270
maint_word: AdirsData::new_ir(context, number, Self::MAINT_WORD),
}
}
Expand Down
5 changes: 5 additions & 0 deletions fbw-common/src/wasm/terronnd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ clang++ \
-fvisibility=hidden \
-fno-common \
-fstack-usage \
-fdata-sections \
-fno-stack-protector \
-fstack-size-section \
-mbulk-memory \
-Werror=return-type \
-O2 \
-I "${MSFS_SDK}/WASM/include" \
-I "${MSFS_SDK}/SimConnect SDK/include" \
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.72.1"
channel = "1.74.1"
targets = [ "wasm32-wasi" ]
2 changes: 1 addition & 1 deletion scripts/dev-env/run-local.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

rem This is a script to use a locally built docker image to run the tests

set image="sha256:d1fa5a6ced00ca075f1e54aacdea086c52f321387245126bcb0cd7f84fbfa34b"
set image="sha256:dfb8d94a2712b3ce744b649948881b4db4b93d245513d2eefdf553820b724d7f"

docker image inspect %image% 1> nul || docker system prune --filter label=flybywiresim=true -f
docker run --rm -it -v "%cd%:/external" %image% %*
2 changes: 1 addition & 1 deletion scripts/dev-env/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# This is a script to use a locally built docker image to run the tests

IMAGE="sha256:2cf75753022112a79d4a512caecfbdf601e12b01b382263cf78f90635cdea6bf"
IMAGE="sha256:dfb8d94a2712b3ce744b649948881b4db4b93d245513d2eefdf553820b724d7f"

# only set `-it` if there is a tty
if [ -t 0 ] && [ -t 1 ];
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev-env/run.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off

set image="ghcr.io/flybywiresim/dev-env@sha256:2cf75753022112a79d4a512caecfbdf601e12b01b382263cf78f90635cdea6bf"
set image="ghcr.io/flybywiresim/dev-env@sha256:dfb8d94a2712b3ce744b649948881b4db4b93d245513d2eefdf553820b724d7f"

docker image inspect %image% 1> nul || docker system prune --filter label=flybywiresim=true -f
docker run --rm -it -v "%cd%:/external" %image% %*
2 changes: 1 addition & 1 deletion scripts/dev-env/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

IMAGE="ghcr.io/flybywiresim/dev-env@sha256:2cf75753022112a79d4a512caecfbdf601e12b01b382263cf78f90635cdea6bf"
IMAGE="ghcr.io/flybywiresim/dev-env@sha256:dfb8d94a2712b3ce744b649948881b4db4b93d245513d2eefdf553820b724d7f"

# only set `-it` if there is a tty
if [ -t 0 ] && [ -t 1 ];
Expand Down

0 comments on commit c8778be

Please sign in to comment.