-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Migration to conda-build 3 and new compilers from Anaconda #460
Comments
It kind of solves the bot issue we have at the moment but we would need to trigger rebuilds when A long term solution would be a service that rebuilds stuff following the dependency tree. One of my ideas for the Google Summer of Code 2018 BTW. I don't have an option on |
I think we can remove toolchain. Do the new compilers have flags like |
I don't think those are defaults. I have needed to add them to some recipes. @mingwandroid, can you tell us why they are not defaults? Are they unsafe in some cases? |
I would rather not add |
Same for |
I always think of |
Adding a check for $CONDA_BUILD would be 'ok' in my opinion, still I do not like passing flags to builds that do not need them and serve no purpose. |
I would like to add a check for $CONDA_BUILD and add these flags when true. When builds fail due to missing this, it is an annoying hurdle for people to learn about. I will try to add this into conda-build today. |
By adding into |
In the activate.sh scripts provided by the compiler wrapper packages, gcc_linux-64 & clang_osx-64
CXXFLAGS would be set equivalently in activate scripts for the CXX packages. (open to suggestions on reordering arguments) |
So, I guess to clarify, this isn't going to be set by conda-build, per se. Conda-build will set CONDA_BUILD, and then the compiler activate scripts will behave a little differently to add these flags. |
A good example of where Adding those flags causes an undeclared, unnecessary and incorrect dependency to creep in to your build. If the package that did depend on libiconv is later corrected so that it doesn't depend on libiconv, you end up with a broken package that links to iconv symbols it never should've linked to (and worse, has a So I'm still reluctantly saying 'ok', but it's really wrong IMHO. |
Yeah, too bad there's no completely clear win here. I think the benefits of adding it outweigh the costs, but there also needs to be a way to disable it. |
Maybe we could delay such a change until conda-build/pyldd is equipped to warn (or better, error) on undeclared dependencies creeping into FWIW, to me it feels like we add those include and link FLAGS to far fewer than half of the recipes in AD5 (but I haven't checked). |
Half of the recipes in AD5 is a lot. If this trips up even 1/100 of the recipes in conda-forge, it's a big waste of people's time. I'd much rather fix the few recipes that this does affect negatively (these seem to be at the bottom of the stack), and have stuff further up the stack "just work" |
There are 198 recipes in |
@mingwandroid it does look like the However, I am more on @isuruf's side. It does looks natural to |
At toolchain, we are setting |
Can conda-build 3 do what Other option would be to remove pinning in recipes and have config.yaml do that. Some issues I have with it are,
|
"-I${PREFIX}/include and -L${PREFIX}/lib does cause real trouble is when you have a dependency on a package that depends on libiconv on linux" -- could the lint checker catch such errors? |
For anyone who wants an example of run_exports and centralized pinning, I've been working on libgdal. here's the recipe: https://github.com/AnacondaRecipes/libgdal-feedstock/blob/master/recipe/meta.yaml Note that there's only one run requirement. The built package gets everything else from its build dependencies' run_exports. The output package metadata looks like:
The actual versions of those inputs come from https://github.com/AnacondaRecipes/aggregate/blob/master/conda_build_config.yaml Note that there are 2 hdf5 versions in that conda_build_config.yaml file - building this libgdal recipe results in 2 output packages - one built for each hdf5 version. |
@msarahan, thanks. That's great.
|
|
As for build triggering based on stuff already being built, that's actually a weak spot that's on my short-term list. The current implementation is an exact build string match. That's way too sensitive and ends up rebuilding when it's not necessary. It should factor in at least 3 things:
|
Like to add on the compiler front that it would be good to sort out how we handle/what we do with the existing LLVM based stack and anything that already relies on them. IOW cc @conda-forge/llvmdev @conda-forge/clangdev @conda-forge/libcxx @conda-forge/openmp |
Why is dev being added to all these package names? I cannot see any reason to do that. You wouldn't name gcc as gccdev for example. What's wrong with flang? Also why was openmp not identified with an llvm- prefix? Names are important and I'd like to know how I can throw my $0.02 in before these things get set in stone. I have ended up having to create metapackages to point back to these names, e.g.: https://github.com/AnacondaRecipes/boost-cpp-feedstock/blob/master/recipe/meta.yaml#L139-L159 With openmp, we might have wanted to use that name as a variant selecting metapackage but can't now. |
As Ray says, I recommend creating metapackages for these. They would point to compiler activation packages (e.g. clang_osx-64), which in turn point to "meat" compiler packages - the actual executables and all that. The more we can agree on flags and centralize compiler packages (not duplicate packages on both conda-forge and defaults), the better (for the sake of cross-channel compatibility). I understand the arguments for keeping conda-forge self-contained, but I do feel like some compromise may be helpful here. We should discuss this in a call, though. Comments aren't really adequate. What Ray is talking about regarding openmp is that there is more than one implementation. Intel also has one. Over time, it will be wise to ditch the existing meaning of the |
The Debian community has very strict naming conventions for packages. For example, python packages are generally named As conda becomes used more and more as a general-purpose package manager, instead of being focused on python, a conda-based distribution would benefit a lot from using such naming conventions. |
Unfortunately, I won't be able to attend the meeting. But what I will say is that this is not a debate that is happening here. Numpy will drop support and then everyone else will have to deal with it (that is unless people who don't bear the maintenance cost object to the plans).
Scipy and Numpy have to ship CRT binaries to comply with the Python specification. This is not an issue that is up for debate, except on the python-dev mailing list. These projects will drop MSVC 2008 as the need to upgrade to C++11 becomes increasingly important. And that means dropping Python 2.7. If you don't like this, then it's too bad. Because this is the future that python-dev has designed, and the decision goes all the way up to the BDFL. It's probably too late to undo at this point. |
OT, but briefly:
On Thu, Nov 9, 2017 at 1:43 PM, xoviat ***@***.***> wrote:
Scipy and Numpy have to ship CRT binaries to comply with the Python
specification. This is not an issue that is up for debate, except on the
python-dev mailing list.
sure it is -- the python.org build of 2.7 for Windows is built with MSVC
2008 -- and that is not going to change.
But IF (and this is a big IF) there is a community demand for py2.7 with a
newer compiler (either before or after 2.7 officially reaches end of life),
then there is no technical reason Anaconda.com or conda-forge, (or whoever)
couldn't provide a python2.7 built with a new and better compiler.
That hasn't been done so far, as compatibility with the python.org builds
has been considered important. But at some point, being able to build
extensions, etc with a modern compiler may be compelling.
However: there are a LOT of reasons to drop 2.7 support anyway -- getting a
newer compiler on Windows should be the least of the reasons. So it looks
like numpy is going to declare a drop date -- and we can all have one less
"platform" to support, so I'll be happy for that day to come
(even though I haven't ported my major projects yet!)
…-CHB
|
Yes, but Anaconda keeps them separate, and use them rarely (like rpy2) when building a python extension.
gfortran on Mac is the best option and flang should be considered only for windows |
I'm sure you already know, but I qualified my statement with "except on the python-dev mailing list." So essentially, what would have to happen is someone would have to start a thread to release a Python 2.8 with a newer ABI. Because projects are not going to use a Python that is not from Python.org. Yes, theoretically it is up for debate (as I qualified). But not here. It's up for debate on python-dev. And it's up for debate in a very hostile environment that's (justifiably) decided on rules (PEP 404) that prohibit exactly the kinds of changes that would need to happen. I'll tip my hat to anyone who manages to get through that. |
Also, I should point out that gfortran on mac is an option precisely because it is compatible with the native (clang) ABI. If gfortran on windows was compatible with the native (UCRT) ABI, then it would be an option on windows as well. But it's not, so it isn't. |
Actually, that was my point -- python-dev has nothing to do with it -- if conda-forge or anaconda.org want to release a 2.7 built with a different compiler on Windows, they can do so -- it just won't be compatible with the python,org build. This isn't all that different than the LInux situation -- plenty of binaries of pythonx.y that aren't binary compatible with each-other (at least before many linux...) The community came to a consensus years ago that standardizing eh Windows build was the best way to go -- but times have changed -- MAYBE it's time for a new approach (NOTE: I"m not advocating for it -- I think there are other reasons to go to py3, so non need to stretch out support for py2) as for "release a Python 2.8 with a newer ABI." - That was proposed a couple years ago by Christian Tismer for Stackless. It was soundly rejected. Part of the point was that a 2.7 built with a different ABI is still 2.7, just like 2.7 on Mac, or Linux, or . is still 2.7. A new ABI is essentially a new platform, not a new python version. And indeed, there is a (at least source) for a VS2010 build of 2.7: https://github.com/ctismer/Python-2.7.5-VS2010 And as for: "projects are not going to use a Python that is not from Python.org. -- not so sure about that, plenty of people are building stuff on top of Anaconda/conda -- it's compatible with python.org, but it's not "from" python.org. This could all be done -- but it would require a significant effort -- and I think that effort should be better spent on porting ot py3 -- then you get py3 and newer compilers for free! (I still have no idea why Stackless hasn't gone to py3 -- wait! maybe it has: https://github.com/stackless-dev/stackless Which might be why Cristian gave up on "2.8" |
Yes, but numpy and scipy will just ignore this build and drop support anyway. That's what I'm saying. |
The moment that projects need to use C++11, they will drop support. The moment they need to use fortran, they will drop support. And then the cleanups begin. Removing all of the Python 2.7 hacks because "we don't need them anymore." And reworking the C API to take advantage of newer Python improvements. And then no matter what you do, you cannot build these projects on Python 2.7. |
While I like where flang is going, realistically it is probably 2 years away from being usable by any serious software distribution as their fortran compiler. While I'm here I would like to clear up some misconceptions that have been thrown about regarding Microsoft C runtime compatibility. Yes, mingw-w64 links to msvcrt.dll. You can load a DLL (such as a python module) that links to that into a Python that's linked to the vs2008 CRT or to the UCRT just fine. The only problem would be if you allocated something from a DLL linked to one C runtime and deallocated it in another or passed OS-level primitives between them. In reality this basically never happens as it would be very poor software design. I have certainly not see it. This is not some theoretical musings, this is reasonably large part of my job. I have built a large amount of python modules that link to mingw-w64 compiled DLLs. Most recently libopus and libvpx linked to OpenCV, running on Python 2 and 3. Also Theano dynamically compiles kernels as python modules using mingw-w64 and loads them dynamically. It is entirely possible (and very easy) to use mingw-w64 with Cython. Our RStudio does something very similar with a program called rsession.exe. It is compiled with VS2015 linking to the UCRT but the vast majority of what it does is done via the r-base dlls and those are all compiled with mingw-w64. Relatedly, all of conda-forge's (and default's) R infrastructure on Windows is compiled with mingw-w64. Another fine example of problem-free mingw-w64 integration with Python on Windows is XGBoost, the recipe for which can be seen at https://github.com/conda/conda-recipes/blob/master/xgboost So I hope @xoviat has not managed to fool anyone into thinking this linking is impossible (or even highly problematic). Blatantly it is not. To get on topic, most fortran software expects to be compiled with either gfortran or something that emulates gfortran's CLI. It is usually driven through Makefiles or autotools. Once flang is mainlined into llvm/clang and once it's been battle hardened by a few years of 'proper' use and once it emulates gfortran's CLI on Windows and once Python 2.7 has actually died, I will happily consider recommending it instead of gfortran. Until then you people promoting flang over gfortran on Windows are just dreaming. |
I agree with that; I even noted:
My central claim was that projects will drop support for Python 2.7.
Not only do I know this, and not only have I enabled SciPy to be built on Python 2.7 with this knowledge, but I have been quite devious. I have convinced a number of projects not to release Python 2.7 wheels on pypi.org for windows in order to inflict maximum pain on Python 2.7 windows users. Coincidentally, this has saved me a not-insignificant amount of effort in packaging these projects.
I'll refer to my earlier statement. I don't disagree that flang is not the ideal compiler. But it gets the job done for many projects, which are usually written in F77 or F90 (flang has some problems with F2008).
|
Please show evidence of this claim. I backed up the claims I made with copious amounts of this, so far you have provided none. |
For reference, the |
I mean come on: scipy/scipy#7616 |
.. because they use C++11 right? Or is it because you've convinced them not to bother? If it's either of those then that's got nothing to do with the issue of fortran though and I would ask that you please stop conflating them, credit your audience with some intelligence. That you are taking and admitting to these acts of sabotage against Python 2.7 on Windows should rule you out from further involvement in this discussion as far as I am concerned. You are far from objective. FWIW, I do not enjoy Python 2.7 on Windows, but I am not going to let that blind me to the correct course of action. |
No. It's because I chose not to package Python 2.7.
No, you're right that it has nothing to do with fortran. Again, I reiterate:
You're correct. I am not objective. But I only have the same view as most of the core developers (@ChrisBarker-NOAA has the same view but just phrases it more nicely). And you might consider why I have this view: every single time I write code, it's always Python 2.7 that fails on the CI. Always. I'm sure that I'm not alone. And I'm biased precisely because I've had to spend extra time supporting a language that I've never used. My only goal is to make the development process seamless and Python 2.7 gets in the way of that. |
Mmm, @wesm was talking about Linux, again, this is further conflation that doesn't help your arguments. To me it seems you are grasping at whatever you can (for it is entirely possible to use C++11, 14 and 1z on macOS and Linux in Python 2 modules using our toolchains). Clearly your goals are not those of conda-forge who aims to build provide builds of software for Python 2 and Python 3 across Windows, macOS and Linux. I would ask you to refrain then from trying to sway this discussion. |
And again, none of this discussion is going to change anything. What I think ultimately doesn't matter. It's what library maintainers and python developers think. |
Sure, if you convince various upstreams to stop supporting Python 2 or Python 2 on Windows then it will become too much work for us to undo your sabotage, but go to town if that's what you think you must do. |
This discussion is about conda-forge and conda-defaults unifying on the same major version of conda-build and the same compilers. I do long for the day when flang can be used and python 2 is dead, but it's not today, and it's not next year either. |
.. is a bit much; better to say I look forward to it! |
Sorry, I meant Python 2.7 on windows. My mistake.
Again, what I think doesn't matter. I only care about this to the extent that I have a reasonable way to install a CRT compatible fortran compiler on windows. I'm going to head out at this point.
I mean if projects drop support for Python 2 on windows, then Python 2 is dead on windows. Right?
Then we're in agreement on this issue. It's just that I've taken concrete steps to achieve this goal. |
@xoviat I have been building C++14 extensions for Python 2.7 for a while without issue. On conda, adding a runtime dependency to the msvc14 runtime only on windows
then populating the
As said earlier by @mingwandroid, as soon as you don't deallocate memory allocated in one dll in another, (which is bad design), you should be fine with this. (that said, you might be considering this a major hack.) |
@xoviat it seems like you did really nice work on the scipy wheels. Why did you use mingw there, but say it's not an option here? I agree that long-term flang will be the best option, but like Ray, I think it'll take time. |
+1. That's always been my claim.
MinGW doesn't currently support reverse-symbol dependencies (although in theory it could). So you can have a fortran symbol that you need in C, but you can't have a C symbol that you need in fortran. Luckily, scipy doesn't have any C symbols that it needs in fortran, but that's not a seamless experience, which is the goal. |
I will say this: if Anaconda can convince the Python core developers to release a theoretical Python 2.8, then I promise not to try to get Python 2 support dropped. @SylvainCorlay is correct. I knew about that option as well (although I admit that I did not consider it until he brought it up), but that's not a seamless experience either, because you can't just trust developers to do the right thing. My goal is for people to run |
Guys, this thread became unmanageable and unproductive. There are many good points here though that we cannot miss. B/c of that I am locking this thread and we should break it down later, after the meeting, into actionable topics. PS: I for one would love to see a hacked 2.8 out there support modern compiler on Windows, but I don't think we, conda-forge, should provide that as the maintenance cost is beyond what we can bare. |
Compiler meeting results: Thursday, Nov 16 9AM Central looks to be the best time. Agenda / notes at https://paper.dropbox.com/doc/Compiler-meeting-20171116-1lYaDIP93JRzzQZBlicxg?_tk=share_copylink |
Mega-thread for discussion and issue tracking with migration.
Currently known things to address:
Added 10/18/2017:
Lots more I'm probably missing here, so please comment and/or modify this issue.
The text was updated successfully, but these errors were encountered: