Commit graph

53 commits

Author SHA1 Message Date
Eduardo Dantas
d2e7b0f049
ci(vcpkg): keep baseline updates synchronized and auto-mergeable (#1803)
ci(vcpkg): keep baseline updates synchronized and auto-mergeable

Improve the vcpkg baseline updater so automated dependency PRs stay synchronized with main and can be queued for native GitHub auto-merge.

Main changes:
- Fetch full repository history before updating the baseline branch.
- Synchronize the updater branch with the latest origin/main before applying baseline changes.
- Rebase existing updater branches onto main.
- Create missing updater branches directly from origin/main.
- Use force-with-lease when refreshing bot-managed branches.
- Restrict existing PR lookup to open baseline PRs targeting main.
- Queue both existing and newly created baseline PRs for native GitHub squash auto-merge.
- Set a consistent squash commit subject and body for automated baseline merges.
- Validate PR numbers before attempting to enable auto-merge.
- Warn and leave the PR open when auto-merge cannot be queued.
- Continue triggering CI when the requested baseline is already present.
- Update CI path filters so changes to update_vcpkg_baseline.yml trigger Windows, macOS, Android, Docker, and browser validation.

Safety:
- The updater does not approve reviews.
- The updater does not bypass branch protection.
- Auto-merge remains subject to required reviews and status checks.
- Branch rewrites use force-with-lease instead of an unconditional force push.

Validation:
- actionlint passed.
- YAML parsing passed.
- Extracted updater shell script passed bash -n.
- git diff --check passed.

This makes automated vcpkg baseline maintenance more reliable by preventing stale update branches and allowing GitHub to complete the merge once all repository requirements are satisfied.
2026-08-14 17:57:51 -03:00
Eduardo Dantas
4a2de8de5f
fix(cache): canonicalize manifest line endings (#1802)
fix(cache): canonicalize vcpkg manifest line endings

Normalize manifest line endings when generating shared build-cache fingerprints so equivalent vcpkg configurations use the same dependency pool regardless of Git checkout settings.

Root cause:
- Equivalent Git content can be checked out using CRLF or LF depending on core.autocrlf and local Git configuration.
- The previous shared-cache resolver hashed raw manifest bytes.
- Two otherwise equivalent worktrees could therefore resolve to different dependency fingerprints and separate vcpkg pools.

Main changes:
- Normalize CRLF and LF when fingerprinting vcpkg.json.
- Normalize CRLF and LF when fingerprinting vcpkg-configuration.json.
- Keep registry, overlay, port, patch, and arbitrary payload trees byte-signatured because their contents may be line-ending-sensitive.
- Advance the shared-cache contract from schema v3 to schema v4.
- Retain recognition of schemas v1 through v3 for auditing and transient cleanup.
- Require an exact full-fingerprint metadata match before cleaning fingerprint-specific transient data.
- Keep shortened cache directory names backed by full SHA-256 identity metadata.
- Update shared-cache setup and cleanup tooling for the v4 layout.
- Update documentation with v4 fingerprinting behavior, migration rules, cleanup procedures, and cache paths.

Windows build updates:
- Move Windows CI to the Visual Studio 2026 hosted runner.
- Verify that Visual Studio 2026 provides the native C++ v145 toolset.
- Configure MSBuild discovery specifically for the Visual Studio 18.x prerelease range.
- Remove the previous Chocolatey-based Visual Studio toolset installation path.

Validation:
- Reproduced the Release x64 dependency contract in two worktrees with different manifest line endings.
- Verified both worktrees now resolve to the same schema v4 dependency fingerprint.
- Ran SharedBuildCache.cmake in CMake script mode.
- Verified the windows-release preset listing.
- Ran PowerShell parser checks.
- Ran JSON parsing checks.
- Ran documentation portability checks.
- Ran git diff --check.

This keeps shared vcpkg cache identity stable across CRLF and LF checkouts while preserving byte-sensitive hashing for dependency content where physical file representation can affect behavior.
2026-08-14 17:56:59 -03:00
Eduardo Dantas
44a980b07e
build(cache): share vcpkg dependencies across CMake and Visual Studio (#1800)
Add shared vcpkg dependency cache for CMake and Visual Studio builds

This commit adds a content addressed vcpkg dependency cache that can be reused across compatible Git worktrees independent forks CMake presets and Visual Studio Solution builds.

The goal is to reduce repeated dependency installation and rebuild time while keeping build outputs isolated per worktree. The cache only shares dependency artifacts that are proven compatible through a complete dependency contract. Project build outputs such as object files PCH files PDB files generated sources intermediate files and executables remain local to each checkout.

The shared cache is opt in. When the cache is not configured or when the resolver cannot prove that reuse is safe both CMake and Visual Studio fall back to local worktree specific vcpkg roots.

Main behavior added

• Shares vcpkg downloads globally

• Shares vcpkg binary packages globally

• Shares expanded vcpkg installed trees only when the dependency fingerprint matches

• Shares vcpkg buildtrees and packages only when the dependency fingerprint matches

• Keeps CMake build trees local to each worktree

• Keeps Visual Studio output directories local to each worktree

• Keeps generated files intermediate files executables PCH files PDB files and object files local

• Allows compatible Git worktrees to reuse dependency artifacts

• Allows compatible forks to reuse dependency artifacts

• Allows compatible CMake presets and Visual Studio configurations to converge on the same dependency cache

• Falls back to local vcpkg storage when shared cache safety cannot be verified

CMake integration

The new CMake shared cache module runs before project initialization and resolves the vcpkg dependency contract before the normal configure flow continues.

The resolver validates the manifest registries overlays triplets features vcpkg revision compiler toolset SDK and cache implementation before selecting fingerprinted dependency roots. This prevents incompatible configurations from sharing the same expanded dependency tree.

If the CMake version is too old for the shared cache module and shared cache variables are present the build warns and continues with build local vcpkg storage instead.

CMake preset changes

• Removes hardcoded VCPKG_INSTALLED_DIR values from presets

• Lets the shared cache resolver select the installed root when safe

• Keeps local fallback behavior available

• Replaces the previous preset binary source override with clean packages and clean buildtrees options

• Prevents Visual Studio CMake presets from inheriting Ninja compiler overrides where they should not

• Keeps CMake build outputs under their configured build preset directories

Visual Studio integration

The Visual Studio bridge uses the same dependency resolver as CMake. It evaluates each Solution configuration through MSBuild, generates a machine local ignored SharedVcpkgCache props file and revalidates the complete contract before vcpkg manifest installation.

Different Visual Studio configurations receive separate consumer fingerprints. They can still share an expanded dependency tree when their dependency inputs are identical, but their consumer contracts remain separate so MSBuild specific details cannot corrupt CMake or another Solution configuration.

The Visual Studio project now imports vcpkg props more reliably, supports the generated shared cache props, and validates the generated contract through SharedVcpkgCache targets before dependency installation and build preparation.

Visual Studio changes included

• Adds SharedVcpkgCache targets

• Adds generated SharedVcpkgCache props support

• Adds vcpkg bootstrap property resolution from VCPKG ROOT

• Keeps local fallback when the shared Solution cache is inactive

• Validates manifest root target triplet host triplet configuration toolset SDK and install options before using the shared cache

• Pins the Visual Studio instance used by vcpkg for the shared Solution contract

• Requires the dependency CMake tool used by the generated contract

• Revalidates the generated contract before vcpkg manifest install

• Uses fingerprinted installed buildtrees and packages roots for compatible Solution builds

• Keeps Solution outputs local

Shared cache safety boundaries

The shared cache is intentionally conservative. It only activates when the environment and contract can be fully validated.

Safety rules enforced

• The shared pool must be on a verified local fixed filesystem

• The shared pool must live outside every registered checkout

• UNC paths are rejected for the shared cache root

• Reparse points and symlink escapes are rejected in sensitive paths

• Mutable dependency roots are isolated by full contract fingerprint

• vcpkg and shared cache operation locks protect mutable cache operations

• Existing authenticated VCPKG BINARY SOURCES values are preserved

• Existing authenticated binary source values are never printed

• Existing authenticated binary source values are never persisted by the helper

• Cleanup fails closed when validation is incomplete

• Cleanup refuses to run while build related processes are active

• Cleanup validates repositories configure trees generated contracts paths identities and locks before removing transient data

• CI containers runtime data deployment paths and release behavior remain unchanged unless shared cache is explicitly enabled

PowerShell tooling

This commit adds setup audit cleanup repository registration and Solution contract generation tools.

The main shared cache setup script configures the cache root registers the current Git repository family manages relevant user environment variables configures vcpkg downloads and binary cache locations updates managed sccache base directories and can invoke the Solution bridge when applicable.

The Solution cache script evaluates MSBuild properties resolves the shared dependency contract through the CMake resolver writes the generated props file and supports audit only and validate only modes.

Both PowerShell tools require PowerShell 7 2 and run under strict mode.

Tooling added

• tools configure shared build cache ps1

• tools configure shared solution cache ps1

• setup mode for shared cache configuration

• audit only mode for validating existing shared cache state

• guarded transient vcpkg cleanup

• guarded fingerprint specific transient cleanup

• repository registration and unregister support

• generated Solution props creation

• generated Solution props validation

• generated Solution props audit

• MSBuild property based contract evaluation

• local fixed filesystem validation

• active build process protection before cleanup

Protobuf and Solution build fixes

This branch also includes follow up fixes around protobuf generation and Solution build behavior.

Protobuf and Solution changes

• Fixes Solution protobuf generation by using one normalized absolute proto root

• Uses the host triplet protoc path for protobuf generation

• Adds incremental inputs and outputs to the ProtoCompile target

• Excludes generated protobuf compile items when protobuf support is disabled

• Keeps protobuf generated source handling tied to RunProtoCompile

• Lets both CMake and Solution builds honor configured global vcpkg binary sources

• Avoids leaking Ninja compiler overrides into Visual Studio CMake presets

Documentation and repository updates

• Adds shared build cache documentation

• Documents setup and migration flow

• Documents CMake and Visual Studio integration

• Documents cache contract rules

• Documents concurrency and locking behavior

• Documents fallback behavior

• Documents recovery and cleanup procedures

• Documents cross fork compatibility rules

• Updates README with shared cache guidance

• Updates gitignore for generated local shared cache files

• Updates CI path filters so vcpkg configuration overlay and cache related changes trigger the correct workflows

Validation performed

• PowerShell parser validation for both cache tools

• PowerShell 5 1 prerequisite failure verified

• CMake preset validation

• JSON validation

• Visual Studio project XML validation

• Evaluated MSBuild property and item checks

• Checked protobuf enabled mode

• Checked protobuf disabled mode

• Local shared cache Solution build validation

• GitHub Actions Windows CMake matrix

• GitHub Actions Windows Solution matrix

Overall this commit adds a safe content addressed shared dependency cache for OTClient builds. It lets compatible CMake and Visual Studio configurations reuse expensive vcpkg dependency artifacts while keeping all build outputs local and falling back to worktree local storage whenever the shared contract cannot be fully validated.
2026-08-13 18:47:47 -03:00
Eduardo Dantas
0b0e0235a7
improve: add vcpkg triplets, test feature and presets (#1707)
Chores:
 • Tests are disabled by default; enable explicitly to build tests.
 • Configuration now fails if tests are enabled but test dependencies/features are not declared.
• Package manager integration isolated installs and caches per platform/config; per-variant install locations are used.
 • Test dependency declaration moved into an optional "tests" feature.
 • CI configure for macOS explicitly disables client tests by default.

New Features:
• Added dedicated presets and build variants for release, debug and test workflows.
2026-06-08 19:19:13 -03:00
Eduardo Dantas
e6bb6074e9
ci: gate Docker package publishing (#1724) 2026-05-20 19:01:25 -03:00
Luan Santos
388b3ba2ea
feat(platform): add native Cocoa/AppKit windowing for macOS (#1559)
New Features:
- Native macOS app with Cocoa windowing, OpenGL view, improved input, clipboard and cursor handling.
- Platform-aware keyboard and shortcut behavior with clearer primary/meta/control semantics and normalized key combos.

Bug Fixes:
- Expanded detection for "connection refused" network errors.

Chores:
- macOS build/bundle and packaging improvements; new dependency overlay added; CI now runs macOS build when relevant.

Tests:
- AddressSanitizer support added for test builds.
2026-05-16 13:06:48 -03:00
kokekanon
6a478408ee
ci: build apk android with github actions (#1715)
New Features:
- Added scrollable areas to general options, action bar settings, and game panel controls for improved navigation on compact displays.
- Integrated Android APK build automation into the CI pipeline.

Chores:
- Enhanced build system to support flexible Android architecture configuration during automated builds.
2026-05-12 20:47:00 -03:00
Eduardo Dantas
16b9b49107
ci: rework build workflows and vcpkg baseline (#1703)
Chores:
- Reorganized CI into reusable workflows, removed legacy workflows, added cache-cleanup and scheduled vcpkg baseline updater.
- Modernized Docker builds to multi-stage Ubuntu 24.04, added reusable Docker build and browser builder improvements.
- Refined CMake presets/toolchain defaults, exposed vcpkg baseline update, and broadened dependency platform support.
- Expanded linting/analysis configs and Lua syntax checks; updated ignore patterns for build/artifact files.

Bug Fixes:
- Various build, packaging and runtime configuration reliability fixes across Windows, Linux and macOS.
2026-05-01 19:42:53 -03:00
Beats
32e4275d0f
delete analysis-sonarcloud 2026-02-27 10:02:08 -03:00
divinity76
81ccbd8f99
ci/cd: fix emscripten build (#1491) 2025-12-23 14:03:48 -03:00
Eduardo Dantas
8cbb233412
ci/cl: set default vcpkg SHA and remove pin validation (#1442) 2025-11-14 13:58:06 -03:00
Renato Machado
502e1ba30b chore: update Discord support link for issues 2025-11-07 15:02:57 -03:00
Renato Machado
d4b1114007 chore: update Discord support link for issues (#1423) 2025-11-07 14:27:11 -03:00
Renato Machado
acaf98d1e0
refactor: cleanup includes and extract structs/enums to separate headers (#1397)
- Removed unnecessary includes from header files.
- Replaced heavy includes with forward declarations where applicable.
2025-10-28 00:23:01 -03:00
Renato Machado
f773c27b5d
ci: harden all workflows and pin vcpkg actions by full commit SHA (#1388)
Co-authored-by: LIBERGOD <37589902+libergod@users.noreply.github.com>
2025-10-19 21:40:33 -07:00
Eduardo Dantas
85730e398a
fix: gha workflows (#1178) 2025-06-10 14:55:40 -03:00
kokekanon
f3771ade73
fix: extended view (#1137) 2025-04-12 21:33:19 -03:00
OT Archive
7959d303f2
build: specify cmake version
Co-authored-by: Ivan Clementino <ivancarlos.clementino@gmail.com>
2025-04-08 17:37:30 -03:00
OT Archive
cb4aa3906f
fix: browser build + Emscripten Build Workflow
Co-authored-by: Ivan Clementino <ivancarlos.clementino@gmail.com>
2025-03-19 16:16:54 -03:00
OT Archive
0700333f63
feat: browser support (#894)
Support compiling to javascript and webassembly using Emscripten.
2024-11-29 14:12:47 -03:00
Majesty
88ac9bb280
fix: ubuntu gha build 2024-05-21 22:47:21 -03:00
Renato Foot Guimarães Costallat
d64e2603b5
fix: artifact name conflict (windows) 2024-03-07 21:03:57 -03:00
Renato Foot Guimarães Costallat
a52bf8d1a2
fix: artifact name conflict (ubuntu) 2024-03-07 21:03:32 -03:00
Renato Foot Guimarães Costallat
00cd5e6d36
improve: https/http login (#647) 2024-03-07 13:04:04 -03:00
Taelgalli
d46fdf532a
fix: windows build 2024-03-06 18:53:31 -03:00
Arun Sathiya
ed011571d6
ci: Use GITHUB_OUTPUT envvar instead of set-output command 2024-03-06 18:26:09 -03:00
Sim4n6
db560de0b5
Merge pull request from GHSA-q6gr-wc79-v589 2023-12-30 12:37:42 -03:00
Renato Foot Guimarães Costallat
8d185351d9
GHA: Update Docker and Ubuntu workflows (#659)
- Remove duplicated entry from editorconfig (again, don't know why it got back after
PR that fixed this)

- Added entry for cmake files on editorconfig

- Removed not used GitVersion

- Update ubuntu build workflow (Removed ccache that will not work with UNITY and PCH)

- Disabled UNITY and PCH for debug images and enabled more warning flags (Show build warning on PR changes)

- Update docker workflow to use newer version (Using newer versions of the actions helped cleaning the workflow, now it is smaller and easier to understand)

- Do not upload artifacts when building PR as it failing and we need to re-run the build

Signed-off-by: Renato Foot <renato@foot.br>
2023-11-30 23:46:10 -03:00
Eduardo Dantas
dc20eeccb5
feat: otimize build time using unity build tool from cmake
Co-authored-by: Renato Machado <mehahx@gmail.com>
2023-07-24 20:27:37 -03:00
Eduardo Dantas
bfccdc3e98
build: fix vcpkg builtin-baseline for enable GHA builds (#498) 2023-04-04 16:53:00 -07:00
Beats
3ee7e87bb6
improve: update GHA to read builtin-baseline from vcpkg.json (#403)
To prevent future build breaks due to changes in the vcpkg repository, added a step in the GitHub Actions to install vcpkg based on the builtin-baseline in the vcpkg.json file. This allows us to set vcpkg to be installed from specific commits in both GitHub Actions and in Ubuntu/Windows, centralizing everything in one location. We can only update vcpkg when there is an official release.
2023-02-06 11:33:12 -03:00
Beats
ac8c7837af
[Fix] Upload artifacts with wrong size (#369) 2022-12-11 16:25:42 -03:00
Beats
98368b93dc
[Vcpkg] Set new commit id (#366) 2022-12-09 01:11:21 -03:00
Beats
33e7bcff7d
[Enhancement] - Fix gha actions warnings (#349)
Updated actions to work with new GHA features, preventing future builds from breaking because they are outdated.
2022-11-04 13:24:58 -03:00
Beats
dd1ae10cc7
[Enhancement] - CMake build using static library (#306) 2022-09-07 21:57:03 -03:00
Beats
161fb7d92e
Enable build ccache sonar, update dockerfile (#283) 2022-08-18 00:12:44 -03:00
Renato Machado
1189928cf3
Create FUNDING.yml 2022-08-16 01:26:13 -03:00
Renato Machado
f4b5c0d81b
Drawpool v2 RC (#292)
- Drawpool refactored
- Removed OpenGL 1 
- Removed robin hood lib, now use parallel-hashmap, it's faster.
- Vertexarray now uses vector, instead of databuffer
~Vector practically has the same performance level as array-style + std::copy(memcpy)
- Removed RENDER_WALKING_CREATURES_BEHIND
- Add feature Otc::GameMapDontCorrectCorpse and Otc::GameMapOldEffectRendering #284 
- Fix #278 #284 #275
- Replace drawViewportEdge with limitVisibleDimension
- Various other improvements and cleanup.

Note(new libs):
[x64]
vcpkg install stduuid:x64-windows parallel-hashmap:x64-windows
[x86]
vcpkg install stduuid:x86-windows parallel-hashmap:x64-windows
[Static Lib]
vcpkg install --triplet x86-windows-static stduuid parallel-hashmap
2022-07-04 19:46:30 -03:00
Eduardo Dantas
8da346ced0
Fix sonar build, add libglew to gha build file (#282) 2022-06-03 18:33:44 -03:00
Eduardo Dantas
5531c40416
Fix github actions, cmake rework and integrate with vcpkg and improvement on protobuf (#257)
Full Github Action Rework (GHA), so that builds are fixed: Windows, Linux, Docker; Review checks: C++, Lua, XML and others checks
Complete Cmake Rework, modernized the code so that you can work with GHA.

Removed:
VCPKG Build
Removed generated Files from file .gitignore (all build files are required for Cmake cache generation)
Lib Lua5.1 was removed and maintained only Luajit (faster and better)
Removed the "consoleapplication" file
Removed the "lbitlib" file, after all, if the idea is the project to use updated Libs, why do we want files that bring compatibility to old Libs? I just updated the files to use the functions of the new LIBs

Modified:
The metadata of the Bitwise functions have been changed, now being in place of "bit32." is
"bit."
Protobuf will now be chased along with the client build, avoiding random errors related to Protobuf's version is different from the compiled file (this way, no matter if the repository file is outdated, as a new one will always be generated in a compilation from rebuild all)
Modified the structure of some folders, such as "protobuf" and "cmake" folder, "protobuf" was sent to the src main folder and "cmake" to the client main folder
Namespace protobuf changed from "tibia" to "otclient"
Merged the files of the Protobuf "shared.proto and appearances.proto" in one (appearances)

Added:
Issue Template
Pull Request Template
Pull Request Labeller
Check to inform that clang is not supported (it is possible to use docker on mac, this way we avoid headaches related to support for an OS that is practically not used)

GHA:
Codacy
CodeQL
Review dog
SonarCloud
Build docker
Build Ubuntu
Build Windows

Cmake:
Cmakepresets
VCPKG Manifest
Otcicon

Client:
Added the functions LuaInterface::registerTable and LuaInterface::registerMethod and Bitwise Functions (if necessary at some point compatibility with the Lua 5.1)

Note: Some checks are failing as they should only work after the merge, they should be ignored, the main ones are ok

Thanks to @costallat for for helping and assisting with addition of GHA and CMake build
2022-06-03 17:14:30 -03:00
Renato Machado
b61f110674
Merge branch 'edubart:master' into main 2022-04-28 11:48:05 -03:00
Marcin Michalski
836ea2bdc6 Update vcpkg 2022-04-28 14:09:08 +02:00
Nekiro
f14d2bd7a4 Add issue template 2022-04-11 11:44:54 +02:00
Renato
0548a82139 Squashed commit of the following:
commit 1d614e294c
Author: vfjpl <cosiekvfj@o2.pl>
Date:   Wed Aug 25 19:24:08 2021 +0200

    Fix std::istream::streampos deprecation warning (#1154)

commit e0d5b7d7fd
Author: Marcin Michalski <evulmastah@gmail.com>
Date:   Sun Aug 22 01:21:17 2021 +0200

    Update vcpkg & switch back to ubuntu 18.04 in workflow (#1161)

commit 10100342b9
Author: Marcin Michalski <evulmastah@gmail.com>
Date:   Sun Aug 22 00:51:18 2021 +0200

    Fix opening "https://"-prefixed links on Windows (#1160)

commit 302748b2f3
Author: Marcin Michalski <evulmastah@gmail.com>
Date:   Sun Aug 22 00:48:34 2021 +0200

    Fix opening URLs on macOS (#1159)

commit f173b03dbd
Author: Marcin Michalski <evulmastah@gmail.com>
Date:   Sun Aug 22 00:38:58 2021 +0200

    Map option to alt and command to meta keys on macOS (#1158)
2021-09-02 15:50:20 -03:00
Marcin Michalski
e0d5b7d7fd
Update vcpkg & switch back to ubuntu 18.04 in workflow (#1161) 2021-08-22 01:21:17 +02:00
Marcin Michalski
4edb1eb3ad
Fix adding executable icon on windows with non-msvc compiler (#1136) 2021-03-30 08:58:32 +02:00
Marcin Michalski
69e44a3722
Fix & enable by default static linking on macOS (#1133) 2021-03-29 17:22:04 +02:00
Marcin Michalski
975d138a57
Run windows workflow with luajit only (#1134) 2021-03-29 16:54:02 +02:00
Marcin Michalski
c4530a6d17
Bump minimum required CMake version to 3.1 (#1131)
* Removed Ubuntu Clang workflow
* Removed FindCXX.cmake (in favor of native feature)
* Added support for building Windows binaries with CMake when using MSVC
* Cleaned up a number of Find*.cmake modules
2021-03-27 01:04:59 +01:00
Marcin Michalski
b6399a8ad9
Update workflow (#1130) 2021-03-26 14:37:02 +01:00