Repository navigation
fix(rdp): bump Go to 1.26.11 and strip LLVM bitcode from the bridge #502
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
60a6905
chore(deps): update Go version to 1.26.11 and add shellescape dependency
victorvhs017 c09d531
feat(rdp): add script to strip LLVM bitcode and update workflow
victorvhs017 e1922f2
feat(ci): add macOS job for RDP bridge build in GitHub Actions
victorvhs017 4693852
chore(ci): update GitHub Actions workflow permissions
victorvhs017 787a8ae
chore(deps): update shellescape dependency to indirect in go.mod
victorvhs017 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module github.com/Infisical/infisical-merge | ||
|
|
||
| go 1.26.10 | ||
| go 1.26.11 | ||
|
|
||
| require ( | ||
| cloud.google.com/go/iam v1.1.11 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| [toolchain] | ||
| channel = "1.95.0" | ||
| components = ["rustfmt", "clippy"] | ||
| components = ["rustfmt", "clippy", "llvm-tools"] | ||
| profile = "minimal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
| # Since Go 1.26.11 (CVE-2026-97038), `go build` refuses to link any library under a -L directory named | ||
| # in a #cgo LDFLAGS directive if its objects carry LLVM bitcode sections, and Rust's precompiled | ||
| # standard library ships with bitcode embedded. The bridge's directive names target/release, so a | ||
| # `cargo build --release` followed by `go build -tags rdp` fails until this runs. The linker never | ||
| # reads those sections, so removing them leaves the linked code unchanged. | ||
| # | ||
| # Release builds don't need it: they pass the per-target directory in CGO_LDFLAGS, which Go doesn't | ||
| # scan. Don't use it on a Windows (COFF) archive: Go 1.26.11 rejects the stripped result. | ||
| # | ||
| # Usage: strip-llvm-bitcode.sh <cargo release dir>, e.g. strip-llvm-bitcode.sh target/release | ||
| set -euo pipefail | ||
|
|
||
| dir=${1:?usage: strip-llvm-bitcode.sh <cargo release dir>} | ||
| host=$(rustc -vV | sed -n 's/^host: //p') | ||
| objcopy="$(rustc --print sysroot)/lib/rustlib/$host/bin/llvm-objcopy" | ||
| if [ ! -x "$objcopy" ] && [ ! -x "$objcopy.exe" ]; then | ||
| echo "llvm-objcopy not found in the Rust toolchain; run: rustup component add llvm-tools" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Go checks every library under the -L directory, including the copy Cargo keeps in deps/. | ||
| stripped=0 | ||
| for lib in "$dir"/libinfisical_rdp_bridge.a "$dir"/deps/libinfisical_rdp_bridge-*.a; do | ||
| [ -f "$lib" ] || continue | ||
| "$objcopy" \ | ||
| --remove-section=.llvmbc --remove-section=.llvmcmd \ | ||
| --remove-section=__LLVM,__bitcode --remove-section=__LLVM,__cmdline \ | ||
|
victorvhs017 marked this conversation as resolved.
Resolved
|
||
| "$lib" | ||
| stripped=$((stripped + 1)) | ||
| done | ||
| if [ "$stripped" = 0 ]; then | ||
| echo "no libinfisical_rdp_bridge.a in $dir" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "removed LLVM bitcode from $stripped archive(s) in $dir" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.