Skip to content

Conversation

@yutannihilation
Copy link
Contributor

Fix #164

Background

When -pedantic flag is passed via CFLAGS, the aws-lc-sys crate cannot be compiled. R CMD INSTALL is not the case, so the CI is fine without this. However, when using devtools or pak, this flag is passed via pkgbuild.

Why? Pkgbuild's comment says this flag is to "enforce good coding practice" to the R package developers. Also, it says this flag is used on CRAN check. But, considering this package doesn't strongly aim for CRAN (at least at the moment), probably it's fine to ignore the warnings.

https://github.com/r-lib/pkgbuild/blob/d88519a177c18c6a2701e1eaf9fb22d37f9580b9/R/compiler-flags.R#L3-L5

Details

This pull request simply tries to override -pedantic by -Wno-pedantic. In the current Makevars.win.in, I used substr to remove -pedantic flag. However, it seems appending this flag is simpler if this works.

Some more tweaks on Makevars.win.in:

  • Replaced ALL_CPPFLAGS with CFLAGS. CPPFLAGS is C Pre-Processor flags, so I think CFLAGS is appropriate here.
  • Remove outdated comment AWS_LC_SYS_CFLAGS

Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Thank you!

@jiayuasu jiayuasu merged commit 7f91135 into apache:main Oct 5, 2025
8 checks passed
@yutannihilation yutannihilation deleted the fix/r-compiler-flags-from-pkgbuild branch October 5, 2025 02:46
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.

r/sedonadb: Cannot install via pak::pkg_install() due to -Werror flag on compiling aws-lc-sys

3 participants