Skip to content

Commit 3a70490

Browse files
Qardmcollina
authored andcommitted
Skip cargo test on Linux for now...
Because the Linux build happens in a docker task, the PHP headers are not available to build ext-php-rs, which is required to do the cargo test.
1 parent 0fb6c70 commit 3a70490

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ jobs:
298298
# TODO: This should be moved to the test jobs, but needs build deps
299299
# for ext-php-rs to build correctly, including PHP cli
300300
- name: Test crates
301+
if: ${{ contains(matrix.target, 'linux') }}
301302
shell: bash
302303
run: cargo test
303304
- name: Upload target-specific package for ${{ matrix.settings.target }}

crates/php/src/exception.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ impl std::fmt::Display for EmbedException {
2828
EmbedException::SapiNotInitialized => write!(f, "Failed to initialize SAPI"),
2929
EmbedException::SapiLockFailed => write!(f, "Failed to acquire SAPI lock"),
3030
EmbedException::SapiMissingStartupFunction => write!(f, "Missing SAPI startup function"),
31-
EmbedException::FailedToFindExeLocation => write!(f, "Failed to identify executable location"),
31+
EmbedException::FailedToFindExeLocation => {
32+
write!(f, "Failed to identify executable location")
33+
}
3234
EmbedException::DocRootNotFound(docroot) => write!(f, "Document root not found: {}", docroot),
3335
EmbedException::SapiNotStarted => write!(f, "Failed to start SAPI"),
3436
EmbedException::SapiRequestNotStarted => write!(f, "Failed to start SAPI request"),
@@ -39,8 +41,12 @@ impl std::fmt::Display for EmbedException {
3941
EmbedException::Exception(e) => write!(f, "Exception thrown: {}", e),
4042
EmbedException::Bailout => write!(f, "PHP bailout"),
4143
EmbedException::ResponseBuildError => write!(f, "Failed to build response"),
42-
EmbedException::FailedToFindCurrentDirectory => write!(f, "Failed to identify current directory"),
43-
EmbedException::ExpectedAbsoluteRequestUri(e) => write!(f, "Expected absolute REQUEST_URI: {}", e),
44+
EmbedException::FailedToFindCurrentDirectory => {
45+
write!(f, "Failed to identify current directory")
46+
}
47+
EmbedException::ExpectedAbsoluteRequestUri(e) => {
48+
write!(f, "Expected absolute REQUEST_URI: {}", e)
49+
}
4450
EmbedException::ScriptNotFound(e) => write!(f, "Script not found: {}", e),
4551
}
4652
}

crates/php/src/strings.rs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,16 @@ where
6464
{
6565
let docroot = docroot.as_ref().to_path_buf();
6666
let request_uri = request_uri.as_ref();
67-
let relative_uri = request_uri
68-
.strip_prefix("/")
69-
.map_err(|_| {
70-
let uri = request_uri.display().to_string();
71-
EmbedException::ExpectedAbsoluteRequestUri(uri)
72-
})?;
67+
let relative_uri = request_uri.strip_prefix("/").map_err(|_| {
68+
let uri = request_uri.display().to_string();
69+
EmbedException::ExpectedAbsoluteRequestUri(uri)
70+
})?;
7371

74-
let exact = docroot
75-
.join(relative_uri);
72+
let exact = docroot.join(relative_uri);
7673

77-
exact
78-
.join("index.php")
79-
.canonicalize()
80-
.or_else(|_| {
81-
exact
82-
.canonicalize()
83-
.map_err(|_| {
84-
EmbedException::ScriptNotFound(exact.display().to_string())
85-
})
86-
})
74+
exact.join("index.php").canonicalize().or_else(|_| {
75+
exact
76+
.canonicalize()
77+
.map_err(|_| EmbedException::ScriptNotFound(exact.display().to_string()))
78+
})
8779
}

0 commit comments

Comments
 (0)