Skip to content

Update openfst to 1.8.5#22

Merged
csukuangfj merged 4 commits intok2-fsa:masterfrom
csukuangfj:update-openfst-1.8.5
Apr 10, 2026
Merged

Update openfst to 1.8.5#22
csukuangfj merged 4 commits intok2-fsa:masterfrom
csukuangfj:update-openfst-1.8.5

Conversation

@csukuangfj
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the project version, refactors CMake configurations for better portability and Windows support, and adjusts the Python package structure. I have provided feedback regarding the removal of hardcoded local paths in CMake files, a potential issue with RPATH construction, a suggestion to use relative imports in Python, and a concern regarding the breaking change to the package distribution name.

Comment on lines +10 to +14
$ENV{HOME}/Downloads/kaldifst-1.8.0.tar.gz
${CMAKE_SOURCE_DIR}/kaldifst-1.8.0.tar.gz
${CMAKE_BINARY_DIR}/kaldifst-1.8.0.tar.gz
/tmp/kaldifst-1.8.0.tar.gz
/star-fj/fangjun/download/github/kaldifst-1.8.0.tar.gz
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of possible file locations contains a hardcoded absolute path that is specific to a local development environment. This should be removed to ensure the build remains portable and does not leak local system information.

    $ENV{HOME}/Downloads/kaldifst-1.8.0.tar.gz
    ${CMAKE_SOURCE_DIR}/kaldifst-1.8.0.tar.gz
    ${CMAKE_BINARY_DIR}/kaldifst-1.8.0.tar.gz
    /tmp/kaldifst-1.8.0.tar.gz

endif()

if(NOT WIN32)
target_link_libraries(_kaldi_decoder PRIVATE "-Wl,-rpath,${KALDI_DECODER_RPATH_ORIGIN}/kaldi_decoder/lib")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The rpath construction appears to be incorrect. Since the library _kaldi_decoder is installed directly into the lib directory (i.e., kaldi_decoder/lib/ relative to the prefix), ${KALDI_DECODER_RPATH_ORIGIN} (which expands to $ORIGIN on Linux or @loader_path on macOS) already points to that directory. Appending /kaldi_decoder/lib creates a non-existent nested path like .../kaldi_decoder/lib/kaldi_decoder/lib.

  target_link_libraries(_kaldi_decoder PRIVATE "-Wl,-rpath,${KALDI_DECODER_RPATH_ORIGIN}")

@@ -1,4 +1,4 @@
from _kaldi_decoder import (
from kaldi_decoder.lib._kaldi_decoder import (
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a relative import is more idiomatic and robust here. It avoids hardcoding the package name, which makes the code more maintainable if the package is ever renamed or vendored.

Suggested change
from kaldi_decoder.lib._kaldi_decoder import (
from .lib._kaldi_decoder import (



package_name = "kaldi-decoder"
package_name = "kaldi_decoder"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Changing the distribution name from kaldi-decoder to kaldi_decoder is a breaking change for users who install the package via PyPI or depend on it in requirements.txt. It is also inconsistent with the repository name and the project URL. Unless this change is intentional for a specific branding reason, it is recommended to keep the hyphenated name for the distribution.

Suggested change
package_name = "kaldi_decoder"
package_name = "kaldi-decoder"

@csukuangfj csukuangfj merged commit 62fda2d into k2-fsa:master Apr 10, 2026
58 of 60 checks passed
@csukuangfj csukuangfj deleted the update-openfst-1.8.5 branch April 10, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant