Skip to content

Proper Linux compiler support/documentation - #303

Merged
alan-george-lk merged 10 commits into
mainfrom
alan/feature-linux-compiler
Nov 3, 2026
Merged

alan-george-lk merged 10 commits into
mainfrom
alan/feature-linux-compiler

Conversation

@alan-george-lk

@alan-george-lk alan-george-lk commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

The C++ SDK silently moved compiler requirements from GCC to Clang 21+ as of release v1.10.1, and this was never announced, properly documented, and scripts were not updated accordingly. As such, a fresh clone of this SDK on Linux did not build out of the box. This PR addresses this alongside documentation, script support, etc.

Notable change overview:

  • Compiler: gcc -> clang-21
    • build.sh now properly supports this. After users install the deps, this script now just works
  • CMake minimum version: 3.20 -> 3.25
  • Updates docs/building.md with relevant changes and proper dependency table

alan-george-lk and others added 3 commits October 28, 2026 12:58
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- name: Install Clang 21
if: runner.os == 'Linux'
shell: bash
run: client-sdk-rust/.github/scripts/install-clang.sh

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Context: this one upstream downloads a ton more than we need, this was taking a few minutes in CI. The below list is the subset of things we need. I may advocate for moving the upstream script to do this eventually

Comment thread docs/building.md

## Prerequisites

### Common to all platforms

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I spent a lot of time by hand reorganizing and adding things here, this diff is rough, probably easiest to just render the markdown and read through the new flow

Comment thread docs/building.md
discovers libclang from the system paths once `libclang-dev` is installed; if
not, point `LIBCLANG_PATH` at your LLVM's `lib` directory (e.g.
`/usr/lib/llvm-18/lib` on Ubuntu 24.04).
On Linux, install `clang-21` as shown above. Rust bindgen uses libclang to

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was an AI change, feels a bit chatty, open to adjusting

Comment thread AGENTS.md Resolved
@alan-george-lk
alan-george-lk marked this pull request as ready for review October 30, 2026 18:19
@alan-george-lk
alan-george-lk requested review from a team and xianshijing-lk as code owners October 30, 2026 18:19

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 4 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread build.sh Resolved
Comment thread scripts/setup-linux-toolchain.sh Resolved
Comment thread scripts/setup-linux-toolchain.sh Resolved

@xianshijing-lk xianshijing-lk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, some nits

Comment thread docs/building.md Resolved
Comment thread docs/building.md Resolved
Comment thread build.sh

OS_TYPE="$(detect_os)"

configure_macos_toolchain() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just want to make sure, is this needed for this linux clang thing?

or some other improvement ?

and it seems configure_macos_toolchain() unconditionally overwrites CC/CXX with the xcrun paths, whereas the Linux path honors pre-set CC/CXX (setup-linux-toolchain.sh:70-79).

@alan-george-lk alan-george-lk Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is mildly related to the Linux work but not directly. We can remove this if you prefer, but the idea was given our docs callout Xcode's installation of Clang, we should do some hardening to find the toolchain in build.sh. The reason this exists is I also had a configure_linux_toolchain() function in this file, but decided to factor it out (into setup-linux-toolchain.sh as you called out) so downstream linux projects could call it out of the SDK submodule.

Happy to adjust direction here/or remove it, thoughts?

@xianshijing-lk

Copy link
Copy Markdown
Collaborator

lgtm, thanks

Comment thread src/tests/packaging/CMakeLists.txt Resolved

@stephen-derosa stephen-derosa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

one request is to also pair up a PR for the examples repo (if needed) to avoid breaking that

Comment thread scripts/setup-linux-toolchain.sh Resolved
Comment thread docs/building.md Resolved
Comment thread docs/building.md Resolved
Comment thread docs/building.md

<a id="clang-compiler-usage-on-linux"></a>

### Clang compiler usage on Linux

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

curious on the motivation for this being here. I almost think we could put in release notes and move on. Fine keeping it in as a footer too

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Probably me over thinking it. I was pretty shocked to learn we had silently moved compilers under the hood, and esp. from GCC (which I associate with Linux) over to Clang, so I figured it was worth explaining on why if someone's coming into this doc fresh to build on Linux and is also surprised by this.

Totally open to moving to release notes instead, not a bad idea

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

your call -- since these docs are dense it might be nice to trim where possible

Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
@alan-george-lk

Copy link
Copy Markdown
Collaborator Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Could not match GitHub user alan-george-lk to a Devin account. Please make sure your GitHub account is linked in your Devin settings.

@alan-george-lk
alan-george-lk merged commit 980332b into main Nov 3, 2026
27 checks passed
@alan-george-lk
alan-george-lk deleted the alan/feature-linux-compiler branch November 3, 2026 19:53
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.

3 participants