* Remove non-local returns and -Wconf suppression
Refactor code to avoid non-local returns (using `return` inside closures)
which are deprecated in Scala 3. Changes:
- OAuthService.scala: Replace early returns with if/else patterns in
exchangeCodeForToken, fetchUserInfo, generateAppleClientSecret,
exchangeAppleCode, and parseAppleIdToken methods
- PerformProvinceEventsAction.scala: Replace for-loop with early return
with foldLeft pattern in beastType method
Remove the `msg=Non local returns:silent` suppression from the toolchain.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix non-local returns in MapValidationTest
Refactor checkMonthlyWeather to use exists() instead of foreach with
early returns. Also fixes typo in error message (was "> 0" should be "> 100").
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Scala 3 deprecates `_` for wildcard type arguments in favor of `?`.
This fixes the one occurrence in CommandChoiceHelpers.scala and removes
the -Wconf suppression for this warning.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Enable -Werror and fix compiler warnings (partial)
This commit enables -Werror in the Scala toolchain and fixes warnings
in the main server code and several test files. Main changes:
Server code fixes:
- Remove unused imports (HeroId, ActionResult, unused, Try)
- Remove unused parameters (playerCount cascade in NewGameCreation,
persister in synchronizedCreateGame, userServiceForGames in buildServer)
- Fix discarded value warnings with explicit : Unit type ascriptions
- Fix pattern match warning by removing unnecessary type annotation
Test code fixes:
- Remove unused imports across multiple test files
- Remove unused default parameter values that are always explicitly passed
- Fix ScalaMock expectation setup warnings with : Unit
- Fix MapValidationTest to properly combine boolean checks
- Fix loneElement usage to use proper assertions
The -Werror flag is now enabled along with -Wconf suppressions for:
- Initialization warnings (safe patterns Scala 3 warns about)
- ScalaTest assertion return values
- External/generated sources
Many test files still have warnings that need to be fixed in follow-up
commits before all 315 tests will build with -Werror.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Remove unused heroes variable in ReturningHeroesTest
Fix CI failure caused by unused private member warning.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix Scala compiler warnings in test files for -Werror compatibility
- Remove unused imports across multiple test files
- Remove unused private members and default parameters
- Add `: Unit` type ascription to ScalaMock expectations to silence discarded value warnings
- Fix deprecated `<function> _` syntax by removing trailing ` _`
- Replace deprecated `= _` with `scala.compiletime.uninitialized`
- Add `val _ =` to explicitly discard unused return values
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix remaining Scala compiler warnings in main sources for -Werror
- Remove unused imports: JString in OpenAIResponsesServiceImpl, FactionId in
DiplomacyOptionConverter and RansomOfferDetailsConverter,
OpenAIChatCompletionsServiceImpl in HeroLibraryGenerator
- Replace deprecated `= _` with `= uninitialized` in SseSubscriber and
ShardokInstanceManager
- Remove unused private member MessageType in SseSubscriber
- Remove unused private member openAICaller in HeroLibraryGenerator
- Add missing pattern match cases: UNKNOWN_UNIT in UnitStatusConverter,
Gender.Unknown in HeroLibraryGenerator
- Fix discarded value warnings with `val _ =` in ShardokInstanceManager
- Fix unused pattern variables in NameListChecker
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This is a stepping stone toward enabling -Werror for exhaustiveness checking
on sealed traits. Changes include:
- Enable -Wall in Scala toolchain configuration
- Add -Wconf suppressions for generated code and external dependencies
- Fix discarded value warnings by explicitly discarding with `val _ =`
- Fix non-local return warnings in JwtService using nested if/else
- Fix deprecated `= _` syntax using `= uninitialized` in OAuthHttpHandler
- Fix implicit parameter syntax: `(ec)` -> `(using ec)` in GrpcRetrier
- Remove unused imports across multiple files
- Add @unused annotation for intentionally unused parameters
- Fix wrong imports in SettingUpdater (was using wrong proto package)
- Fix BUILD.bazel exports to make GrpcRetrier available transitively
- BUG FIX: StringConstructionParser was silently ignoring parse errors
when closing character wasn't found (added missing return)
Note: -Werror is not yet enabled (TODO in tools/BUILD.bazel) because
there are still unused import warnings in some files. Once those are
fixed, -Werror can be uncommented to get compile-time exhaustiveness
checking.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
The manifest public key wasn't being injected properly because:
1. Workspace status variables need STABLE_ prefix for x_defs stamping
2. BUILD.bazel was using {MANIFEST_PUBLIC_KEY} but the variable
wasn't being output with the STABLE_ prefix
This caused the installer to try to base64 decode the literal string
"{MANIFEST_PUBLIC_KEY}" instead of the actual public key value.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Rewrite Windows installer in Go (73MB -> 5.4MB)
Rewrites the Eagle0 Windows installer from C#/.NET to Go, reducing the
binary size from 73MB to 5.4MB (93% reduction).
The Go implementation provides the same functionality:
- Downloads and verifies game files via manifest
- Ed25519 signature verification for manifest
- SHA256 verification for all downloaded files
- Parallel downloads (8 concurrent slots)
- Self-update mechanism for installer updates
- Console-based progress output
- Invitation code support
Changes:
- Add Go installer source code (main.go, updater.go, config.go)
- Add Bazel BUILD file with Windows cross-compilation target
- Update CI workflow to build Go binary instead of .NET
- Add MANIFEST_PUBLIC_KEY to workspace status for build-time injection
The installer is cross-compiled for Windows from Mac using Bazel.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix CI permission error when copying installer output
Remove any existing installer-output directory before copying
to avoid permission denied errors from previous runs.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add ARM64 Linux build infrastructure for Shardok
Infrastructure to support cross-compiling Shardok for ARM64 Linux,
enabling deployment to Hetzner ARM instances (CAX41) for on-demand
compute.
Changes:
- Add linux_arm64 platform definition
- Add LLVM toolchain for ARM64 cross-compilation
- Add ARM64 sysroot placeholder (needs workflow run to populate)
- Add ARM64 busybox for container health checks
- Add Ubuntu 24.04 ARM64 base image
- Add Shardok ARM64 container image targets
- Update sysroot build workflow to support ARM64
Next steps:
1. Run "Build Linux Sysroot" workflow with architecture=arm64
2. Update MODULE.bazel with generated sysroot SHA
3. Build and push ARM64 container
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update ARM64 sysroot SHA from workflow build
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix ARM64 container build issues
- Use linux/arm64/v8 platform string (rules_oci requires variant suffix)
- Remove busybox_layer_arm64 due to busybox.net SSL certificate issues
- Health checks can be added later using an alternative busybox source
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add GitHub Actions workflow for ARM64 Shardok build
Builds and pushes ARM64 container image to GitHub Container Registry
for deployment on Hetzner ARM instances (CAX41).
Triggered on:
- Push to main (when Shardok-related files change)
- Manual workflow_dispatch
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Add action_json, faction_name, and game_date fields to GameHistoryEntry proto
- Serialize ActionResult to JSON in EagleServiceImpl.getGameHistory()
- Display faction name and date columns in history table
- Show full JSON inline when clicking action rows (no separate AJAX call)
- Add build timestamp and git commit to admin header on all pages
- Create workspace_status.sh for Bazel build stamping
- Enable --stamp in .bazelrc
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Fix sysroot .so plugins and registry auth
- Exclude GCC plugin .so files from sysroot (Bazel can't handle them)
- Only copy GCC headers and static libs needed for cross-compilation
- Add tarball structure verification to build script
- Fix DO registry auth by setting DOCKER_CONFIG env var for Bazel
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add triple symlinks to sysroot for clang compatibility
Clang uses --target=x86_64-unknown-linux-gnu but Ubuntu's GCC uses
x86_64-linux-gnu (without "unknown"). This caused clang to fail to detect
the GCC installation and couldn't find C++ standard library headers.
Add symlinks in the sysroot:
- /usr/lib/gcc/x86_64-unknown-linux-gnu -> x86_64-linux-gnu
- /lib/x86_64-unknown-linux-gnu -> x86_64-linux-gnu
- /include/x86_64-unknown-linux-gnu -> x86_64-linux-gnu
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix sysroot tarball structure for toolchains_llvm
The tarball was wrapping contents in sysroot/ which caused double nesting
when extracted by the sysroot() repo rule. Changed to tar from inside the
sysroot directory so usr/, lib/, etc. are at the root of the archive.
Before: sysroot/usr/...
After: ./usr/... (or usr/...)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add libgcc_s.so symlink to sysroot
The linker looks for libgcc_s.so but Ubuntu only provides libgcc_s.so.1.
Added a symlink to make -lgcc_s work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix sysroot for cross-compilation
1. Add ld-linux-x86-64.so.2 symlink in lib/ since libc.so linker script
references /lib64/ld-linux-x86-64.so.2 as an absolute path
2. Change linkopt to host_linkopt in .bazelrc to avoid passing macOS-specific
linker flags (-no_warn_duplicate_libraries) to Linux cross-compilation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update sysroot to v3.4 with all required symlinks
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add missing includes for cross-compilation portability
These files relied on platform-specific transitive includes that work on
macOS but not on Linux. Added explicit includes for:
- <cstdint> for uint8_t, uint64_t
- <stdexcept> for std::out_of_range
- <cinttypes> for PRIu64 portable format specifier
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Issues fixed:
1. Sysroot hosted on GitHub releases but repo is private, causing 404s
2. Sysroot missing GCC directories that clang needs to find libstdc++ headers
Changes:
- Add GCC installation directories to sysroot (clang uses these to locate C++ headers)
- Update workflow to upload sysroot to DO Spaces instead of GitHub releases
- Versioned sysroot paths (v2, v3, etc.) for easier updates
NOTE: After merging, run the "Build Linux Sysroot" workflow with version "v2",
then update MODULE.bazel with the sha256 from the workflow output.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add cross-compilation support for Shardok Docker builds
This enables building Shardok on the self-hosted Mac runner while
targeting Linux x86_64, avoiding the need for slow GitHub-hosted
Ubuntu runners.
Changes:
- Add Ubuntu 24.04 (Noble) sysroot generation scripts
- Add GitHub Actions workflow to build and release the sysroot
- Configure toolchains_llvm for cross-compilation with sysroot
- Update docker_build.yml to use cross-compilation
- Add linux_x86_64 platform definition
The sysroot contains libstdc++-13 which provides C++23 support
needed by the codebase.
To complete setup:
1. Run the "Build Linux Sysroot" workflow to create the sysroot
2. Update MODULE.bazel with the actual sha256 from the release
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Temporarily disable Shardok build until sysroot is ready
The cross-compilation sysroot needs to be built and uploaded before
Shardok can be built. Steps to re-enable:
1. Run "Build Linux Sysroot" workflow
2. Update sha256 in MODULE.bazel
3. Uncomment build-shardok job
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* getting there
* moar
* progress
* a few more dependency fixes
* a bit more is passing
* weird staging thing
* more fixes
* fix another
* fix another
* more fixes
* BattalionC constructor
* moar
* moar
* more
* try a regex, gulp
* fix a bunch
* another exception
* some more tests
* province converter
* fixed a few more
* this is actually making progress
* another dep
* more deps
* more deps
* more
* so slooow
* a few more
* remove an asInstanceOf
* moar
* server builds maybe
* different reflection
* hmm
* get exceptions
* missing deps
* a few more fixes
* moar tests
* a few more
* Moar test fixes
* almost there
* just reflection issues now
* Fix Scala 3 compatibility issues in UnrequestedTextHandlerTest
- Fix ScalaTest import for Scala 3 compatibility: use shouldBe and the from Matchers
- Resolve build error that was preventing all tests from passing
All 200 tests now pass successfully with Scala 3.
* remove reflectiveSelectable
* remove staging dependency
* upgrade migration doc
* Rename rules_scala import from io_bazel_rules_scala to rules_scala
This PR renames the rules_scala import in the WORKSPACE file from the old
name 'io_bazel_rules_scala' to the new standard name 'rules_scala', while
maintaining backward compatibility through aliasing.
Changes:
- Updated WORKSPACE to use both names (primary: io_bazel_rules_scala, alias: rules_scala)
- Updated all BUILD files to use the consistent repository name
- Updated toolchain definitions to use io_bazel_rules_scala internally
- Added compiler warning suppression for external dependencies
- Fixed test dependencies that were using incorrect repository names
The build and test suite now pass successfully with this naming change.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* run gazelle
---------
Co-authored-by: Claude <noreply@anthropic.com>
* update to grpc 1.67
* bad
* still fail
* update rules_scala
* update grpc to 1.67.1 (from 1.53.0)
* 1.69.0
* more going back
* more
* protobuf too
* guess I did need the scalapb changes too
* resolve a couple of dep differences
* update protobuf path for ignoring warnings
* suppress another warning in parallel_hashmap
* another explicit dep
* delete, don't comment out
* with the unapply fixes
* a bunch of pattern match fixes
* fixed most of the failures
* it runs
* fix a couple of tests
* all tests build
* got some tests passing
* all tests passing
* dead code
* more comments
* another
* dead code
* a couple unnecessary ones
* cleanup
* remove guava dep
* silence warnings in third-party tools but treat warnings as errors in first-party
* -Werror
Former-commit-id: c3cc0ae56e03c6ff4fd3a1d1220b8b633b975c78
* upgrade to bazel 5.1.1
* upgrade grpc to 1.49.1
* put std=c++20 into bazelrc, but move Werror into COPTS
* don't upgrade scala yet
Former-commit-id: afcd3fb717b68c7c03b249079f4e9af44a9ff519
* generate map info rule
* visibility
* move c++ version from bazelrc to COPTS
* cc_library in tests, too
* and in cc_test
* separate TEST_COPTS
* revert generate_map_info for now
Former-commit-id: cef3df560bc5c013fbf27bd49f58f2b2cf014b53
* start
* start building some unity3d rules
* different format
* try a real build
* allow files
* a single file
* hmmmore
* slow progress
Former-commit-id: 89d807be8ec80296c32b922e5493527b668aed74
* more use of MoreOption
* add to BUILD
* update some deps
* fix deprecated scalatest stuff
* reformat
* seems backward
* more deprecations
* add deprecation to toolchain
Former-commit-id: cc2217e07883852d38a0f6d1d1eb0834e046cf94