Weird error occurs when targeting wasm32-unknown-emscripten #2220
-
I am trying to compile my simple pyo3 library to the
As I know, +
++ edit fn load_cross_compile_config(
cross_compile_config: CrossCompileConfig,
) -> Result<InterpreterConfig> {
match cargo_env_var("CARGO_CFG_TARGET_FAMILY") {
// Configure for unix platforms using the sysconfigdata file
Some(os) if os == "unix" => load_cross_compile_from_sysconfigdata(cross_compile_config),
// Use hardcoded interpreter config when targeting Windows
Some(os) if os == "windows" => windows_hardcoded_cross_compile(cross_compile_config),
// sysconfigdata works fine on wasm/wasi
Some(os) if os == "wasm" => load_cross_compile_from_sysconfigdata(cross_compile_config),
// The modified line
Some(os) if os == "unix,wasm" => load_cross_compile_from_sysconfigdata(cross_compile_config),
// Waiting for users to tell us what they expect on their target platform
Some(os) => bail!(
"Unknown target OS family for cross-compilation: {:?}.\n\
\n\
Please set the PYO3_CONFIG_FILE environment variable to a config suitable for your \
target interpreter.",
os
),
// Unknown os family - try to do something useful
None => load_cross_compile_from_sysconfigdata(cross_compile_config),
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@km19809 try ensuring It's hard to know what to suggest, given you say you modified the source code. |
Beta Was this translation helpful? Give feedback.
-
Hmm, I have no experience with emscripten, but this bit looks relevant:
If you can find a way to configure the build to turn that option off, it'll probably complete fine. Otherwise, you will presumably need to compile |
Beta Was this translation helpful? Give feedback.
@km19809 try ensuring
PYO3_PRINT_CONFIG
env var is unset?It's hard to know what to suggest, given you say you modified the source code.