-
Notifications
You must be signed in to change notification settings - Fork 238
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
Update to build curl from scratch #225
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It looks like it's basically not possible for MSVC to pick up nghttp2 otherwise because that detection requires `pkg-config`. I'm sort of personally real tired of dealing with build systems, so instead use the `cc` crate to do everything. This commit switches builds from source to always use the `cc` crate and we manually list all the relevant `#define` directives as well as the list of files that we're interested in. This is likely not reproducing exactly what libcurl requires 100%, but it's providing a lot of other benefits: * This build strategy truly will be cross platform modulo us fixing bugs. We can now actually get dependency detection and such working across all platforms as we don't rely on external tools. * We can now use the vanilla upstream `curl` submodule because there's no need to generate a configure script. * The `curl` CLI tool is no longer built, we never needed it anyway! * We have much more precise control about what's happening in that we can precisely and programmatically know what's activated in the build. Downsides of this approach include: * Updates of the `curl` submodule are likely going to be harder as we need to make sure all the right files are built and they're built with the right `#define`s. This is expected to be a very low cost over time compared to the headache dealing with cross-platform builds right now. * We likely aren't building `curl` in the exact same way, for example some `#define` might be required to make curl "go fast" on newer platforms, but we may forget to pass it until much later. This is again, however, seen as not much of a problem compared to the current headache trying to build curl in a cross-platform manner that hooks up all the dependencies correctly.
07f0786
to
7f0f5da
Compare
alexcrichton
added a commit
to rust-lang/git2-rs
that referenced
this pull request
Sep 13, 2018
I've spent too many hours of my life bending over backwards trying to satisfy native libraryies' build systems. The most recent pain is that informing a native build system of its dependencies (such as telling libgit2 where libssh2 is installed) is an absolute never-ending nightmare. The towel is now thrown in as `cmake` is jettisoned and this is now just using the `cc` crate to directly compile all the various C code. For some more info see alexcrichton/curl-rust#225
alexcrichton
added a commit
to alexcrichton/ssh2-rs
that referenced
this pull request
Sep 13, 2018
This has been done in a few other projects and has made it lightyears easier to compile native C code, so let's do it here! More info at alexcrichton/curl-rust#225
alexcrichton
added a commit
to rust-lang/libz-sys
that referenced
this pull request
Sep 13, 2018
No more dealing with tons of platforms and bending over backwards, let's just compile C code. More info in alexcrichton/curl-rust#225
alexcrichton
added a commit
to alexcrichton/ssh2-rs
that referenced
this pull request
Sep 13, 2018
* Remove `cmake` dependency in favor of `cc` This has been done in a few other projects and has made it lightyears easier to compile native C code, so let's do it here! More info at alexcrichton/curl-rust#225
alexcrichton
added a commit
to rust-lang/git2-rs
that referenced
this pull request
Sep 13, 2018
I've spent too many hours of my life bending over backwards trying to satisfy native libraryies' build systems. The most recent pain is that informing a native build system of its dependencies (such as telling libgit2 where libssh2 is installed) is an absolute never-ending nightmare. The towel is now thrown in as `cmake` is jettisoned and this is now just using the `cc` crate to directly compile all the various C code. For some more info see alexcrichton/curl-rust#225
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It looks like it's basically not possible for MSVC to pick up nghttp2 otherwise
because that detection requires
pkg-config
. I'm sort of personally real tiredof dealing with build systems, so instead use the
cc
crate to do everything.This commit switches builds from source to always use the
cc
crate and wemanually list all the relevant
#define
directives as well as the list of filesthat we're interested in. This is likely not reproducing exactly what libcurl
requires 100%, but it's providing a lot of other benefits:
now actually get dependency detection and such working across all platforms as
we don't rely on external tools.
curl
submodule because there's no needto generate a configure script.
curl
CLI tool is no longer built, we never needed it anyway!precisely and programmatically know what's activated in the build.
Downsides of this approach include:
curl
submodule are likely going to be harder as we need tomake sure all the right files are built and they're built with the right
#define
s. This is expected to be a very low cost over time compared to theheadache dealing with cross-platform builds right now.
curl
in the exact same way, for example some#define
might be required to make curl "go fast" on newer platforms, but wemay forget to pass it until much later. This is again, however, seen as not
much of a problem compared to the current headache trying to build curl in a
cross-platform manner that hooks up all the dependencies correctly.