Skip to content

Commit 41e81f6

Browse files
committed
Workaround for GitHub Actions
https://github.com/sue445/go-gem-wrapper/actions/runs/10475042353/job/29010778469?pr=108 ``` + rake go:test CGO_CFLAGS=-O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdiv-by-zero -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wmisleading-indentation -Wundef -fPIC -I/opt/hostedtoolcache/Ruby/3.3.4/x64/include/ruby-3.3.0/x86_64-linux -I/opt/hostedtoolcache/Ruby/3.3.4/x64/include/ruby-3.3.0 CGO_LDFLAGS=-L/opt/hostedtoolcache/Ruby/3.3.4/x64/lib -lruby -Wl,--unresolved-symbols=ignore-all go test -count=1 ${TEST_ARGS} go: downloading github.com/stretchr/testify v1.9.0 go: downloading github.com/davecgh/go-spew v1.1.1 go: downloading github.com/pmezard/go-difflib v1.0.0 go: downloading gopkg.in/yaml.v3 v3.0.1 gcc_fatalf.c: In function ‘fatalf’: gcc_fatalf.c:19:9: error: function ‘fatalf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] 19 | vfprintf(stderr, format, ap); | ^~~~~~~~ gcc_fatalf.c: At top level: cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics cc1: all warnings being treated as errors ```
1 parent 36a6a6b commit 41e81f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Rakefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ def env_vars
2222

2323
cflags = "#{RbConfig::CONFIG["CFLAGS"]} -I#{RbConfig::CONFIG["rubyarchhdrdir"]} -I#{RbConfig::CONFIG["rubyhdrdir"]}"
2424

25+
# FIXME: Workaround for GitHub Actions
26+
if ENV["GITHUB_ACTIONS"]
27+
cflags.gsub!("-Wno-self-assign", "")
28+
cflags.gsub!("-Wno-parentheses-equality", "")
29+
cflags.gsub!("-Wno-constant-logical-operand", "")
30+
cflags.gsub!("-Wsuggest-attribute=format", "")
31+
cflags.gsub!("-Wold-style-definition", "")
32+
ldflags.gsub!("-Wl,--unresolved-symbols=ignore-all", "")
33+
end
34+
2535
{
2636
"CGO_CFLAGS" => cflags,
2737
"CGO_LDFLAGS" => ldflags,

0 commit comments

Comments
 (0)