Skip to content

nellshamrell/reproducible_build_basic_exp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reproducible_build_basic_exp

Simplified experiment based on https://github.com/kpcyrd/i-probably-didnt-backdoor-this, attempts to adapt it to Windows from demonstration purposes.

Run build

Requirements

  • Must be run on Windows
  • Docker installed
  • Rust installed

In PowerShell:

git clone [email protected]:nellshamrell/reproducible-build-basic-exp.git

# If you want to use a Docker container image I have uploaded to Docker Hub with a Windows Rust build environment
docker run --env RUSTFLAGS="--remap-path-prefix=\app=app -Clink-arg=/experimental:deterministic" --rm -v ${PWD}:C:\app -w /app nellshamrell/windows_rust_exp:0.0.1 cargo build --release --target=x86_64-pc-windows-msvc
docker run --env RUSTFLAGS="--remap-path-prefix=\app=app -Clink-arg=/experimental:deterministic" --rm -v ${PWD}:C:\app -w /app nellshamrell/windows_rust_exp:0.0.1 cargo build --release --locked --target=x86_64-pc-windows-msvc

# If you want to build this Docker image yourself
docker build . # This build will take awhile
docker image ls # Note the image ID of the image you just built
docker run --rm -v ${PWD}:C:\app -w /app <IMAGE ID> rustc --remap-path-prefix=\app=app -Clink-arg=/Brepro src\main.rs --target=x86_64-pc-windows-msvc

docker run --env RUSTFLAGS="--remap-path-prefix=\app=app -Clink-arg=/experimental:deterministic" --rm -v ${PWD}:C:\app -w /app <IMAGE ID> cargo build --release --target=x86_64-pc-windows-msvc
docker run --env RUSTFLAGS="--remap-path-prefix=\app=app -Clink-arg=/experimental:deterministic" --rm -v ${PWD}:C:\app -w /app <IMAGE ID> cargo build --release --locked --target=x86_64-pc-windows-msvc

Check hash of produced binary

In PowerShell:

Get-FileHash -Path .\main.exe

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published