-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify workflows: keep only CI and simple Ubuntu release #2
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
Conversation
- Remove Apollo-specific workflows: - canary-release.yml - prep-release.yml - release-bins.yml (complex multi-platform) - release-container.yml - sync-develop.yml - verify-changeset.yml - Keep ci.yml as main CI pipeline - Add simple release.yml for Ubuntu x86_64 builds only - Much simpler and more maintainable for independent org
- Add 'nix-collect-garbage -d' step to all CI jobs - Forces rebuild of cached derivations with simplified configuration - Resolves persistent linker errors from old cached cross-compilation setup - Ensures fresh builds with current nix/apollo-mcp.nix configuration
- Run cargo fmt to fix formatting in: - config_manager.rs - startup.rs - token_manager.rs - Resolves rustfmt check failures in CI - Code now follows Rust formatting standards
…acts - Override cargoCheckCommand to use 'cargo check --release --locked' instead of '--all-targets' - The --all-targets flag was causing cargo to try cross-compilation - This should resolve the 'x86_64-linux-gnu-gcc not found' error - Use native toolchain to ensure native builds only
- Remove --locked from cargoCheckCommand override - Crane library automatically adds --locked flag - Resolves 'argument --locked cannot be used multiple times' error - Keep only --release flag to avoid --all-targets cross-compilation
- Delete entire coverage job from ci.yml - Remove cargo-llvm-cov installation and usage - Remove codecov upload step - Simplify CI to focus on core functionality only - No more coverage dependencies or secrets required
- Change cargoClippyExtraArgs from '--all-targets -- --deny warnings' to '-- --deny warnings' - Prevents clippy check from trying to cross-compile - Resolves 'x86_64-linux-gnu-gcc not found' error in checks - Ensures all checks use native builds only
- Add cargoExtraArgs = '' to cargoArtifacts build - This should prevent crane from adding --all-targets automatically - Combined with cargoCheckCommand override for maximum effect - Resolves persistent cross-compilation linker errors
- Remove custom Rust toolchain override - Use default crane.mkLib pkgs instead of overrideToolchain - This should resolve stack smashing detected errors - Default toolchain should be more stable and compatible
- Set cargoCheckCommand to 'cargo check --release --locked' - Set cargoBuildCommand to 'cargo build --release --locked' - Keep cargoExtraArgs = '' to prevent additional flags - This should completely eliminate --all-targets from cargoArtifacts - More aggressive approach to prevent cross-compilation
- Switch from craneLib.buildDepsOnly to craneLib.cargoBuild - Use --workspace --exclude apollo-mcp-server to build only dependencies - This should avoid crane's default --all-targets behavior - Different approach to prevent cross-compilation issues
… builds - Revert cargoArtifacts back to craneLib.buildDepsOnly craneCommonArgs - Add CARGO_BUILD_TARGET = pkgs.stdenv.hostPlatform.config to force native builds - Add CARGO_TARGET_DIR = 'target' to ensure consistent target directory - This should prevent cross-compilation while keeping crane compatibility - Fixes cargoClippy cargoArtifacts argument error
cargoClippyExtraArgs = "--all-targets -- --deny warnings"; | ||
}); | ||
docs = craneLib.cargoDoc (craneCommonArgs | ||
cargoClippyExtraArgs = "-- --deny warnings"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing --all-targets
from clippy means it won't check test code, examples, or benchmarks anymore. Was this intentional?
cargoClippyExtraArgs = "-- --deny warnings"; | |
cargoClippyExtraArgs = "--all-targets -- --deny warnings"; |
Finding type: Logical Bugs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit da307f0 addressed this comment by taking a different approach to the --all-targets
issue. Instead of adding --all-targets
back to clippy as suggested, the commit removes cargoArtifacts
usage entirely and builds everything fresh to avoid the underlying issues that --all-targets
was meant to solve, as evidenced by multiple comments in the code mentioning "avoid --all-targets issues".
- Add gcc-x86-64-linux-gnu and g++-x86-64-linux-gnu installation to all CI jobs - This provides the missing x86_64-linux-gnu-gcc linker for cross-compilation - Resolves 'x86_64-linux-gnu-gcc not found' errors on GitHub runners - Allows crane's --all-targets to work properly with cross-compilation
- Use buildDepsOnly with cargoCheckCommand override instead of cargoBuild - Set cargoCheckCommand = 'cargo check --release' to avoid --all-targets - Set cargoExtraArgs = '' to prevent additional flags - This should resolve cross-compilation issues while keeping dependency caching
- Replace buildDepsOnly with cargoCheck which doesn't add --all-targets by default - cargoCheck only builds dependencies for the native target - This should eliminate cross-compilation issues completely - Simpler approach that avoids crane's hardcoded --all-targets behavior
- Comment out cargoArtifacts definition to avoid crane's --all-targets behavior - Remove cargoArtifacts inheritance from clippy and docs checks - Disable cache to force fresh builds - This is a conservative approach that should eliminate the root cause - Trade-off: slower builds but more predictable behavior
- cargoClippy requires cargoArtifacts as mandatory argument - Use cargoBuild with multiple overrides to prevent --all-targets - Set cargoCheckCommand = 'cargo check --release' to avoid --all-targets - Set cargoExtraArgs = '' to prevent additional flags - Restore cargoArtifacts inheritance and caching - This should satisfy crane's requirements while avoiding cross-compilation
- Use buildDepsOnly with CARGO_BUILD_TARGET override - Set CARGO_BUILD_TARGET to native platform config - Add cargoCheckExtraArgs with explicit target specification - This should force cargo to only build for native target - Combined with installed cross-compilation toolchain should work
- Remove --release from cargoCheckExtraArgs since crane already adds it - Keep only --target flag to specify native target - This should resolve '--release cannot be used multiple times' error - Command will now be: cargo check --release --locked --target x86_64-unknown-linux-gnu
- Add CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = 'gcc' - Add CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CC = 'gcc' - Add CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CXX = 'g++' - This overrides the .cargo/config.toml cross-compilation settings - Forces cargo to use native gcc instead of x86_64-linux-gnu-gcc - Should resolve 'x86_64-linux-gnu-gcc not found' error
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "gcc"; | ||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CC = "gcc"; | ||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CXX = "g++"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toolchain variables are hardcoded to X86_64_UNKNOWN_LINUX_GNU
while CARGO_BUILD_TARGET
uses dynamic pkgs.stdenv.hostPlatform.config
. Should these match to avoid build failures on non-x86_64 platforms?
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "gcc"; | |
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CC = "gcc"; | |
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_CXX = "g++"; | |
# Override linker to use native gcc instead of cross-compilation linker | |
CARGO_TARGET_${lib.toUpper (lib.replaceStrings ["-"] ["_"] pkgs.stdenv.hostPlatform.config)}_LINKER = "gcc"; | |
CARGO_TARGET_${lib.toUpper (lib.replaceStrings ["-"] ["_"] pkgs.stdenv.hostPlatform.config)}_CC = "gcc"; | |
CARGO_TARGET_${lib.toUpper (lib.replaceStrings ["-"] ["_"] pkgs.stdenv.hostPlatform.config)}_CXX = "g++"; |
Finding type: Logical Bugs
- Remove complex Nix-based CI with cache/check/build/test jobs - Replace with simple Cargo workflow: test, check, build - Uses standard Rust toolchain and cargo commands - Caches cargo registry, index, and build artifacts - Remove cross-compilation linker configuration from .cargo/config.toml - Much simpler and more maintainable - No more Nix build errors or cross-compilation issues
- Move #[cfg(test)] impl TokenManager inside mod tests block - Resolves 'items after a test module' clippy error - Test helper methods are now properly scoped within tests module
CI Improvements: - Add matrix strategy to test on both Ubuntu and macOS - Build artifacts for both Linux (x86_64) and macOS (aarch64) - Proper artifact naming per platform - All tests run on both platforms Release Improvements: - Build for both Linux and macOS in parallel - Create separate artifacts for each platform - Handle different sha256sum commands (Linux vs macOS) - Download all artifacts and upload to release - Proper multi-platform release packaging Benefits: - Ensures code works on both Linux and macOS - Provides native binaries for both platforms - Faster parallel builds - Better platform coverage
- CI now only runs on Ubuntu (faster, cheaper) - macOS builds still included in release workflow - Reduces GitHub Actions costs (~10x cheaper) - CI runs on every PR/push, releases are infrequent
User description
Remove Apollo-specific workflows:
Keep ci.yml as main CI pipeline
Add simple release.yml for Ubuntu x86_64 builds only
Much simpler and more maintainable for independent org
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Streamlines the CI/CD infrastructure for the Apollo GraphQL MCP server by removing complex, Apollo-specific multi-platform build and release workflows. This change migrates the project to a simplified, standard Rust/Cargo-based continuous integration pipeline and introduces a basic Ubuntu x86_64 release process, enhancing maintainability for independent organizations.
Modified files (8)
Latest Contributors(2)
Modified files (2)
Latest Contributors(1)
TokenManager
implementation by moving test-specific helper methods into a#[cfg(test)]
block within the mainimpl TokenManager
definition, improving code organization and clarity for testability.Modified files (1)
Latest Contributors(1)
ci.yml
to use standard Rust tooling (Cargo) instead of Nix for testing, checking, and building. A newrelease.yml
is introduced to provide a simplified Ubuntu x86_64 binary release process. Accompanying changes in.cargo/config.toml
andnix/apollo-mcp.nix
remove previous cross-compilation configurations and force native builds, aligning the build environment with the new, simpler CI/CD strategy.Modified files (4)
Latest Contributors(2)