Formatting, cleanup and Rust 2021 compatibility

pmeunier
Jun 7, 2025, 12:01 PM
7Q4257EPUSDGELWJYF23GKUXGJGOB2QJGPKN3JS3C272IEX6EQ2QC

Dependencies

  • [2] SI454P2V Documentation and cleanup
  • [3] UWQB743K First working shell (with ocaml code)
  • [4] ODUDDQRY Adding the OCaml interface
  • [5] 5PJAXSZ7 Elfedit: correct reallocation of dynstr/dynamic
  • [6] ZV57M4VN Debugging
  • [7] AR2X3TLA Initial commit: introducing elfedit

Change contents

  • replacement in src/mount.rs at line 1
    [3.50][3.0:48]()
    use libc::{MS_BIND, MS_PRIVATE, mount, umount};
    [3.50]
    [3.87]
    use libc::{mount, umount, MS_BIND, MS_PRIVATE};
  • replacement in src/extract.rs at line 1
    [3.19587][3.17158:17213]()
    use crate::{Client, Downloaded, Error, find_files::*};
    [3.19587]
    [3.19628]
    use crate::{find_files::*, Client, Downloaded, Error};
  • edit in src/deb.rs at line 377
    [3.44534][3.44534:44555]()
    IResult, Parser,
  • edit in src/deb.rs at line 380
    [3.44651]
    [3.44651]
    IResult, Parser,
  • replacement in src/deb/index.rs at line 1
    [3.51880][3.51881:51917]()
    use super::{Stanza, parse_control};
    [3.51880]
    [3.51933]
    use super::{parse_control, Stanza};
  • replacement in src/container.rs at line 1
    [3.44692][3.44693:44735]()
    use crate::{Error, find_files::*, mount};
    [3.44692]
    [3.44735]
    use crate::{find_files::*, mount, Error};
  • replacement in elpe/lib/dune at line 11
    [3.72883][3.72883:72940]()
    pbrt
    ocaml-protoc-plugin
    tar
    tar.gz
    tar-unix))
    [3.72883]
    [3.62510]
    ocaml-protoc-plugin))
  • replacement in elpe/dune-project at line 22
    [3.63041][3.73053:73140]()
    (depends ocaml lwt grpc-lwt h2-lwt-unix pbrt ocaml-protoc-plugin protoc tar tar-unix)
    [3.63041]
    [3.63115]
    (depends ocaml lwt grpc-lwt h2-lwt-unix ocaml-protoc-plugin protoc)
  • replacement in elfedit/src/lib.rs at line 183
    [3.5590][3.103:140]()
    Sht(u32::from_le(e.0.0))
    [3.5590]
    [3.5628]
    Sht(u32::from_le(e.0 .0))
  • replacement in elfedit/src/lib.rs at line 185
    [3.5670][3.141:178]()
    Sht(u32::from_be(e.0.0))
    [3.5670]
    [3.212]
    Sht(u32::from_be(e.0 .0))
  • replacement in elfedit/src/lib.rs at line 267
    [3.1462][3.179:216]()
    Pht(u32::from_le(e.0.0))
    [3.1462]
    [3.1500]
    Pht(u32::from_le(e.0 .0))
  • replacement in elfedit/src/lib.rs at line 269
    [3.1542][3.217:254]()
    Pht(u32::from_be(e.0.0))
    [3.1542]
    [3.1580]
    Pht(u32::from_be(e.0 .0))
  • replacement in elfedit/src/lib.rs at line 1872
    [3.38493][3.38493:38569]()
    pub fn needed(&self) -> impl Iterator<Item = Result<&'a CStr, Error>> {
    [3.38493]
    [3.38569]
    pub fn needed<'b>(&'b self) -> impl Iterator<Item = Result<&'a CStr, Error>> + 'b {
  • replacement in elfedit/src/lib.rs at line 1969
    [3.21866][3.6107:6160]()
    DynTag32(EndianT::endian(Endian(e.0.0), id))
    [3.21866]
    [3.21920]
    DynTag32(EndianT::endian(Endian(e.0 .0), id))
  • replacement in elfedit/src/lib.rs at line 1981
    [3.22024][3.6161:6214]()
    DynTag64(EndianT::endian(Endian(e.0.0), id))
    [3.22024]
    [3.41634]
    DynTag64(EndianT::endian(Endian(e.0 .0), id))
  • replacement in elfedit/Cargo.toml at line 4
    [3.46595][3.46595:46612]()
    edition = "2024"
    [3.46595]
    [3.46612]
    edition = "2021"
  • replacement in default.nix at line 133
    [3.69791][3.69791:69896]()
    propagatedBuildInputs = with pkgs; [
    ocamlPackages.ocaml-protoc
    ocamlPackages.pbrt
    [3.69791]
    [3.69896]
    buildInputs = with pkgs; [
    ocamlPackages.ocaml-protoc-plugin
  • edit in default.nix at line 136
    [3.69926][3.69926:69968](),[3.69968][3.78562:78595]()
    ocamlPackages.ocaml-protoc-plugin
    tar
    tar-lwt-unix
  • edit in default.nix at line 138
    [3.70005]
    [3.70005]
    protobuf
  • replacement in default.nix at line 140
    [3.70014][3.70014:70042]()
    nativeBuildInputs = [
    [3.70014]
    [3.70042]
    nativeBuildInputs = with pkgs; [
    ocamlPackages.ocaml-protoc-plugin
  • edit in default.nix at line 144
    [3.70068]
    [3.70068]
    propagatedBuildInputs = with pkgs; [
    ocaml
    ocamlPackages.ocaml-protoc-plugin
    ocamlPackages.findlib
    grpc-lwt
    h2-lwt-unix
    ];
    buildPhase = "dune build";
    postInstall = ''
    mkdir -p $out/bin
    cp _build/default/bin/elpe_bin.exe $out/bin/elpe
    '';
  • edit in default.nix at line 157
    [3.70075]
    [3.70075]
    elpe_rs = (pkgs.callPackage ./Cargo.nix {
    inherit pkgs;
    defaultCrateOverrides = pkgs.defaultCrateOverrides // {
    elpe = attrs: {
    nativeBuildInputs = [ pkgs.protobuf ];
    PROTOC="${protobuf}/bin/protoc";
    };
    };
    }).workspaceMembers.elpe.build.overrideAttrs (attrs: {
    postInstall = "mv $out/bin/elpe $out/bin/elpe-server";
    });
  • replacement in default.nix at line 172
    [3.70122][3.70122:70205](),[3.70216][3.70216:70364](),[3.70364][3.78596:78672](),[3.78672][3.70364:70431](),[3.70364][3.70364:70431](),[3.70431][2.9485:9494](),[2.9494][3.70440:70646](),[3.78684][3.70440:70646](),[3.70440][3.70440:70646]()
    buildInputs = [
    openssl nettle zstd.dev sequoia-sq
    xz.dev
    pkg-config
    ocaml
    opam
    ocamlPackages.ocaml
    ocamlPackages.dune_3
    ocamlPackages.ocaml-protoc
    ocamlPackages.pbrt
    ocamlPackages.findlib
    ocamlPackages.core
    ocamlPackages.core_unix
    tar
    tar-lwt-unix
    ocamlPackages.ocaml-protoc-plugin
    grpc-lwt
    h2-lwt-unix
    elpe
    ocamlformat
    protobuf
    checksec
    linuxPackages_latest.perf
    ];
    nativeBuildInputs = [pkg-config b3sum];
    LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
    PROTOC="${protobuf}/bin/protoc";
    [3.70122]
    [3.70646]
    phases = [ "installPhase" "fixupPhase" ];
    propagatedBuildInputs = [ sequoia-sq elpe elpe_rs ];
    installPhase = "mkdir $out";
  • replacement in Cargo.toml at line 4
    [3.71059][3.71059:71076]()
    edition = "2024"
    [3.71059]
    [3.71076]
    edition = "2021"