Skip to content

Commit

Permalink
Merge pull request #895 from messense/rm-libs-dir
Browse files Browse the repository at this point in the history
Remove unused `libs_dir` field from `PythonInterpreter`
  • Loading branch information
messense authored May 3, 2022
2 parents 44e7959 + b4b2683 commit e9b8838
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
5 changes: 1 addition & 4 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ pub fn find_interpreter(
ext_suffix: ext_suffix.to_string(),
interpreter_kind,
abi_tag,
libs_dir: PathBuf::from(cross_lib_dir),
platform: None,
runnable: false,
}];
Expand Down Expand Up @@ -744,7 +743,7 @@ pub fn find_interpreter(
// Unfortunately, on windows we need one to figure out base_prefix for a linker
// argument.
if target.is_windows() {
if let Some(manual_base_prefix) = std::env::var_os("PYO3_CROSS_LIB_DIR") {
if env::var_os("PYO3_CROSS_LIB_DIR").is_some() {
// PYO3_CROSS_LIB_DIR should point to the `libs` directory inside base_prefix
// when cross compiling, so we fake a python interpreter matching it
println!("⚠️ Cross-compiling is poorly supported");
Expand All @@ -757,7 +756,6 @@ pub fn find_interpreter(
ext_suffix: ".pyd".to_string(),
interpreter_kind: InterpreterKind::CPython,
abi_tag: None,
libs_dir: PathBuf::from(manual_base_prefix),
platform: None,
runnable: false,
}])
Expand All @@ -776,7 +774,6 @@ pub fn find_interpreter(
ext_suffix: ".pyd".to_string(),
interpreter_kind: InterpreterKind::CPython,
abi_tag: None,
libs_dir: PathBuf::new(),
platform: None,
runnable: false,
}])
Expand Down
2 changes: 0 additions & 2 deletions src/get_interpreter_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"platform": sysconfig.get_platform(),
# This one isn't technically necessary, but still very useful for sanity checks
"system": platform.system().lower(),
# We need this one for windows abi3 builds
"base_prefix": sys.base_prefix,
}

print(json.dumps(metadata))
4 changes: 0 additions & 4 deletions src/python_interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ struct IntepreterMetadataMessage {
// comes from `platform.system()`
system: String,
abi_tag: Option<String>,
base_prefix: String,
}

/// The location and version of an interpreter
Expand Down Expand Up @@ -287,8 +286,6 @@ pub struct PythonInterpreter {
///
/// Note that this always `None` on windows
pub abi_tag: Option<String>,
/// We need this value for windows abi3 linking
pub libs_dir: PathBuf,
/// Comes from `sysconfig.get_platform()`
///
/// Note that this can be `None` when cross compiling
Expand Down Expand Up @@ -528,7 +525,6 @@ impl PythonInterpreter {
.context("syconfig didn't define an `EXT_SUFFIX` ಠ_ಠ")?,
interpreter_kind: interpreter,
abi_tag: message.abi_tag,
libs_dir: PathBuf::from(message.base_prefix).join("libs"),
platform,
runnable: true,
}))
Expand Down

0 comments on commit e9b8838

Please sign in to comment.