-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional versioned server file checker #5172
base: dev
Are you sure you want to change the base?
Conversation
If users have downloaded prebuilt server file, they may forget to update the server file simply because they are all named "scrcpy-server". It is already known to cause issues when server and client versions mismatch. Let it check for "scrcpy-server-v<VERSION>" first (just as how it is named in Github release page), then fall back to "scrcpy-server". This mechanism is fully optional: users may still use the old unversioned name "scrcpy-server"; or they can directly download server file from release page without renaming it, and they will be notified to update their server file because client cannot find either files (with the correct version).
I am not keen on checking several filenames for the server. I'm not sure to understand why you need this: this code is for the case For downloading a separate server binary (#5171 (comment)), could you include a script in your package, similar to For example, something like this (to be installed to #!/usr/bin/env bash
set -e
VERSION=2.6.1
PREBUILT_SERVER_URL="https://github.com/Genymobile/scrcpy/releases/download/v$VERSION/scrcpy-server-v$VERSION"
PREBUILT_SERVER_SHA256=ca7ab50b2e25a0e5af7599c30383e365983fa5b808e65ce2e1c1bba5bfe8dc3b
if echo "$PREBUILT_SERVER_SHA256 /usr/bin/scrcpy-server" | sha256sum --check
then
echo "[scrcpy] Server $VERSION already up to date"
exit 0
fi
echo "[scrcpy] Downloading prebuilt server..."
wget "$PREBUILT_SERVER_URL" -O scrcpy-server # adapt to use some temporary directory
echo "[scrcpy] Verifying prebuilt server..."
echo "$PREBUILT_SERVER_SHA256 scrcpy-server" | sha256sum --check
sudo cp scrcpy-server /usr/share/
echo "[scrcpy] Server $VERSION installed" |
My proposed Debian update does use PORTABLE build. However, I'd like to make generalized feature proposals for all potential users, and in this case, non-Windows users may accidentally use mismatched server if they copy self-built client everywhere. This version checker helps to prevent this event. For Windows build I'd keep current behavior intact. |
Why? The purpose of portable is basically to put |
I just hit this bug. I tried to build 2.6.1, but the version is still pointing to 2.6, so scrcpy refused to start. Looks like it needs to be retagged?
I built it by running |
The correct way currently is to always execute The other valid way is to checkout the tag Also see #4098 (comment). |
Thanks. I was not familiar with tag naming conventions. |
If users have downloaded prebuilt server file, they may forget to update the server file simply because they are all named "scrcpy-server". It is already known to cause issues when server and client versions mismatch. Let it check for "scrcpy-server-v" first (just as how it is named in Github release page), then fall back to "scrcpy-server".
This mechanism is fully optional: users may still use the old unversioned name "scrcpy-server"; or they can directly download server file from release page without renaming it, and they will be notified to update their server file because client cannot find either files (with the correct version).