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

Fix PDAL \ untwine on windows #178

Merged
merged 18 commits into from
Apr 19, 2021
Merged

Conversation

SrNetoChan
Copy link
Contributor

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

Trying to finish #174 work, which is failing on windows because of untwine.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@SrNetoChan
Copy link
Contributor Author

@gillins this is the base for fixing untwine build. From what I was able to understand untwine replaces entwine. Maybe @hobu can point us in the right direction.

@hobu
Copy link
Contributor

hobu commented Mar 6, 2021

Untwine does not replace Entwine. It is an alternative generator that has some features that are more useful in the context of desktop software like QGIS:

  • Constrained memory usage exchanged for building a local disk cache
  • Bottom-up instead of top-down building of the tree
  • Less features than Entwine (not all encodings supported, no addons, etc)
  • Parallelization is left to the user

@SrNetoChan
Copy link
Contributor Author

So, it replaces entwine under QGIS context, right? Or there is any benefit in also installing entwine alongside QGIS?

@hobu
Copy link
Contributor

hobu commented Mar 6, 2021

So, it replaces entwine under QGIS context, right?

It should produce 'equivalent' output under a different usage scenario – the need to constrain memory usage. The cost of this behavior is a local cache of the data as it is built.

Or there is any benefit in also installing entwine alongside QGIS?

If you wanted some of the other features that entwine provides it would be useful. QGIS can open Entwine-created EPT collections the same as Untwine.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • Selectors are suggested to take a <two spaces>#<one space>[<expression>] form. See lines [11]

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@gillins
Copy link
Contributor

gillins commented Mar 11, 2021

Finally managed to get some time to boot my old Windows PC and have a look at this. Turns out that #including Windows.h brings in winsock.h no matter what you do unless you #define WIN32_LEAN_AND_MEAN. I have a workaround in (https://github.com/conda-forge/qgis-feedstock/pull/178/files#diff-913bcc89317907aa358d649f080993946cc0b6b6373b7f44df9f35bf4653b212)

