Skip to content

Commit

Permalink
Refactor some auto splitter and linking code (LiveSplit#40)
Browse files Browse the repository at this point in the history
This updates all of our dependencies, in particular `livesplit-core` now
uses the latest version of `wasmtime` again, it was stuck on an old
version. While updating I noticed that `hyperx` has upper bounds for all
of its dependencies, which made me rip out that dependency, which led me
to refactor a bunch of the auto splitting code. A lot more of the auto
splitting code now resides within that module, the error messages use
`anyhow` to build a nice chain of reasoning for the errors and removing
the `hyperx` crate forced me to modify retrieving the file name of the
downloaded files. The file names are now simply extracted from the URL,
which should honestly be fine. This should've been done as at least a
backup to the `Content-Disposition` header anyway. Maybe we can
eventually bring the `Content-Disposition` handling back.

Additionally, this now links against `OBS` differently on Windows. Rust
recently stabilized support for `raw-dylib`. On Windows you usually link
against `.lib` files, not against `.dll`s. Sometimes you may want to
link against a `.dll` however that you don't have a `.lib` file for.
With `raw-dylib` as the link type, you can now skip the `.lib` file
entirely on Windows and still link against a `.dll`. In fact, you still
don't need a `.dll`, so we can now skip building our fake `.dll` on
Windows entirely. We also don't need it anymore on macOS as we for now
link against the real framework provided by OBS there.
  • Loading branch information
CryZe authored Sep 10, 2023
1 parent 2d9992b commit 27d6eb2
Show file tree
Hide file tree
Showing 6 changed files with 828 additions and 730 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build_shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ main() {
FEATURE_FLAGS="--no-default-features --features $FEATURES"
fi

if [ "$OS_NAME" = "windows-latest" ]; then
$cargo build -p obs --target $TARGET $release_flag $FEATURE_FLAGS
cp target/$TARGET/$target_folder/obs.dll.lib ./obs.lib
fi

$cargo build --target $TARGET $release_flag $FEATURE_FLAGS

if [ "$OS_NAME" = "macOS-latest" ]; then
Expand Down
Loading

0 comments on commit 27d6eb2

Please sign in to comment.