Skip to content

Conversation

@limemloh
Copy link
Contributor

@limemloh limemloh commented Dec 16, 2025

Purpose

The staticly linked binary for Linux has a lot of indirections, this PR aims to simplify it.
The release flow involves several docker images, making it hard to run locally.

The end goal is to be able to build the static linux build (potentially other platforms as well) using just:

stack build --stack-yaml concordium-consensus/stack.static.yaml
cargo build --manifest-path concordium-node/Cargo.toml --features static

Changes

  • Introduce script and workflow for custom GHC build directly in the repo.
  • Make stack.static.yaml use the custom GHC directly.
  • Move logic in scripts/static-libraries/build-static-libraries.sh into build.rs. (still WIP)

TODO changes

When new flow is working then:

  • Update release workflow and docker distribution.
  • Remove scripts/static-binaries dir.
  • Remove scripts/static-libraries dir.
  • Remove scripts/build-binaries.sh.
  • Remove scripts/start.sh.
  • Update README(s).

@limemloh limemloh force-pushed the simplify-static-build branch 2 times, most recently from 3286e37 to 3bae656 Compare December 16, 2025 09:10
jobs:
build-ghc:
name: Build ghc for linux x64
runs-on: ubuntu-latest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might need a more beefy runner

upload:
name: Upload to S3
runs-on: ubuntu-latest
environment: s3-push
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Proper environment needs to be setup

ghc:
linux64-custom-static-build-tinfo6:
9.10.2:
url: "/home/lime/Concordium/concordium-node/ghc2/ghc-9.10.2/_build/bindist/ghc-9.10.2-x86_64-unknown-linux.tar.xz"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the build-static-ghc workflow is working, this needs to point to the resource


#[cfg(feature = "profiling")]
let path = format!("{}/deps/static-libs/linux/profiling", out_dir);
pub fn link_libraries() -> std::io::Result<()> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function should mostly correspond to the logic found in scripts/static-libraries/build-static-libraries.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This script is mostly copy of the one here

@limemloh limemloh force-pushed the limemloh/psr-9-node-integrate-the-plt-scheduler-library-into-the-build branch 2 times, most recently from 2a4df30 to b60f0ba Compare December 17, 2025 14:18
Base automatically changed from limemloh/psr-9-node-integrate-the-plt-scheduler-library-into-the-build to feature/plt-scheduler-port December 18, 2025 07:10
@limemloh limemloh force-pushed the simplify-static-build branch from 3bae656 to 81ac8d8 Compare December 19, 2025 20:07
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.

2 participants