mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #293] [MERGED] Simplify librespot-protocol build caching. #864
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#864
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/293
Author: @willstott101
Created: 2/23/2019
Status: ✅ Merged
Merged: 9/11/2019
Merged by: @ashthespy
Base:
master← Head:protobuf-codegen-pure📝 Commits (1)
97f61ecProtobuf 2.4.0, generate all proto files every time, but only write when changed, supporting poor souls with crlf line ending conversion.📊 Changes
5 files changed (+50 additions, -97 deletions)
View changed files
📝
Cargo.lock(+1 -0)📝
protocol/Cargo.toml(+1 -0)📝
protocol/build.rs(+46 -85)➖
protocol/files.rs(+0 -10)📝
protocol/src/lib.rs(+2 -2)📄 Description
Whilst on my laptop the github desktop app cloned this repo with crlf line endings. This threw off the crc checking in the protobuf build script. Triggering a rebuild using protoc...
I'm on Windows and installing protoc is a fiddle. With the aim of very slowly making librespot easier to use and distribute on Windows I switched to using the
protobuf-codegen-purecrate.When playing with this I found out the existing string replacement technique could end up corrupting files.rs (if one checksum was a substring of another). That may only be possible when manually changing the checksums to trigger builds though...
Regardless I decided to just get rid of the shell/cksum/protoc dependencies altogether, and have a completely rust based build system for the protobuf files.
When trying to get rid of the shell script I moved the CRCs to the lib.rs file. I'm also now using an existing crate to calculate the checksum as there's no need to be compatible withcksum.Now this PR removes the checksum system in favour of trusting cargo to run build.rs at the right times, and always re-generating the rust files. However the regenerated files are only written to disc (triggering a proper rebuild) when those resulting files have actually changed (whole-sale string comparison). This avoids all kinds of caching problems, and makes the code simpler IMO.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.