Skip to content

.cargo/config.toml: set CFLAGS='-std=gnu17' #7944

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 1 commit into from
May 20, 2025

Conversation

cakebaker
Copy link
Contributor

This PR sets CFLAGS='-std=gnu17' in order to make onig compile with GCC 15, which by default uses a newer C standard (C23).

It temporarily fixes #7904 until there is a new onig release. An alternative approach would be to change the dependency line for onig in Cargo.toml as suggested in #7904 (comment)

@cakebaker cakebaker force-pushed the cargo_config_set_cflags branch from 4b6802e to e3c0e20 Compare May 16, 2025 15:09
@cakebaker cakebaker marked this pull request as draft May 16, 2025 15:20
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

to make onig compile with GCC 15, which by default uses a newer C
standard (C23)
@sylvestre sylvestre force-pushed the cargo_config_set_cflags branch from e3c0e20 to 992e162 Compare May 19, 2025 09:18
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker marked this pull request as ready for review May 19, 2025 11:36
[target.x86_64-unknown-redox]
linker = "x86_64-unknown-redox-gcc"

[env]
PROJECT_NAME_FOR_VERSION_STRING = "uutils coreutils"
# TODO remove when there is an onig version > 6.4.0, https://github.com/rust-onig/rust-onig/issues/196
CFLAGS='-std=gnu17'
Copy link
Contributor

@sylvestre sylvestre May 20, 2025

Choose a reason for hiding this comment

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

this is going to be passed to all C code
it isn't a big deal but i still would like to mention it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean with "i still would like to see it"?

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant "mention" :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, ok :) If it's an issue, we could use onig from github.

@sylvestre sylvestre merged commit 4fd11ab into uutils:main May 20, 2025
70 checks passed
@cakebaker cakebaker deleted the cargo_config_set_cflags branch May 20, 2025 07:48
@sylvestre
Copy link
Contributor

@cakebaker https://github.com/uutils/coreutils/actions/runs/15131823978/job/42534881943?pr=7931 it broke the build here

warning: onig_sys@69.8.1: x86_64-linux-gnu-gcc: error: unrecognized command line option '-std=gnu17'
error: failed to run custom build command for onig_sys v69.8.1

cakebaker added a commit to cakebaker/coreutils that referenced this pull request May 20, 2025
with "unrecognized command line option '-std=gnu17'"
@cakebaker cakebaker mentioned this pull request May 20, 2025
sylvestre added a commit that referenced this pull request May 20, 2025
@cakebaker cakebaker mentioned this pull request May 21, 2025
RenjiSann pushed a commit to RenjiSann/coreutils that referenced this pull request May 23, 2025
with "unrecognized command line option '-std=gnu17'"
willshuttleworth pushed a commit to willshuttleworth/coreutils that referenced this pull request May 24, 2025
with "unrecognized command line option '-std=gnu17'"
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.

Failed cargo install on fresh fedora 42 perhaps missing dependencies?
2 participants