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

Externals: Update libcurl #11853

Merged
merged 1 commit into from Jul 24, 2023
Merged

Conversation

noahpistilli
Copy link
Member

#11746 is depends on this because one of the mail endpoints requires us to send MIME data, which the current version of libcurl in Externals does not support.

@AdmiralCurtiss
Copy link
Contributor

CMake with our External is still broken but I think this should fix the MSVC project?

@JMC47
Copy link
Contributor

JMC47 commented Jun 2, 2023

What's going on with the broken builds here?

@noahpistilli
Copy link
Member Author

There is no working CMake for the curl External currently.

@JMC47
Copy link
Contributor

JMC47 commented Jun 5, 2023

@dolphin-emu-bot rebuild

@AdmiralCurtiss
Copy link
Contributor

I don't think using a pre-configured config header file for every platform is a good idea. For the Windows VS project, yeah sure, but for everything else it should just generate it.

I'm also questioning just globbing for all the *.c files in the external, but that might be okay depending on how curl is set up, I'd have to check...

@AdmiralCurtiss
Copy link
Contributor

What exactly do we need from curl anyway, just HTTP/HTTPS?

@noahpistilli
Copy link
Member Author

Pretty sure that is it yes.

@AdmiralCurtiss
Copy link
Contributor

I give up, this entire thing refuses to work properly (on Windows, anyway). Using the CMakeLists directly doesn't work (it fails to detect various headers and symbols that should be there), using FetchContent() doesn't work (it fails to link against our other externals), using a preconfigured header doesn't work (this actually builds but all the HTTPS calls fail at runtime). If you want to figure this out be my guest, but I'm getting too frustrated with this. I genuinely think it might just be easier to use a different library that doesn't have a million settings instead.

Here's my current state if you want to mess with it: https://github.com/AdmiralCurtiss/dolphin/tree/curl812

@AdmiralCurtiss
Copy link
Contributor

The hacky solution of just not using a config header on Windows seems to work, which makes no sense to me and I still hate the preconfigured header for the other platforms, but I guess I'll just hope that they use their system curl instead...

list(APPEND CURL_LIBS "-framework SystemConfiguration")
endif()

file(GLOB SRCS curl/lib/*.c curl/lib/vauth/*.c curl/lib/vquic/*.c curl/lib/vssh/*.c curl/lib/vtls/*.c)
Copy link
Contributor

@iwubcode iwubcode Jun 7, 2023

Choose a reason for hiding this comment

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

Globbing is generally frowned upon but should we consider using CONFIGURE_DEPENDS for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

The reason you don't usually glob for sources is because then CMake can't know when new files are added or files are deleted. That's not really a concern for an external we update once in a blue moon, as long as we also change any CMakeLists in the same commit that we update the external.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I was aware why, I didn't know if we wanted to handle changes from the glob. This should be relatively rare, just thought I'd bring it up as I wasn't sure if it had been discussed before.

Comment on lines 51 to 60
if (WIN32)
target_compile_definitions(curl PUBLIC "BUILDING_LIBCURL=1" "CURL_STATICLIB=1" "CURL_DISABLE_LDAP" "USE_WINDOWS_SSPI" "USE_SCHANNEL")
target_link_libraries(curl Crypt32.lib)
else()
target_compile_definitions(curl PUBLIC "BUILDING_LIBCURL=1" "CURL_STATICLIB=1" "USE_MBEDTLS=1" "HAVE_CONFIG_H=1" "CURL_DISABLE_LDAP")
if (CURL_CA_PATH_SET)
target_compile_definitions(curl PUBLIC CURL_CA_PATH="${CURL_CA_PATH}")
endif()
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would assume BUILDING_LIBCURL=1 should be PRIVATE?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree, that should be private.

@noahpistilli noahpistilli force-pushed the update-curl branch 2 times, most recently from 30f4d01 to 3a4e4f1 Compare July 18, 2023 01:57
qurious-pixel added a commit to qurious-pixel/dolphin that referenced this pull request Jul 18, 2023
@AdmiralCurtiss
Copy link
Contributor

Alright, I already said this on Discord, but for posterity.

I think this is terrible. A library as big and complicated as curl should absolutely not use a single preconfigured header for every platform we build on.

However, I also acknowledge that I have no idea how to get CMake to build the correct config header in our setup -- I've tried and failed myself. I also realize that the previous version of curl we're updating from has done the exact same thing. Given that, and that this update is required in order to make some missing WiiConnect24 functionality work, I am okay with merging this and leaving it as-is as long as no other maintainer has any issues with it. Ideally we can eventually switch to a better system for dependency management (FetchContent_Declare() pointing at the submodule should work in theory...), which should make it actually possible to just use the upstream CMakeLists.

Please fix the BUILDING_LIBCURL define though.

@AdmiralCurtiss
Copy link
Contributor

Well, no one spoke up against this, so let's hope this doesn't break compiling on half the linux distros...

@AdmiralCurtiss AdmiralCurtiss merged commit 553824e into dolphin-emu:master Jul 24, 2023
11 checks passed
@licaon-kter
Copy link

@AdmiralCurtiss
Copy link
Contributor

I'm not sure if that's even exploitable with how we use curl in Dolphin but can't hurt, I suppose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants