Skip to content

[libvncserver] New port for LibVNCServer 0.9.15 - #51243

Draft
Felipe Andrade Allemand Borges (fborges22) wants to merge 20 commits into
microsoft:masterfrom
fborges22:libvncserver
Draft

[libvncserver] New port for LibVNCServer 0.9.15#51243
Felipe Andrade Allemand Borges (fborges22) wants to merge 20 commits into
microsoft:masterfrom
fborges22:libvncserver

Conversation

@fborges22

@fborges22 Felipe Andrade Allemand Borges (fborges22) commented Apr 18, 2026

Copy link
Copy Markdown

Adds new port libvncserver at version 0.9.15 with port-version 1.
Uses authoritative upstream source from the LibVNC GitHub repository and pinned SHA512.
Removes uncontrolled optional dependency path by dropping the libsshtunnel feature.
Regenerates version database entries with x-add-version.

  • Changes comply with the maintainer guide.
  • The packaged project shows strong association with the chosen port name. Check this box if at least one of the following criteria is met:
    • The project is in Repology: https://repology.org/project/libvncserver/versions
    • The project is amongst the first web search results for "" or " C++". Include a screenshot of the search engine results in the PR.
    • The port name follows the 'GitHubOrg-GitHubRepo' form or equivalent Owner-Project form.
  • Optional dependencies of the build are all controlled by the port. A dependency is controlled if it is declared an unconditional dependency in vcpkg.json, or explicitly disabled through patches or build system arguments such as CMAKE_DISABLE_FIND_PACKAGE_Xxx or VCPKG_LOCK_FIND_PACKAGE
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is brief and accurate. See adding-usage for context. Don't add a usage file if the automatically generated usage is correct.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Exactly one version is added in each modified versions file.

@fborges22

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@BillyONeal

Copy link
Copy Markdown
Member
  • The port name follows the 'GitHubOrg-GitHubRepo' form or equivalent Owner-Project form

