-
Notifications
You must be signed in to change notification settings - Fork 240
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
WIP Added Windows Platform #2272
Conversation
Let's do this already! I've noticed some problems on my latest builds of an app which uses my old branch, so I've added support for MinGW on current sources. And now I see this PR, so I guess we can work together to give this thing enough momentum. See my latest branch: https://github.com/tehKaiN/tangram-es/tree/windows-v4 - builds with GCC7.3 dwarf2-posix. It's very barebones atm (lacks readme changes and font substitution handling) but I guess we can work together to add support for MSVC as well as MinGW. I've reviewed your code a bit. Notable points of interest in my fork in contrast to yours:
stuff which needs more work/insights in your branch:
Would you be interested in rebasing your changes on top of mine? I think my latest branch is as little destructive to current code as possible. This way we can still have self-pipe etc. with only those butcherings which are needed to make it work with MSVC. |
@tehKaiN as I mentioned in PR its mix of your changes(I suspect outdated) and @mathisloge. I'll check your v4 branch later, it looks urlClient.cpp is a problem for me. As I said I can run application, but got 403 error. Also yes code still needs a lot of ifdefs and clean ups, and at the moment its PoC. But its first time I can run application, after few attempts. |
Also please note that I'll be using rebases for my changes, so please be aware of history rewrites. |
The 403 thingy can be related to how curl is built - are you building it using openssl or winssl? |
I use vcpkg for curl, no idea how its build, but so far I noticed url issue at least, still need to fix that first. |
when consuming curl with the feature ssl, then curl will be build with you could force openssl when consuming curl with |
Reduced a bit commit changes and was able to fetch urls now, though currently code crashes:
I first will make code work and later will check how we can merge branches. Currently I manually integrated changes of interest for me. |
Have you tried applying the change in #2271 to fix the 403 error? |
@matteblair yes it seems to be included with new urlClient.cpp/h from https://github.com/tehKaiN/tangram-es/tree/windows-v4 |
27ff372
to
1d61c84
Compare
With the suggested patch to geojson-vt-cpp I was able to build and run in Visual Studio - great work to everyone who helped with this! There is one failing test case now, a result of the URL parser being designed with no regard at all for Windows file paths. I think the change to the URL parser here is reasonable. Strictly speaking, it goes against the RFC that the logic is based on, but it would only cause a practical issue if one constructed a URL with a single-character scheme (I'm not aware of any that exist in real life). I recommend modifying the URLs in the test cases to use a scheme value like Of course, reducing Finally, it will be important to have automated builds of the Windows target to make sure that errors aren't introduced accidentally. Luckily, CircleCI has recently added support for running builds on Windows: https://circleci.com/docs/2.0/hello-world-windows/?section=executors-and-images I don't mind doing the configuration for this myself, since I am already familiar with the tools. |
There are still few other outstanding problems except for urlTests.
Can take care of URL tests and linker warnings, but not sure what to do with urlClient.cpp. |
dunno really, I've just kept the thing as-is, I think it's needed for the self-pipe trick, I think the person who implemented it in the first place could give some more insights. Blame shows @hjanetzek and the commit comment suggests that this was needed in transitioning to curl API responsible fetching more urls in single thread. |
Now I see that the initial select() error is indeed caused by a race condition - the urlclient thread was set up earlier than the self-pipe was initialized. The self-pipe sockets had sometimes the -1 values when thread was looping earlier than the init has completed. See the latest commit on my v4 branch. Why exactly do you have icu/harfbuzz disabled in your build? On MinGW it builds and links just fine - apparently works too. |
I've managed to clean up the WINVER defines - this needs the change from my PR on harfbuzz-icu-freetype, but eliminates the warnings caused by redefinition of WINVER by GLFW. See my branch as usual. This is probably more needed for MinGW since it targets winxp by default - the more recent MSVC are prob'ly targetting win7 by default. |
Fixed code a bit - url tests and urlClient.cpp race condition(thanks @tehKaiN). Work left as I understand:
We can convert some of those points into issues. Let me know what you think. |
do you plan on adding vcpkg.json in general? I don't know how the linkage for android and ios works, but i know that vcpkg can be build for ios/android. |
@mathisloge I got too many errors when trying to integrate geojson-vt-cpp from vcpkg. Just checked that all dependencies are properly forked so I just submit PR there. I think I just overcomplicated things a bit. In general my goal was to use as few vcpkg dependencies as possible in order to minimize changes. |
yes, that is also all good. i think if it is basically wanted by the maintainers, i would also open an extra pr for it |
tangrams/geojson-vt-cpp#3 - PR for geojson-vt-cpp |
I am open to the idea of replacing some dependencies with a package manager! Personally, I don't have much experience with vcpkg so I need to spend some time investigating how it impacts the developer experience on platforms like Android and iOS. For now, since adding a package manager isn't the main purpose of this PR, it seems best to do whatever causes the least disruption. |
@matteblair #2274 have tested this branch with most of the dependencies replaced by vcpkg. But the results are looking kinda strange. |
8f16c53
to
efd1f69
Compare
Windows paths PR - #2276 |
I think this should be minimalistic windows platform support. Remaining 4 bullet points can be converted to issues and addressed separately. List of PRs to submit before this one go in: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed your code a bit. The stuff pointed out makes diffs a bit messy - are those changes really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked now for potential addition of MinGW stuff. I think it's better for submodules/dependencies to check for MSVC because vcpkg is more default for MS compilers - MinGW ppl tend to build their own packages by hand or use submodules where possible.
fb2c80b
to
dffde20
Compare
just out of curiosity @sopyer why are you force pushing the commits instead of "normal" commit / push? |
@mathisloge just old habit from using repo + gerrit - I prefer rebase workflow due to cleaner history. |
#2277 - GL_CHECK PR |
@sopyer I also prefer the history of |
Yeah, having history is better to navigate through the most recent changes. But we digress. When can we expect the merge? I'll add MinGW support after merge as a separate PR. |
The soonest I could review and merge this (and the related PRs) would be this weekend. Unfortunately my regular job keeps me busy on weekdays. Thanks for your patience! |
@matteblair I have updated PR with new pointer to geojson-vt-cpp. I think its ready to be merged in. |
Ok - thanks for your patience! I think we're good to merge this now. I have some minor adjustments in mind, but I will create separate PRs for those after merging. CI is working, aside from an intermittent issue with CircleCI usage limits: #2279 Thanks again for the work to implement this and the feedback on changes! |
Based on work of Mathis Logemann mathisloge@gmail.com and KaiN kain@piwnica.ws
Fully compiles and run with opening folder in VS. Requires vcpkg as package manager.
Patch for geojson-vt-cpp submodule:
TODO: