rust-embed icon indicating copy to clipboard operation
rust-embed copied to clipboard

Rust-embed cannot find embedded files if binary has been copied between Docker images in debug mode

Open kevaundray opened this issue 1 year ago • 0 comments

A proof of concept with CI failing and more comments are located here: https://github.com/kevaundray/poc-rust-embed

Reproduce

I am doing the following things in Docker:

  • Compiling a Rust program and creating a binary
  • Creating a fresh layer from an Ubuntu image
  • Copying the binary over to that fresh layer.

In release mode this works fine, in debug mode unless debug-embed is enabled, this will panic.

Documentation

The documentation says:

In debug and when debug-embed feature is not enabled, the folder path is resolved relative to where the binary is run from.

In release or when debug-embed feature is enabled, the folder path is resolved relative to where Cargo.toml is.

I think the edge case is that in debug mode, if I do not copy the binary then it runs fine, but if I do copy the binary to another layer, it produces an error

kevaundray avatar Jul 20 '24 09:07 kevaundray