[SERVER-41051] add configure check for curl Created: 08/May/19  Updated: 29/May/19  Resolved: 29/May/19

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Sara Golemon
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Security 2019-06-03
Participants:

 Description   

Currently, if I don't have 'curl-devel' package installed, the build will fail at:

src/mongo/util/net/http_client_curl.cpp:35:10: fatal error: curl/curl.h: No such file or directory
 #include <curl/curl.h>
          ^~~~~~~~~~~~~

Unlike other required headers, it appears we don't have a configure check for this one. It would be preferable to have the build fail at config time.



 Comments   
Comment by Eric Milkie [ 29/May/19 ]

I can't reproduce it now! Must have been a dirty build or something.

Comment by Sara Golemon [ 28/May/19 ]

This is actually a bit confusing.

When http_client is determined automatically (you didn't specify --enable-http-client=on/off), it should try to find libcurl and curl.h, if it fails, it should set `http_client=off` which, in util/net/SConscript will build http_client_none.cpp, not http_client_curl.cpp.

The fact that it's trying to build http_client_curl.cpp suggests that the check passed, albiet incorrectly.

Could you provide your scons config.log? I'm curious how you're in this state.

Comment by Eric Milkie [ 21/May/19 ]

I built with the enterprise module, but I didn't pass anything interesting for --enable-free-mon or --enable-http-client. I did use --ssl and --mobile-se=on though.

Comment by Andrew Morrow (Inactive) [ 21/May/19 ]

Also CC mark.benvenuto who may have some additional insight into what is happening here.

Comment by Andrew Morrow (Inactive) [ 21/May/19 ]

The decision about whether the check for curl should be fatal comes out of a complex interplay between the --enable-free-mon and --enable-http-client flags.

You can end up with a non-fatal check if free monitoring ends being off, and HTTP client enablement is left as automatically configured depending on the availability of curl.

However, I would expect that if you ended up in the case where the enablement failed, then we shouldn't be trying to build the http_client_curl.cpp file at all.

sara.golemon, could you take a look?
milkie, do you happen to remember how you were building at the time you got in this state? Was enterprise enabled? Did you pass any interesting values for --enable-free-mon or --enable-http-client?

Comment by Eric Milkie [ 13/May/19 ]

I see now that the configure check exists, but it doesn't fail configure if it's missing. I wonder if we could move this configure check into the Enterprise module and make it fatal if it fails?

Generated at Thu Feb 08 04:56:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.