@hobu we need your advice on the below:

  1. You already define WIN32_LEAN_AND_MEAN in the standalone untwine (https://github.com/hobu/untwine/blob/main/cmake/win32_compiler_options.cmake#L9) - should we try and upstream back to qgis? Not sure if some of the other options you use should go back there also?

  2. I had to create another patch (https://github.com/conda-forge/qgis-feedstock/pull/178/files#diff-a93dca7189807151286b0a389f6700262c034808b63d06144344c4085eae88c7) to fix MapFile.cpp on Windows. Does this make sense? I can submit this back to untwine (and also qgis) if you like?

  3. I'm now getting weird C++ errors I don't understand (only with MSVC) in FileProcessor.cpp (https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=288844&view=logs&j=00f5923e-fdef-5026-5091-0d5a0b3d5a2c&t=3cc4a9ed-60e1-5810-6eb3-5f9cd4a26dba&l=3027). Is there a simple fix, or should we disable untwine for Windows?

Should we be building untwine in conda-forge and just linking to it (is it likely other applications will use it?), or is building this way fine for now?

@hobu
Copy link
Contributor

hobu commented Mar 11, 2021

@abellgithub will have to chime in here on the specifics of Untwine building. We haven't seen any of these issues, but again we're not the ones embedding it into a bigger application either.

@ocefpaf
Copy link
Member

ocefpaf commented Mar 12, 2021

Finally managed to get some time to boot my old Windows PC and have a look at this.

@gillins conda-forge got a donation from OVH for Windows "cloud" Windows machine. It is quite robust and it is what we are using to build Qt. If that would help you with qgis please let me know and we can work something out to give you access to it.

@gillins
Copy link
Contributor

gillins commented Mar 13, 2021

If that would help you with qgis please let me know

Thanks @ocefpaf will let you know. I need a Windows machine going anyway for work stuff so probably ok ATM. If we need to build qgis ourselves regularly (i.e. if it started timing out on the CIs) this could be a good solution as my internet is rubbish...

@gillins gillins mentioned this pull request Mar 20, 2021
3 tasks
@SrNetoChan
Copy link
Contributor Author

@gillins should I rebase all commits that have been merged meanwhile?

@gillins
Copy link
Contributor

gillins commented Mar 22, 2021

Let's wait until they get back to us. I suspect they'll say Windiws isn't supported yet so we we will likely have to wait for a future version anyway...

@SrNetoChan
Copy link
Contributor Author

Got lost, who are "they"?

@gillins
Copy link
Contributor

gillins commented Mar 22, 2021

Got lost, who are "they"?

Sorry, I didn't make that clear. I meant the untwine maintainers that were pinged above (see #178 (comment))

@hobu
Copy link
Contributor

hobu commented Mar 22, 2021

Are you waiting for patches to fix these windows issues? We don't have the cycles to do the work on that topic at the moment, but we would take patches and cut a release if you or someone made PRs to fix them.

@hobu
Copy link
Contributor

hobu commented Mar 22, 2021

Jürgen was able to make an OSGeo4W release with Untwine support, so I think the issue here must be the discrepancy between compiler settings of whatever he is using and Conda's.

@SrNetoChan
Copy link
Contributor Author

@hobu I think @gillins was referring to some hint of what could be wrong, not a fix.

@jef-n
Copy link

jef-n commented Mar 23, 2021

Thanks for the patches @jef-n - I'll use these as a guide and see if I can get it all compiling. Are you planning to upstream these?

Sure, once the old osgeo4w is replaced by the new one - the previous vc didn't need these changes (and I didn't verify whether it builds with them).

@gillins
Copy link
Contributor

gillins commented Mar 24, 2021

@jef-n I'm still getting weird C++ errors I don't understand, plus I need to make different changes from what you have to get it that far. There must be differences in the versions/environments that we are using. I see @abellgithub has already incorporated one of the changes I had to make (that you didn't): hobuinc/untwine@c7f94c1

So I am all a bit confused. I'm going to close this and wait for a future version of untwine to be incorporated in qgis before trying again. If anyone feels they can get this working, please go ahead!

@gillins gillins closed this Mar 24, 2021
@abellgithub
Copy link

abellgithub commented Mar 24, 2021

If you post a link to the error output, I can take a look.

@gillins
Copy link
Contributor

gillins commented Mar 24, 2021

https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=294057&view=logs&j=5be07ae1-d8ba-5406-47b6-8e3a3a12f825&t=0bf03e01-0bec-5b85-5316-b1633322e895&l=1805

..\external\untwine\epf\FileProcessor.cpp(73): error C3493: 'count' cannot be implicitly captured because no default capture mode has been specified

@abellgithub
Copy link

abellgithub commented Mar 24, 2021 via email

@SrNetoChan
Copy link
Contributor Author

@gillins said:

So I am all a bit confused. I'm going to close this and wait for a future version of untwine to be incorporated in qgis before trying again. If anyone feels they can get this working, please go ahead!

Fair enough! Thanks for all your efforts Sam.

@gillins
Copy link
Contributor

gillins commented Apr 13, 2021

@abellgithub Did you have any thoughts on this? We are tied to particular versions of VS to keep compatibility with Python....

@hobu
Copy link
Contributor

hobu commented Apr 13, 2021

hobuinc/untwine#57 fixed this issue. Grab the latest main branch from https://github.com/hobu/untwine/ and it should work.

@gillins gillins reopened this Apr 13, 2021
@gillins
Copy link
Contributor

gillins commented Apr 13, 2021

@conda-forge-admin, please rerender

@SrNetoChan
Copy link
Contributor Author

image

@SrNetoChan
Copy link
Contributor Author

@gillins there's a new 3.18.2 version, which was already merged into master, but with pdal disabled for windows. Should I try to bump it here, or create a new PR for it, and if needed we try to cherry pick the patches?

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I was trying to look for recipes to lint for you, but it appears we have a merge conflict.
Please try to merge or rebase with the base branch to resolve this conflict.

Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@gillins
Copy link
Contributor

gillins commented Apr 17, 2021

Thanks @SrNetoChan , hopefully I'll have some time to look into this during the week

@SrNetoChan
Copy link
Contributor Author

What, wait, did it work?!

What a flight!! What fixed it?

Thanks for all your work!! @gillins

@gillins
Copy link
Contributor

gillins commented Apr 19, 2021

Trick was to define WIN32_LEAN_AND_MEAN plus including shellapi.h in qgisapp.h to workaround this not being included as part of windows.h... I'll try and get this upstream to QGIS as soon as I can.

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

Successfully merging this pull request may close these issues.

7 participants