X Tutup
Skip to content

Build Documentation#13540

Open
logiclrd wants to merge 12 commits intorustdesk:masterfrom
logiclrd:build-documentation-and-script-debug
Open

Build Documentation#13540
logiclrd wants to merge 12 commits intorustdesk:masterfrom
logiclrd:build-documentation-and-script-debug

Conversation

@logiclrd
Copy link
Contributor

This PR adds a file BUILDING.md which details the steps needed to take an unconfigured system and get it set up to reliably build RustDesk. The sequence has been tested on Windows, multiple times on Linux, and sort-of on OS X.

There is also a small adjustment to build.py so that it can be leveraged to do Debug builds as well as Release builds. This allows the process of building and running locally to very closely mirror the C.I. and release processes.

For OS X, I managed to get access to an OS X VM and the build runs to completion. flutter run doesn't show any errors, but the application window never appears. I don't know how to diagnose this. I do wonder if it has something to do with code signing, since the project file references a specific Team that I am of course not a part of for certificates. I'm well out of my depth in this area, though.

The key change for OS X is that project.pbxproj hardcodes its reference to liblibrustdesk.dylib to the target/release directory. This makes me suspect that actually presently nobody runs RustDesk debug builds on OS X. But, in order to make flutter run work with a debug build of the Rust code, I came up with a way to make the project work with both configurations. I updated the reference to liblibrustdesk.dylib to pull it from an intermediate directory, and I added a Script Build Phase that stages the appropriate Rust build output file into that common intermediate location.

@gabefair
Copy link

Hello,
Can you sync your branch with master and provide screenshots of your change and it working?

…e command-line:

- Moved the initialization of globals into a def initialize so that it can use make_parser(). Updated main() to call initialize().
- Added an argument definition for --debug in make_parser().
- Added globals: release_flag, debug_flag, configuration and configuration_lower.
- Updated all hardcoded "release" strings to reference configuration/configuration_lower.
Updated external invocations of POSIX shell utilities in build.py to use Python abstractions instead so that it can run on Windows.
…tu 25.10 installation.

Fixed PATH variable export in the Flutter section.
…hich copies target/{debug|release}/liblibrustdesk.dylib into a common directory platform/flutter/macos/librustdesk.

Updated the source path for the liblibrustdesk.dylib file reference to pull it from this common folder.
Updated .gitignore to exclude the intermediate platform/macos/librustdesk.
Updated BUILDING.md with changes for OS X.
…rename of rustdesk.exe to RustDesk.exe on Windows in build.py.
@logiclrd logiclrd force-pushed the build-documentation-and-script-debug branch from c8eb1df to 2af2ded Compare January 30, 2026 19:22
…e flags set after checking for --debug above the call to make_parser in initialize() in build.py , since they can affect what the parser supports.

Added missing 'f' formatted string literal prefix character to the initialization of flutter_build_dir.
Switched flutter invocations to use {debug_flag} instead of {release_flag}.
@logiclrd
Copy link
Contributor Author

I've observed it working on Windows. I tried running through the steps afresh in my test Linux VM (from a clean baseline), and I ran into an apparent Rust compiler bug (an Internal Compilation Error during hbb_common, but only when it's being compiled from the root, not if I cargo build inside libs/hbb_common). It looks like the script is still working on Linux, I just don't have it end-to-end.

@logiclrd
Copy link
Contributor Author

Here's the build on Windows with this branch:

buildtest.html

@logiclrd
Copy link
Contributor Author

Okay I got unblocked on that. There was a mistake in the flags to flutter build but this latest version runs to completion and produces a .deb file. I wonder if it would be worth adding a flag to make it skip the packaging, kind of like --skip-portable-pack in the Windows flow.

@logiclrd
Copy link
Contributor Author

This is the tail end of python build.py --debug --flutter on Linux:

image

Copy link

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Yeah, I encountered that build error, heh.

… or a newer, incompatible GCC version in BUILDING.md to recommend setting the CC and CXX environment variables, rather than updating alternatives or adjusting a system-wide symlink in `/usr/bin`.
@gabefair
Copy link

gabefair commented Feb 1, 2026

@logiclrd
Copy link
Contributor Author

logiclrd commented Feb 1, 2026

Some build instructions used by NixOS https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/ru/rustdesk-flutter/package.nix

These are not instructions for a human 😛

There are some interesting things in there 🙂

https://github.com/NixOS/nixpkgs/blob/3ab3bf806bd38c82f463bd55c9dadacf9cd34e08/pkgs/by-name/ru/rustdesk-flutter/package.nix#L80C3-L80C71

env.VCPKG_ROOT = "/homeless-shelter"; # idk man, makes the build go [..]

Co-authored-by: Jubilee <workingjubilee@gmail.com>
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.

3 participants

X Tutup