fix weird PDDB dependency issue

more of a work-around than anything else. the observation is
the PDDB_A* series of constants aren't used outide of the crate
for gen2-targets and so we just remove it as a dependency in
the lib.rs side of things.

This clears up the cargo error we're getting. still don't know
why the dependency tree is not working for that particular target,
but someone is pulling a pddb dependency and it's not obvious who.
This commit is contained in:
bunnie 2025-05-11 14:40:19 +08:00
parent fbcb59c69e
commit f76dd23067
5 changed files with 9 additions and 8 deletions

View file

@ -91,7 +91,7 @@ gen1 = [
"modals",
"precursor-hal",
]
gen2 = ["keystore", "keystore-api/gen2", "cramium-hal"]
gen2 = ["keystore", "keystore-api/gen2"]
# gen 1 targets
precursor = ["utralib/precursor", "sha2/precursor", "gen1"]
hosted = ["utralib/hosted", "sha2/hosted", "gen1"]
@ -119,7 +119,7 @@ board-baosor = [
] # Precursor form factor
# board-dabao is not a valid target as it lacks external SPI flash
doc-deps = []
doc-deps = ["precursor-hal"]
# when selected, physical disk addresses are set to 64 bits, otherwise, they are 32 bits.
# 32 bit addressing is recommended for Precursor, as its disk is only 128MiB and it has limited RAM for bookkeeping.

View file

@ -55,12 +55,8 @@ pub(crate) const PDDB_A_LEN: usize = precursor_hal::board::PDDB_LEN as usize;
not(feature = "gen2")
))]
pub const PDDB_A_LEN: usize = 4 * 1024 * 1024;
#[cfg(feature = "gen2")]
pub const PDDB_A_LEN: usize = cramium_hal::board::PDDB_LEN as usize;
#[cfg(feature = "gen1")]
pub const PDDB_A_LOC: u32 = precursor_hal::board::PDDB_LOC as u32;
#[cfg(feature = "gen2")]
pub const PDDB_A_LOC: u32 = cramium_hal::board::PDDB_LOC as u32;
/// range for the starting point of a journal number, picked from a random seed
/// the goal is to reduce info leakage about the age of structures relative to each other

View file

@ -6,7 +6,7 @@ use std::io::prelude::*;
use std::mem::MaybeUninit;
use std::sync::Once;
use crate::api::*;
use crate::{PDDB_A_LEN, PDDB_A_LOC};
// This is considered bad practice for Rust to use a global singleton.
// However, this hack puts the burden of emulation on the emulator, while

View file

@ -28,7 +28,7 @@ use sha2::{Digest, Sha512_256Hw, Sha512_256Sw};
use spinor::{SPINOR_BULK_ERASE_SIZE, SPINOR_ERASE_SIZE};
use subtle::ConstantTimeEq;
use crate::api::PDDB_A_LOC;
use crate::PDDB_A_LOC;
use crate::*;
#[cfg(not(feature = "deterministic"))]

View file

@ -485,6 +485,11 @@ use rkyv::{
use xous::{Message, msg_blocking_scalar_unpack, send_message};
use xous_ipc::Buffer;
#[cfg(feature = "gen2")]
pub const PDDB_A_LEN: usize = PDDB_LEN as usize;
#[cfg(feature = "gen2")]
pub const PDDB_A_LOC: u32 = PDDB_LOC as u32;
#[cfg(feature = "perfcounter")]
const FILE_ID_SERVICES_PDDB_SRC_MAIN: u32 = 0;
#[cfg(feature = "perfcounter")]