Commit fc3917b0 authored by Tobias Koppers's avatar Tobias Koppers

only enable verify_serialization for TaskType

parent 9c0774c7
...@@ -13,10 +13,12 @@ bench = false ...@@ -13,10 +13,12 @@ bench = false
workspace = true workspace = true
[features] [features]
default = ["trace_task_dirty", "verify_immutable"] default = ["trace_task_dirty", "verify_immutable", "verify_serialization3"]
print_cache_item_size = [] print_cache_item_size = []
no_fast_stale = [] no_fast_stale = []
verify_serialization = [] verify_serialization3 = []
verify_serialization2 = []
verify_serialization1 = []
verify_aggregation_graph = [] verify_aggregation_graph = []
verify_immutable = [] verify_immutable = []
trace_aggregation_update = [] trace_aggregation_update = []
......
...@@ -665,7 +665,7 @@ fn serialize_task_type( ...@@ -665,7 +665,7 @@ fn serialize_task_type(
POT_CONFIG POT_CONFIG
.serialize_into(&**task_type, &mut task_type_bytes) .serialize_into(&**task_type, &mut task_type_bytes)
.with_context(|| anyhow!("Unable to serialize task {task_id} cache key {task_type:?}"))?; .with_context(|| anyhow!("Unable to serialize task {task_id} cache key {task_type:?}"))?;
#[cfg(feature = "verify_serialization")] #[cfg(feature = "verify_serialization3")]
{ {
let deserialize: Result<CachedTaskType, _> = serde_path_to_error::deserialize( let deserialize: Result<CachedTaskType, _> = serde_path_to_error::deserialize(
&mut pot_de_symbol_list().deserializer_for_slice(&*task_type_bytes)?, &mut pot_de_symbol_list().deserializer_for_slice(&*task_type_bytes)?,
...@@ -749,7 +749,7 @@ where ...@@ -749,7 +749,7 @@ where
fn serialize(task: TaskId, data: &Vec<CachedDataItem>) -> Result<SmallVec<[u8; 16]>> { fn serialize(task: TaskId, data: &Vec<CachedDataItem>) -> Result<SmallVec<[u8; 16]>> {
Ok(match pot_serialize_small_vec(data) { Ok(match pot_serialize_small_vec(data) {
#[cfg(not(feature = "verify_serialization"))] #[cfg(not(feature = "verify_serialization1"))]
Ok(value) => value, Ok(value) => value,
_ => { _ => {
let mut error = Ok(()); let mut error = Ok(());
...@@ -760,7 +760,7 @@ fn serialize(task: TaskId, data: &Vec<CachedDataItem>) -> Result<SmallVec<[u8; 1 ...@@ -760,7 +760,7 @@ fn serialize(task: TaskId, data: &Vec<CachedDataItem>) -> Result<SmallVec<[u8; 1
let mut serializer = symbol_map.serializer_for(&mut buf).unwrap(); let mut serializer = symbol_map.serializer_for(&mut buf).unwrap();
if let Err(err) = serde_path_to_error::serialize(&item, &mut serializer) { if let Err(err) = serde_path_to_error::serialize(&item, &mut serializer) {
if item.is_optional() { if item.is_optional() {
#[cfg(feature = "verify_serialization")] #[cfg(feature = "verify_serialization1")]
println!("Skipping non-serializable optional item for {task}: {item:?}"); println!("Skipping non-serializable optional item for {task}: {item:?}");
} else { } else {
error = Err(err).context({ error = Err(err).context({
...@@ -769,7 +769,7 @@ fn serialize(task: TaskId, data: &Vec<CachedDataItem>) -> Result<SmallVec<[u8; 1 ...@@ -769,7 +769,7 @@ fn serialize(task: TaskId, data: &Vec<CachedDataItem>) -> Result<SmallVec<[u8; 1
} }
false false
} else { } else {
#[cfg(feature = "verify_serialization")] #[cfg(feature = "verify_serialization1")]
{ {
let deserialize: Result<CachedDataItem, _> = let deserialize: Result<CachedDataItem, _> =
serde_path_to_error::deserialize( serde_path_to_error::deserialize(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment