Ver código fonte

bump version

Dean 利迪恩 1 mês atrás
pai
commit
94a03cad6d
4 arquivos alterados com 13 adições e 10 exclusões
  1. 6 5
      Cargo.lock
  2. 4 4
      Cargo.toml
  3. 1 1
      src/byteparser.rs
  4. 2 0
      src/lib.rs

+ 6 - 5
Cargo.lock

@@ -811,9 +811,9 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
 
 [[package]]
 name = "sbpf-assembler"
-version = "0.1.2"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe35fff08463e7e57b675d7cbf4fe103f84195246a0660d120fa81ccc1ed4eb3"
+checksum = "710619faf0e63487a8c05c0215e099a9667f3c39f158f9b741eadf2d08a24672"
 dependencies = [
  "anyhow",
  "num-derive",
@@ -821,6 +821,7 @@ dependencies = [
  "object",
  "phf",
  "phf_macros",
+ "sbpf-common",
  "serde",
  "serde-wasm-bindgen",
  "thiserror 2.0.17",
@@ -829,9 +830,9 @@ dependencies = [
 
 [[package]]
 name = "sbpf-common"
-version = "0.1.2"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39a8ff075e738e3850c291334f6f7e45379ad442366f3f4b1f9f9bf0674fa61d"
+checksum = "8083ad286378a14dc2e4a783749798bbc1bef5ce1fb00b90e56e65a571484252"
 dependencies = [
  "num-derive",
  "num-traits",
@@ -839,7 +840,7 @@ dependencies = [
 
 [[package]]
 name = "sbpf-linker"
-version = "0.1.3"
+version = "0.1.5"
 dependencies = [
  "aya-rustc-llvm-proxy",
  "bpf-linker",

+ 4 - 4
Cargo.toml

@@ -1,7 +1,7 @@
 [package]
 name = "sbpf-linker"
 edition = "2024"
-version = "0.1.3"
+version = "0.1.5"
 authors = ["Claire Fan <claire@blueshift.gg>"]
 description = "Upstream BPF linker for SBPF V0 programs"
 license = "MIT"
@@ -17,12 +17,12 @@ name = "sbpf_linker"
 
 [dependencies]
 # TODO: update versions for sbpf-assembler and sbpf-common
-sbpf-assembler = "0.1.2"
-sbpf-common = "0.1.2"
+sbpf-assembler = "0.1.5"
+sbpf-common = "0.1.5"
 clap = { version = "4.5.13", features = ["derive"] }
 object = "0.37.3"
 bpf-linker = "0.9.15"
-thiserror = "2.0.12"
+thiserror = "2.0.17"
 
 aya-rustc-llvm-proxy = { version = "0.9.5", optional = true }
 llvm-sys-19 = { package = "llvm-sys", features = ["disable-alltargets-init"], version = "191.0.0", optional = true }

+ 1 - 1
src/byteparser.rs

@@ -66,7 +66,7 @@ pub fn parse_bytecode(bytes: &[u8]) -> Result<ParseResult, SbpfLinkerError> {
                 let node = &section.data().unwrap()[offset..offset + node_len];
                 let instruction = Instruction::from_bytes(node);
                 if let Err(error) = instruction {
-                    return Err(error.to_string());
+                    return Err(SbpfLinkerError::InstructionParseError(error.to_string()));
                 } else {
                     ast.nodes.push(ASTNode::Instruction {
                         instruction: instruction.unwrap(),

+ 2 - 0
src/lib.rs

@@ -18,6 +18,8 @@ pub enum SbpfLinkerError {
     LlvmDiagnosticError,
     #[error("Build Program Error. Error details: {errors:?}.")]
     BuildProgramError { errors: Vec<CompileError> },
+    #[error("Instruction Parse Error. Error detail: ({0}).")]
+    InstructionParseError(String),
 }
 
 pub fn link_program(source: &[u8]) -> Result<Vec<u8>, SbpfLinkerError> {