Skip to content
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

build: enable cgo #273

Merged
merged 1 commit into from
Nov 7, 2024
Merged

build: enable cgo #273

merged 1 commit into from
Nov 7, 2024

Conversation

jraman567
Copy link
Collaborator

cgo allows the use of C libraries in GoLang. Some packages like sqlite3 depend on this feature.

We could allow this, barring any security issues (e.g., we can't confirm the hash of a C library before linking it).

cgo allows the use of C libraries in GoLang. Some packages like sqlite3
depend on this feature.

We could allow this, barring any security issues (e.g., we can't confirm
the hash of a C library before linking it).

Signed-off-by: Jagannathan Raman <[email protected]>
@thomas-fossati
Copy link
Contributor

thomas-fossati commented Oct 11, 2024

cgo allows the use of C libraries in GoLang.

Skimming cgo documentation:

"The cgo tool is enabled by default for native builds on systems where it is expected to work. It is disabled by default when cross-compiling as well as when the CC environment variable is unset and the default C compiler (typically gcc or clang) cannot be found on the system PATH."

So this change would only have an effect either when cross-compiling or on pretty exotic platforms, right?

Some packages like sqlite3 depend on this feature.

I didn't know it (or I used to know and then I forgot :-)) but you are right. The fact we haven't observed any build failure (at least in the dev, CI and deployed platforms we know of) is likely because of the "default enable cgo" policy of the go build environment.

It seems to me that @jraman567's suggested change is correct and should be merged.

@setrofim WDYT?

Copy link
Collaborator

@setrofim setrofim left a comment

Choose a reason for hiding this comment

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

LGTM

@setrofim setrofim merged commit 7b4323c into main Nov 7, 2024
9 checks passed
@setrofim setrofim deleted the cgo-enablement branch November 7, 2024 09:50
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