Skip to content

Commit 5f113fa

Browse files
committed
Update cargo handling
subprojects/ignore-result--rs.wrap works around a name resolution bug in meson-1.6.1. Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
1 parent 41d9a56 commit 5f113fa

File tree

48 files changed

+60
-1139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+60
-1139
lines changed

.gitignore

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
build
22
subprojects/packagecache
33

4-
subprojects/anstyle-[0-9]*
5-
subprojects/bitflags-[0-9]*
6-
subprojects/clap-[0-9]*
7-
subprojects/clap_builder-[0-9]*
8-
subprojects/clap_lex-[0-9]*
9-
subprojects/ignore-result-[0-9]*
10-
subprojects/indoc-[0-9]*
11-
subprojects/io-lifetimes-[0-9]*
12-
subprojects/itoa-[0-9]*
13-
subprojects/libc-[0-9]*
14-
subprojects/linux-raw-sys-[0-9]*
15-
subprojects/proc-macro2-[0-9]*
16-
subprojects/quote-[0-9]*
17-
subprojects/rustix-[0-9]*
18-
subprojects/ryu-[0-9]*
19-
subprojects/serde-[0-9]*
20-
subprojects/serde_derive-[0-9]*
21-
subprojects/serde_json-[0-9]*
22-
subprojects/syn-[0-9]*
23-
subprojects/terminal_size-[0-9]*
24-
subprojects/unicode-ident-[0-9]*
25-
subprojects/unindent-[0-9]*
4+
subprojects/*
5+
!subprojects/*.wrap

meson.build

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ project(
22
'refivar',
33
'rust',
44
version: '0.1',
5-
meson_version: '>= 1.2.0',
6-
default_options: [
7-
'warning_level=3',
8-
'rust_std=2021'
9-
]
5+
meson_version: '>= 1.4.0',
6+
default_options: {
7+
'warning_level': '3',
8+
'rust_std': '2021'
9+
}
1010
)
1111

1212
fs = import('fs')
@@ -17,11 +17,11 @@ if rustc.version().version_compare('<1.70')
1717
error('rustc 1.70 required. Found ' + rustc.version())
1818
endif
1919

20-
clap_rs_dep = dependency('clap-rs', version: '>=4.1.13')
21-
ignore_result_rs_dep = dependency('ignore-result-rs', version: '>=0.2.0')
22-
indoc_rs_dep = dependency('indoc-rs', version: '>=2.0.3')
23-
serde_json_rs_dep = dependency('serde_json-rs', version: '>=1.0.96')
24-
serde_rs_dep = dependency('serde-rs', version: '>=1.0.160')
20+
clap_rs_dep = dependency('clap-4-rs', version: '>=4.5.8')
21+
ignore_result_rs_dep = dependency('ignore-result-0.2-rs', version: '>=0.2.0')
22+
indoc_rs_dep = dependency('indoc-2-rs', version: '>=2.0.5')
23+
serde_json_rs_dep = dependency('serde_json-1-rs', version: '>=1.0.119')
24+
serde_rs_dep = dependency('serde-1-rs', version: '>=1.0.203')
2525

2626
fqDataDir = get_option('prefix') / get_option('datadir') / 'refivar'
2727

@@ -83,7 +83,7 @@ lib_refivar = static_library(
8383
],
8484
}
8585
),
86-
rust_crate_type: 'lib',
86+
rust_abi: 'rust',
8787
dependencies: [
8888
indoc_rs_dep,
8989
serde_json_rs_dep,

src/lib/efivar/efi_guids.rs

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::efi_guids_list_path;
22
use crate::types::EfiGuid;
33
use crate::types::EfiGuidListEntry;
4-
use serde::Deserialize;
54
use std::collections::HashMap;
65
use std::fs::File;
76
use std::io::{BufReader, Error};
@@ -18,13 +17,6 @@ pub struct EfiGuidList {
1817
guids_map: Option<HashMap<String, EfiGuidListEntry>>,
1918
}
2019

21-
#[derive(Deserialize)]
22-
struct JsonEfiGuidListEntry {
23-
name: String,
24-
description: String,
25-
guid: String,
26-
}
27-
2820
impl Default for EfiGuidList {
2921
fn default() -> Self {
3022
Self::new()
@@ -39,25 +31,18 @@ impl EfiGuidList {
3931
pub fn load(&mut self, path: &String) -> Result<(), Error> {
4032
let mut map: HashMap<String, EfiGuidListEntry> = HashMap::new();
4133
let reader = BufReader::new(File::open(path)?);
42-
let result: serde_json::Result<Vec<JsonEfiGuidListEntry>> = serde_json::from_reader(reader);
34+
let result: serde_json::Result<Vec<EfiGuidListEntry>> = serde_json::from_reader(reader);
4335
match result {
4436
Ok(v) => {
4537
for entry in v {
46-
match entry.guid.parse::<EfiGuid>() {
47-
Ok(g) => {
48-
map.insert(
49-
entry.name.clone(),
50-
EfiGuidListEntry {
51-
guid: g,
52-
name: entry.name.clone(),
53-
description: entry.description,
54-
},
55-
);
56-
}
57-
Err(_) => {
58-
eprintln!("Entry with UUID: {} invalid. Skipping...", entry.guid);
59-
}
60-
};
38+
map.insert(
39+
entry.name.clone(),
40+
EfiGuidListEntry {
41+
guid: entry.guid,
42+
name: entry.name.clone(),
43+
description: entry.description,
44+
},
45+
);
6146
}
6247
}
6348
Err(e) => return Err(e.into()),

src/lib/efivar/types/efi_guid_list_entry.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::types::efi_guid::EfiGuid;
2+
use serde::de::{Deserialize};
23
use std::fmt;
34

45
#[derive(PartialEq)]
@@ -8,6 +9,15 @@ pub struct EfiGuidListEntry {
89
pub description: String,
910
}
1011

12+
impl<'de> Deserialize<'de> for EfiGuidListEntry {
13+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
14+
where
15+
D: serde::Deserializer<'de>,
16+
{
17+
todo!()
18+
}
19+
}
20+
1121
impl fmt::Display for EfiGuidListEntry {
1222
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1323
write!(

subprojects/anstyle-rs.wrap

Lines changed: 0 additions & 10 deletions
This file was deleted.

subprojects/bitflags-rs.wrap

Lines changed: 0 additions & 10 deletions
This file was deleted.

subprojects/clap-rs.wrap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[wrap-file]
2-
directory = clap-4.3.0
3-
4-
source_url = https://crates.io/api/v1/crates/clap/4.3.0/download
5-
source_filename = clap-4.3.0.tar.gz
6-
source_hash = 93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc
7-
patch_directory = clap-4.3.0
2+
directory = clap-4.5.8
3+
source_url = https://crates.io/api/v1/crates/clap/4.5.8/download
4+
source_filename = clap-4.5.8.tar.gz
5+
source_hash = 84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d
6+
method = cargo
87

98
[provide]
10-
clap-rs = clap_rs_dep
9+
dependency_names = clap-4-rs

subprojects/clap_builder-rs.wrap

Lines changed: 0 additions & 10 deletions
This file was deleted.

subprojects/clap_lex-rs.wrap

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
directory = ignore-result-0.2.0
33

44
source_url = https://crates.io/api/v1/crates/ignore-result/0.2.0/download
5-
source_filename = ignore-result.tar.gz
5+
source_filename = ignore-result-0.2.tar.gz
66
source_hash = 665ff4dce8edd10d490641ccb78949832f1ddbff02c584fb1f85ab888fe0e50c
7-
patch_directory = ignore-result-0.2.0
7+
method = cargo
88

99
[provide]
10-
ignore-result-rs = ignore_result_rs_dep
10+
dependency_names = ignore-result-0.2-rs

0 commit comments

Comments
 (0)