diff --git a/newsfragments/4043.fixed.md b/newsfragments/4043.fixed.md
new file mode 100644
index 00000000..7653eb29
--- /dev/null
+++ b/newsfragments/4043.fixed.md
@@ -0,0 +1 @@
+Don't panic when `PYO3_CROSS_LIB_DIR` is set to a missing path.
\ No newline at end of file
diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs
index 1c50c842..3dc1e912 100644
--- a/pyo3-build-config/src/impl_.rs
+++ b/pyo3-build-config/src/impl_.rs
@@ -1206,7 +1206,7 @@ fn ends_with(entry: &DirEntry, pat: &str) -> bool {
/// Returns `None` if the library directory is not available, and a runtime error
/// when no or multiple sysconfigdata files are found.
fn find_sysconfigdata(cross: &CrossCompileConfig) -> Result