-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyoxidizer musl execution on VMware ESXi #110
Comments
I haven't tested on ESXi yet, so I also didn't expect it to work out of the box. I don't have the time to work on this myself right now, so if you're willing to look into some things, that'd be appreciated! Looks like there might be some possibility of modifying the Python interpreter configuration from the PyOxidizer configuration file: We've already tackled this issue on our internal Python interpreter, so I'll see if I can dig up what worked there. As a temporary workaround, you may also try to temporarily enable the proc filesystem on ESXi: vsish -e set /config/User/intOpts/UserProcEnable 1 |
Both suggestions did not resolve the issue, because the second argument given to I am looking into the option to manually set the variable https://pyoxidizer.readthedocs.io/en/stable/pyembed_interpreter_config.html#exe-field Or adjusting the code to do this dynamically with support for VMware ESXi. |
Looks like we set this to I expect that some patching will be required in order to run PyOxidizer on ESXi. We can probably host those under https://github.com/fox-it. |
The function main.rs
// https://doc.rust-lang.org/std/env/fn.current_exe.html
// rustup target add x86_64-unknown-linux-musl
// rustc -g --target=x86_64-unknown-linux-musl main.rs
use std::env::consts::OS;
fn main() {
println!("The OS is: {}", OS);
let _exe_path = std::env::current_exe();
println!("Path of this executable is: {}", _exe_path.expect("REASON").display());
}
# VMware ESXi execution
RUST_BACKTRACE=full ./main
The OS is: linux
thread 'main' panicked at main.rs:10:58:
REASON: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }
[...]
strace ./main
[...]
readlink("/proc/self/exe", 0x96d0ead840, 256) = -1 EINVAL (Invalid argument)
[...] As far as I known this can only be resolved by adding VMware ESXi support to Rust and the underlying libraries for the functions used by Pyoxidizer to setup the Python interpreter (rust-lang/rust#41347) |
I have not extensively tested this yet, but I believe this should work too: fox-it/PyOxidizer@8a0a13c |
Using the Pyoxidizer configuration (#109) I was able to build a static musl binary, but when executing the binary on VMware ESXi 7 the execution fails while it works on the Docker image (quay.io/pypa/manylinux2014_x86_64).
The error as shown below is triggered because it cannot obtain the current path of the executable, because
/self/proc/exe
(https://github.com/indygreg/PyOxidizer/blob/b78b0cb75f4317c45408bbc9a569c062c482c679/pyembed/src/config.rs#L478) is not available on VMware ESXi 7.I don't understand well enough how Pyoxidizer works to determine what causes this error and how this issue can be resolved, but I will look into this.
*VMWare ESXi 7*
*quay.io/pypa/manylinux2014_x86_64*
*Alpine Linux 3.18*
The text was updated successfully, but these errors were encountered: