Skip to content

Commit 2af23e2

Browse files
committed
Added SpiderMonkey LTO to Windows Release CI
Fixed File System Path Checks
1 parent 23bfb31 commit 2af23e2

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ jobs:
6363
- name: Build Windows
6464
if: matrix.os == 'windows'
6565
env:
66-
RUSTFLAGS: -Clto=fat -Cembed-bitcode=true -Clinker=lld-link
66+
MOZ_LTO: full
67+
CFLAGS: /clang:-flto
68+
CPPFLAGS: " /clang:-flto"
69+
RUSTFLAGS: -Clinker-plugin-lto -Clinker=lld-link
6770
run: |
6871
just build-release -v --target $env:TARGET
6972
Rename-Item -Path .\target\$env:TARGET\release\cli.exe -NewName spiderfire.exe
@@ -78,8 +81,9 @@ jobs:
7881
if: matrix.os == 'linux'
7982
env:
8083
MOZ_LTO: full
81-
CFLAGS: -flto -fuse-ld=lld
82-
CXXFLAGS: -flto -fuse-ld=lld
84+
CFLAGS: -flto
85+
CPPFLAGS: -flto
86+
CXXFLAGS: -flto
8387
LDFLAGS: -fuse-ld=lld
8488
RUSTFLAGS: -Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld
8589
run: |

modules/src/fs/fs.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,38 @@ use runtime::promise::future_to_promise;
2020

2121
fn check_exists(path: &Path) -> Result<()> {
2222
if path.exists() {
23+
Ok(())
24+
} else {
2325
Err(Error::new(
2426
format!("Path {} does not exist", path.to_str().unwrap()),
2527
None,
2628
))
27-
} else {
28-
Ok(())
2929
}
3030
}
3131

3232
fn check_not_exists(path: &Path) -> Result<()> {
3333
if !path.exists() {
34-
Err(Error::new(format!("Path {} exist", path.to_str().unwrap()), None))
35-
} else {
3634
Ok(())
35+
} else {
36+
Err(Error::new(format!("Path {} exists", path.to_str().unwrap()), None))
3737
}
3838
}
3939

4040
fn check_is_file(path: &Path) -> Result<()> {
4141
check_exists(path)?;
4242
if path.is_file() {
43+
Ok(())
44+
} else {
4345
Err(Error::new(
4446
format!("Path {} is not a file", path.to_str().unwrap()),
4547
None,
4648
))
47-
} else {
48-
Ok(())
4949
}
5050
}
5151

5252
fn check_is_not_file(path: &Path) -> Result<()> {
5353
check_exists(path)?;
54-
if !path.is_file() {
54+
if path.is_file() {
5555
Err(Error::new(format!("Path {} is a file", path.to_str().unwrap()), None))
5656
} else {
5757
Ok(())
@@ -61,18 +61,18 @@ fn check_is_not_file(path: &Path) -> Result<()> {
6161
fn check_is_dir(path: &Path) -> Result<()> {
6262
check_exists(path)?;
6363
if path.is_dir() {
64+
Ok(())
65+
} else {
6466
Err(Error::new(
6567
format!("Path {} is not a directory", path.to_str().unwrap()),
6668
None,
6769
))
68-
} else {
69-
Ok(())
7070
}
7171
}
7272

7373
fn check_is_not_dir(path: &Path) -> Result<()> {
7474
check_exists(path)?;
75-
if !path.is_dir() {
75+
if path.is_dir() {
7676
Err(Error::new(
7777
format!("Path {} is a directory", path.to_str().unwrap()),
7878
None,

0 commit comments

Comments
 (0)