I unchecked this because that form would be libvnc-libvncserver. (It's unnecessary in this case because repology conquers all for naming purposes. We need to see one of those boxes checked which https://repology.org/project/libvncserver/versions meets)

@BillyONeal Billy O'Neal (BillyONeal) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please consider the other comments here, fix the checks to pass, then mark Ready for review. Thanks for the new port!

Comment thread ports/libvncserver/vcpkg.json Outdated
Comment thread ports/libvncserver/vcpkg.json Outdated
Comment thread ports/libvncserver/portfile.cmake Outdated
Comment thread ports/libvncserver/vcpkg.json Outdated
Comment thread ports/libvncserver/vcpkg.json Outdated
Comment thread ports/libvncserver/vcpkg.json Outdated
Comment thread ports/libvncserver/vcpkg.json Outdated
Comment thread ports/libvncserver/vcpkg.json Outdated
Comment thread versions/l-/libvncserver.json
Comment thread ports/libvncserver/vcpkg.json Outdated
@BillyONeal
Billy O'Neal (BillyONeal) marked this pull request as draft April 20, 2026 23:36
Comment thread ports/libvncserver/portfile.cmake Outdated
@vicroms

Copy link
Copy Markdown
Member

AI Review


vcpkg CI Failure Report

Build: #130184
PR: #51243 - [libvncserver] New port for LibVNCServer 0.9.15
Triggered by: Pull Request — GitHub
Branch: refs/pull/51243/merge
Result:Failed | Finished: 2026-04-18 19:05:16 UTC


Summary

PR #51243 adds a new port libvncserver (version 0.9.15) with comprehensive feature support. All 13 triplets failed with compilation errors in the port's example code.

Triplet Status Failed Ports Root Cause
arm-neon-android ❌ Failed 4 Missing time.h include for clock_gettime
arm64-android ❌ Failed 4 Missing time.h include for clock_gettime
x64-android ❌ Failed 4 Missing time.h include for clock_gettime
arm64-linux ❌ Failed 6 Missing time.h include for clock_gettime
x64-linux ❌ Failed 5 Missing time.h include for clock_gettime
arm_neon_android ❌ Failed 4 Missing time.h include for clock_gettime
x64-windows ❌ Failed 20 Header syntax errors in rfb/rfbclient.h
x86-windows ❌ Failed 20 Header syntax errors in rfb/rfbclient.h
x64-windows-static ❌ Failed 20 Header syntax errors in rfb/rfbclient.h
x64-windows-static-md ❌ Failed 20 Header syntax errors in rfb/rfbclient.h
arm64-windows ❌ Failed 20 Header syntax errors in rfb/rfbclient.h
arm64-windows-static-md ❌ Failed 20 Header syntax errors in rfb/rfbclient.h
arm64-osx ❌ Failed ? Likely missing includes like Linux
TOTAL 13 triplets Systemic upstream compatibility issue

🔴 New Regressions (All Critical)

Root Cause: Upstream Source Compatibility Issues

This is a new port being added, so all failures are regressions relative to the "no port" baseline. The failures fall into two categories:

1. Linux/Android: Missing time.h for clock_gettime()

Affected triplets: arm-neon-android, arm64-android, x64-android, arm64-linux, x64-linux

Error Example:

error: call to undeclared function 'clock_gettime'; ISO C99 and later do not support 
implicit function declarations [-Wimplicit-function-declaration]

Location: examples/client/vnc2mpg.c:462:5

Analysis:
The upstream libvncserver source code uses clock_gettime() without including <time.h>. While this may work with older C standards or specific compiler configurations in the upstream development environment, modern C99/C11 standards with stricter error handling (as enabled by vcpkg) require explicit function declarations.

Impact: All feature combinations that trigger the examples feature (including ffmpeg, gtk, qt, sdl, xcb variants) fail.

Files in this log category:

  • libvncserver_all_25 (all 25 default features)
  • libvncserver_ffmpeg (core + ffmpeg example)
  • libvncserver_gcrypt (core + gcrypt crypto backend)
  • libvncserver_gtk (core + GTK example)
  • libvncserver_qt (core + Qt example)
  • libvncserver_sasl (core + SASL)
  • libvncserver_sdl (core + SDL example)

Workaround needed: Add #include <time.h> to examples/client/vnc2mpg.c or patch via vcpkg portfile.


2. Windows (All variants): Header Syntax Errors

Affected triplets: x64-windows, x86-windows, x64-windows-static, x64-windows-static-md, arm64-windows, arm64-windows-static-md

Error Example:

D:\b\libvncserver\src\ver-0.9.15-062b58a1e5.clean\include\rfb/rfbclient.h(474): 
error C2059: syntax error: ';'

Analysis:
The MSVC compiler is encountering syntax errors in the header file include/rfb/rfbclient.h at lines 474 and 492. The errors suggest:

  • Missing semicolon or closing brace in a struct/function declaration
  • Incompatible POSIX function declarations that are not properly guarded for Windows

Since this is the main header file (not examples), all feature combinations fail, including the core library itself without any optional features.

Impact: The port is completely unusable on Windows platforms until header compatibility is resolved.

Files affected:

  • All 20 feature combinations on Windows (core + various features all depend on the main headers)

Likely cause: The upstream source may be primarily developed/tested on Unix-like systems and may have POSIX-specific code in headers that lacks proper Windows guards (#ifdef _WIN32 / #ifdef __CYGWIN__).


ℹ️ Detailed Findings by Triplet

Linux-based Triplets (arm64-linux)

  • Failed ports: libvncserver_all_25, libvncserver_ffmpeg, libvncserver_gcrypt, libvncserver_gtk, libvncserver_qt, libvncserver_sasl, libvncserver_sdl
  • Common error: call to undeclared function 'clock_gettime'
  • Compiler: Clang 21.0.0
  • Severity: High — blocks all examples-based features

Android Triplets (arm-neon-android, arm64-android, x64-android)

  • Failed ports: libvncserver_ffmpeg, libvncserver_gcrypt, libvncserver_qt, libvncserver_sdl
  • Common error: call to undeclared function 'clock_gettime'
  • Compiler: Clang (NDK r29)
  • Severity: High — Android builds share the same C standard issue as Linux
  • Note: Smaller subset of failures compared to Linux suggests different default features or build configuration

Windows Triplets (all variants)

  • Failed ports: All 20 feature combinations per triplet
    • libvncserver_core (no optional features)
    • libvncserver_allow-24bpp, ipv6, jpeg, lzo, png, threads, websockets, zlib (single features)
    • libvncserver_ffmpeg, gcrypt, gnutls, gtk, qt, sasl, sdl, ssl, systemd, tests, vncclient, vncserver, xcb (individual example features)
  • Common error: error C2059: syntax error: ';' at rfb/rfbclient.h(474)
  • Compiler: MSVC 19.44.35222.0 (Visual Studio 2022)
  • Severity: Critical — no configurations work; headers are incompatible with MSVC
  • Diagnosis: POSIX code (likely function pointers or struct member declarations) in headers without Windows guards

macOS (arm64-osx)

  • Status: Failed (no detailed log available in this analysis)
  • Expected: Likely similar to Linux given shared Unix-like characteristics
  • Note: Should be monitored when port is fixed

🔧 Recommended Actions

Immediate Actions (Blocking PR Merge)

  1. For Linux/Android (clock_gettime issue):

    • Add #include <time.h> at the top of examples/client/vnc2mpg.c (upstream source)
    • OR add a patch in the vcpkg portfile to inject this include before compilation
    • Test fix on one triplet (e.g., arm64-linux) first
  2. For Windows (header syntax errors):

    • Review include/rfb/rfbclient.h around lines 474–500 for POSIX-isms
    • Look for:
      • Bare function pointer declarations (should be wrapped in #ifndef _WIN32)
      • POSIX struct members (e.g., fd_set, time_t usage without proper includes)
      • Platform-specific types not defined on Windows
    • Add appropriate #ifdef guards or provide Windows-compatible alternatives
    • Consider upstream patches or conditional compilation via CMakeLists.txt
  3. Verification:

    • Run full feature test suite on at least one triplet from each category (Linux, Windows, Android)
    • Confirm that core library builds and examples build successfully
    • Check that optional dependencies (ffmpeg, Qt, GTK, etc.) integrate correctly

Secondary Actions (Post-Fix)

  1. File issue with upstream LibVNC repository if not already reported
  2. Document any patches applied in the portfile for future maintenance
  3. Consider stricter example-building tests in CI to catch these issues earlier

Notes

  • Port Status: This is a new port being added by PR [libvncserver] New port for LibVNCServer 0.9.15 #51243; all failures are "new regressions" relative to the port not existing.
  • Upstream Version: LibVNCServer 0.9.15 (stable release from GitHub)
  • Build Environment: vcpkg-tool from 2026-04-08, scripts from 2026-04-18
  • Feature Scope: PR attempts to add comprehensive feature support (25+ optional features), but this amplifies the exposure of compatibility issues
  • Windows Impact: The header incompatibility on Windows is more severe than the Linux clock_gettime issue, affecting even minimal builds (core library without examples)

Summary for PR Author

PR #51243 cannot be merged until the following issues are resolved:

  1. Add #include <time.h> to examples/client/vnc2mpg.c (or patch via portfile) to fix Linux/Android builds
  2. Fix header compatibility in include/rfb/rfbclient.h to support MSVC (Windows) builds
  3. Re-run CI to confirm all triplets pass

The underlying issues are in the upstream libvncserver source code compatibility with:

  • Modern C standards (-Wimplicit-function-declaration errors on Linux/Android)
  • Windows platform headers (syntax errors in rfb/rfbclient.h)

These are not vcpkg-specific issues but upstream compatibility problems that need to be addressed in the port's source or patched by the vcpkg portfile.

@Neustradamus

Copy link
Copy Markdown

Felipe Andrade Allemand Borges (@fborges22): Have you seen all Billy O'Neal (@BillyONeal) comments?

@fborges22

Copy link
Copy Markdown
Author

Yes. I am analyzing them and implementing the suggestions. Soon, I will summit the commits.

@fborges22

Copy link
Copy Markdown
Author

It has been a while, but I am returned. Here is the new commit with the requested implementations. Please review and feel free for more suggestions and request. 😃

@fborges22
Felipe Andrade Allemand Borges (fborges22) marked this pull request as ready for review June 25, 2026 21:00
…res for feature-driven configuration

The hardcoded -DWITH_* options were conflicting with the vcpkg_check_features call.
Keep only the essential, always-on options (THREADS, IPv6, 24BPP, shared libs preference).
Let  handle all feature-driven dependencies.
For a new port on first merge, port-version should be 0 or omitted,
not 3. The port-version 3 was from development iterations and should
be reset for the official vcpkg release.
…tures by default

By explicitly setting -DWITH_*=OFF for optional features, we let CMake properly handle
feature selection through vcpkg_check_features(). This prevents the library from attempting
auto-detection of optional dependencies on non-x64 platforms, which was causing failures.
The vcpkg_check_features() call still properly enables features when selected.

Fixes BUILD_FAILED on arm64-windows, arm64-osx, x64-linux, arm64-linux, and Android platforms.
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.

4 participants