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

Fluent Bit 1.8.8 fails to build on CentOS 7 #4178

Closed
LionelCons opened this issue Oct 11, 2021 · 4 comments · Fixed by #4196
Closed

Fluent Bit 1.8.8 fails to build on CentOS 7 #4178

LionelCons opened this issue Oct 11, 2021 · 4 comments · Fixed by #4196

Comments

@LionelCons
Copy link
Contributor

Trying to build 1.8.8 on CentOS 7, I get an error:

[ 92%] Building C object tests/internal/CMakeFiles/flb-it-aws_credentials_ec2.dir/aws_credentials_ec2.c.o
In file included from fluent-bit-1.8.8/tests/internal/aws_credentials_ec2.c:4:0:
fluent-bit-1.8.8/tests/internal/aws_client_mock.c: In function ‘flb_aws_client_mock_vtable_request’:
fluent-bit-1.8.8/tests/internal/aws_client_mock.c:171:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < response->length; ++i) {
     ^
fluent-bit-1.8.8/tests/internal/aws_client_mock.c:171:5: note: use option -std=c99 or -std=gnu99 to compile your code
fluent-bit-1.8.8/tests/internal/aws_client_mock.c:181:13: error: ‘for’ loop initial declarations are only allowed in C99 mode
             for (int h = 0; h < dynamic_headers_len; ++h) {
             ^
make[2]: *** [tests/internal/CMakeFiles/flb-it-aws_credentials_ec2.dir/aws_credentials_ec2.c.o] Error 1
make[1]: *** [tests/internal/CMakeFiles/flb-it-aws_credentials_ec2.dir/all] Error 2
make: *** [all] Error 2

FWIW, this is with:

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

1.8.7 was fine and 1.8.8 on CentOS 8 is fine too.

@LionelCons
Copy link
Contributor Author

I see that tests/internal/aws_util.c uses the more portable:

    int i;
    ...
    for (i = 0; i <= 975; i++){
        tmp[i] = 'a';
    }

So the problem is likely in aws_credentials_ec2.c and not in the compiler options.

@nokute78
Copy link
Collaborator

Could you send a patch ?

@LionelCons
Copy link
Contributor Author

Done!

@LionelCons
Copy link
Contributor Author

Argh! This fails for 1.8.9 too because the change applied in master has not been propagated to the 1.8 branch!

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 a pull request may close this issue.

2 participants