Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions .github/workflows/cmake_arm64_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,18 @@ jobs:
build-and-test-arm64-macos-cmake:
name: Build and Test
runs-on: macos-latest
env:
cache-name: ${{github.job}}
cache-path: "./build"
steps:
- uses: actions/checkout@v6
- name: Set Build Parallelism
run: |
echo "NPROC=$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v6
- name: Check Python
run: python --version
- name: Install dependendcies
run: |
python3 -m pip install --break-system-packages absl-py cython
- name: Restore CMake cache
uses: actions/cache/restore@v5
id: cmake-cache-restore
with:
path: ${{env.cache-path}}
key: cmake-cache-${{env.cache-name}}
restore-keys: cmake-cache-${{env.cache-name}}-
- name: Configure
run: >-
cmake -S . -B build
Expand All @@ -60,13 +53,7 @@ jobs:
-DOPENFST_ENABLE_CATEGORIAL=ON
- name: Build
run: |
cmake --build build -j$(nproc)
cmake --build build -j "$NPROC"
- name: Test
run: |
ctest --test-dir build --output-on-failure -j$(nproc)
- name: Save new cache for main
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v5
with:
path: ${{env.cache-path}}
key: cmake-cache-${{env.cache-name}}-${{github.run_id}}
ctest --test-dir build --output-on-failure -j "$NPROC"
23 changes: 5 additions & 18 deletions .github/workflows/cmake_x64_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,18 @@ jobs:
build-and-test-x64-linux-cmake:
name: Build and Test
runs-on: ubuntu-latest
env:
cache-name: ${{github.job}}
cache-path: "./build"
steps:
- uses: actions/checkout@v6
- name: Set Build Parallelism
run: |
echo "NPROC=$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v6
- name: Check Python
run: python --version
- name: Install dependendcies
run: |
python3 -m pip install --break-system-packages absl-py cython
- name: Restore CMake cache
uses: actions/cache/restore@v5
id: cmake-cache-restore
with:
path: ${{env.cache-path}}
key: cmake-cache-${{env.cache-name}}
restore-keys: cmake-cache-${{env.cache-name}}-
- name: Configure
run: >-
cmake -S . -B build
Expand All @@ -60,13 +53,7 @@ jobs:
-DOPENFST_ENABLE_CATEGORIAL=ON
- name: Build
run: |
cmake --build build -j$(nproc)
cmake --build build -j "$NPROC"
- name: Test
run: |
ctest --test-dir build --output-on-failure -j$(nproc)
- name: Save new cache for main
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v5
with:
path: ${{env.cache-path}}
key: cmake-cache-${{env.cache-name}}-${{github.run_id}}
ctest --test-dir build --output-on-failure -j "$NPROC"
4 changes: 3 additions & 1 deletion openfst/extensions/far/sttable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "openfst/extensions/far/sttable.h"

#include <cstdint>
#include <ios>
#include <string>

#include "absl/strings/string_view.h"
Expand All @@ -27,7 +28,8 @@
namespace fst {

bool IsSTTable(absl::string_view source) {
file::FileInStream strm((std::string(source)));
file::FileInStream strm(std::string(source),
std::ios_base::in | std::ios_base::binary);
if (!strm.good()) return false;

int32_t magic_number = 0;
Expand Down
Loading