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

ruby: make it possible to specify compiler for C extension #19863

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Jan 3, 2025

Previously running gem install google-protobuf --platform ruby used the default C compiler specified by mkmf, which uses RbConfig::MAKEFILE_CONFIG["CC"] and RbConfig::MAKEFILE_CONFIG["CXX"].

This commit supports using CC, CXX, and LD from the environment:

export CC=my-custom-gcc
export CXX=my-custom-g++
gem install google-protobuf --platform ruby

Most native gems, such as grpc and nokogiri, allow for this.

@stanhu stanhu requested a review from a team as a code owner January 3, 2025 20:32
@stanhu stanhu requested review from haberman and removed request for a team January 3, 2025 20:32
Previously running `gem install google-protobuf --platform ruby`
used the default C compiler specified by `mkmf`, which uses
`RbConfig::MAKEFILE_CONFIG["CC"]` and
`RbConfig::MAKEFILE_CONFIG["CXX"]`.

This commit supports using `CC`, `CXX`, and `LD` from the environment:

```
export CC=my-custom-gcc
export CXX=my-custom-g++
gem install google-protobuf --platform ruby
```

Most native gems, such as grpc and nokogiri, allow for this.
@stanhu stanhu force-pushed the sh-support-custom-gcc branch from 46e0dc3 to 33693f8 Compare January 3, 2025 20:38
@anandolee anandolee requested review from esrauchg and removed request for haberman January 4, 2025 01:39
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