kpdyer / fteproxy

programmable proxy for censorship circumvention
https://fteproxy.org/
Apache License 2.0
149 stars 21 forks source link

patch re2 to fix build issue with libc++ #106

Closed lanterndev closed 10 years ago

lanterndev commented 10 years ago

Without these changes, building fteproxy on OS X 10.9 fails with "fatal error: 'tr1/unordered_set' file not found". Including and applying the patch from https://code.google.com/p/re2/issues/detail?id=76 fixes the issue.

https://ceres-solver-review.googlesource.com/#/c/4170/ (which turned up in a search for that error) explains:

Apple switched to using libc++ with 10.9.0 which places unordered_map in std, breaking our assumptions about the platform.

In case it's worth following, there's some recent activity in the re2 project around fixing Darwin build issues. A trail can be followed from https://code.google.com/p/re2/issues/detail?id=99, which is how I found https://code.google.com/p/re2/issues/detail?id=76.

P.S. I'm the person from Brave New Software working on Lantern who introduced himself to you at Real World Crypto. Excited I'm getting to start looking at fteproxy now, and to be submitting a PR on my first night. :)

kpdyer commented 10 years ago

Thanks for the pull request! Your patch does indeed work.

However, we also have the option to update the version of re2 that we use in our Makefile: https://github.com/kpdyer/fteproxy/commit/9984591c5e249f78c0fe3863d903de85aa87a219#diff-b67911656ef5d18c4ae36cb6741b7965L27.

It appears that we can simply update to the 20140111 release of re2, which includes the patch that you've provided. I've tested this latest version and doesn't appear to break anything on the fteproxy side.

I prefer this strategy, because then it means that the fteproxy version of re2 is remaining close to the re2 trunk.

Let me know what you think. I've tested this OSX 10.9 and it works for me.

-Kevin

lanterndev commented 10 years ago

Using a more recent re2 seems preferable to me too as long as it doesn't break anything else. I saw that https://code.google.com/p/re2/issues/detail?id=99 is still open and figured I'd start by submitting the smallest change that fixes this. But if things are working with the latest re2, all the better. Closing this. Thanks for reviewing!

P.S. Would bringing in re2 as a git submodule make testing different versions of it easier? Unfortunately it's a mercurial repo and this search doesn't turn up any up-to-date git mirrors, but this method might work. Not sure if it's worth it.

kpdyer commented 10 years ago

That's an interesting idea to have re2 as a git submodule. I don't like the current setup where we're including an re2 tgz in git. That's for sure not the right way to go, but I don't want users to have to patch/install their own version of re2.

In fact, it might be an possible for me to create my own mirror or re2. Seems like it would make sense, if there is an easy way to automate the mirroring process.

lanterndev commented 10 years ago

Nice! The method I linked to on StackOverflow above (which uses https://github.com/cosmin/git-hg) hopefully turns out to be pretty easy.

I've opened https://code.google.com/p/re2/issues/detail?id=103 though on the off chance the re2 developers want to maintain an official mirror. Feel free to star! /cc @myleshorton @aranhoide @oxtoacart :)

lanterndev commented 10 years ago

No dice on the official re2 git mirror.