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

alt-svc build error on ubuntu 18.04: missing struct tm #9989

Closed
bagder opened this issue Nov 28, 2022 · 6 comments
Closed

alt-svc build error on ubuntu 18.04: missing struct tm #9989

bagder opened this issue Nov 28, 2022 · 6 comments
Labels
build CI Continuous Integration

Comments

@bagder
Copy link
Member

bagder commented Nov 28, 2022

The vexxhost CI build with BoringSSL shows this build error of altsvc:

Making all in lib
make[1]: Entering directory '/home/zuul/src/github.com/curl/curl/lib'
make  all-am
make[2]: Entering directory '/home/zuul/src/github.com/curl/curl/lib'
  CC       libcurl_la-altsvc.lo
In file included from altsvc.c:36:
parsedate.h:30:44: error: ‘struct tm’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
 CURLcode Curl_gmtime(time_t intime, struct tm *store);
                                            ^~
altsvc.c: In function ‘altsvc_out’:
altsvc.c:233:13: error: storage size of ‘stamp’ isn’t known
   struct tm stamp;
             ^~~~~
altsvc.c: In function ‘Curl_altsvc_parse’:
altsvc.c:592:36: error: implicit declaration of function ‘time’; did you mean ‘nice’? [-Wimplicit-function-declaration]
             as->expires = maxage + time(NULL);
                                    ^~~~
                                    nice
cc1: all warnings being treated as errors
Makefile:1758: recipe for target 'libcurl_la-altsvc.lo' failed
make[2]: *** [libcurl_la-altsvc.lo] Error 1
@bagder bagder added build CI Continuous Integration labels Nov 28, 2022
@bagder
Copy link
Member Author

bagder commented Nov 28, 2022

We build lots of builds on this platform but this is mysteriously enough the only one that gets this error.

bagder added a commit that referenced this issue Nov 28, 2022
As openssl include files are all using "openssl/*.h", we just risk that
openssl files will "shadow" include files without path.

Fixes #9989
@bagder
Copy link
Member Author

bagder commented Nov 28, 2022

Turns out there's a time.h file in the openssl include dir that we managed to get to "shadow" the real time.h header due to how we setup the include path.

@bagder bagder closed this as completed in 42aa4e1 Nov 28, 2022
@cfc4n
Copy link

cfc4n commented Dec 2, 2022

the same issue on ubuntu 20.04

git clone https://github.com/curl/curl.git
autoreconf -fi
LIBS=-lpthread ./configure --with-ssl=/home/cfc4n/project/boringssl --enable-versioned-symbols
make
sudo make install
sudo ldconfig

output:

make
Making all in lib
make[1]: Entering directory '/home/cfc4n/project/curl/lib'
make  all-am
make[2]: Entering directory '/home/cfc4n/project/curl/lib'
  CC       libcurl_la-altsvc.lo
In file included from altsvc.c:36:
parsedate.h:30:44: warning: ‘struct tm’ declared inside parameter list will not be visible outside of this definition or declaration
   30 | CURLcode Curl_gmtime(time_t intime, struct tm *store);
      |                                            ^~
altsvc.c: In function ‘altsvc_out’:
altsvc.c:233:13: error: storage size of ‘stamp’ isn’t known
  233 |   struct tm stamp;
      |             ^~~~~
altsvc.c: In function ‘Curl_altsvc_parse’:
altsvc.c:592:36: error: implicit declaration of function ‘time’ [-Werror=implicit-function-declaration]
  592 |             as->expires = maxage + time(NULL);
      |                                    ^~~~
cc1: some warnings being treated as errors
make[2]: *** [Makefile:2067: libcurl_la-altsvc.lo] Error 1
make[2]: Leaving directory '/home/cfc4n/project/curl/lib'
make[1]: *** [Makefile:1433: all] Error 2
make[1]: Leaving directory '/home/cfc4n/project/curl/lib'
make: *** [Makefile:1239: all-recursive] Error 1

@cfc4n
Copy link

cfc4n commented Dec 2, 2022

why close PR #9988 ? It resolved my issue.

@jzakrzewski
Copy link
Contributor

why close PR #9988 ? It resolved my issue.

This is the way this project merges PRs - the fix is commited in 42aa4e1 as the closing message statets.

@cfc4n
Copy link

cfc4n commented Dec 2, 2022

got it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build CI Continuous Integration
Development

Successfully merging a pull request may close this issue.

3 participants