Skip to content

Commit

Permalink
Added SpiderMonkey LTO to Windows Release CI
Browse files Browse the repository at this point in the history
Fixed File System Path Checks
  • Loading branch information
Redfire75369 committed Aug 12, 2024
1 parent 23bfb31 commit 2af23e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ jobs:
- name: Build Windows
if: matrix.os == 'windows'
env:
RUSTFLAGS: -Clto=fat -Cembed-bitcode=true -Clinker=lld-link
MOZ_LTO: full
CFLAGS: /clang:-flto
CPPFLAGS: " /clang:-flto"
RUSTFLAGS: -Clinker-plugin-lto -Clinker=lld-link
run: |
just build-release -v --target $env:TARGET
Rename-Item -Path .\target\$env:TARGET\release\cli.exe -NewName spiderfire.exe
Expand All @@ -78,8 +81,9 @@ jobs:
if: matrix.os == 'linux'
env:
MOZ_LTO: full
CFLAGS: -flto -fuse-ld=lld
CXXFLAGS: -flto -fuse-ld=lld
CFLAGS: -flto
CPPFLAGS: -flto
CXXFLAGS: -flto
LDFLAGS: -fuse-ld=lld
RUSTFLAGS: -Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld
run: |
Expand Down
20 changes: 10 additions & 10 deletions modules/src/fs/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,38 @@ use runtime::promise::future_to_promise;

fn check_exists(path: &Path) -> Result<()> {
if path.exists() {
Ok(())
} else {
Err(Error::new(
format!("Path {} does not exist", path.to_str().unwrap()),
None,
))
} else {
Ok(())
}
}

fn check_not_exists(path: &Path) -> Result<()> {
if !path.exists() {
Err(Error::new(format!("Path {} exist", path.to_str().unwrap()), None))
} else {
Ok(())
} else {
Err(Error::new(format!("Path {} exists", path.to_str().unwrap()), None))
}
}

fn check_is_file(path: &Path) -> Result<()> {
check_exists(path)?;
if path.is_file() {
Ok(())
} else {
Err(Error::new(
format!("Path {} is not a file", path.to_str().unwrap()),
None,
))
} else {
Ok(())
}
}

fn check_is_not_file(path: &Path) -> Result<()> {
check_exists(path)?;
if !path.is_file() {
if path.is_file() {
Err(Error::new(format!("Path {} is a file", path.to_str().unwrap()), None))
} else {
Ok(())
Expand All @@ -61,18 +61,18 @@ fn check_is_not_file(path: &Path) -> Result<()> {
fn check_is_dir(path: &Path) -> Result<()> {
check_exists(path)?;
if path.is_dir() {
Ok(())
} else {
Err(Error::new(
format!("Path {} is not a directory", path.to_str().unwrap()),
None,
))
} else {
Ok(())
}
}

fn check_is_not_dir(path: &Path) -> Result<()> {
check_exists(path)?;
if !path.is_dir() {
if path.is_dir() {
Err(Error::new(
format!("Path {} is a directory", path.to_str().unwrap()),
None,
Expand Down

0 comments on commit 2af23e2

Please sign in to comment.