-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Activating the gcc compiler should not set the install prefix #77
Comments
CC @jakirkham |
Why? |
Setting this flag was causing us some issues in our build scripts. Given recipes using CMake generally already specify |
How? |
I'll let Vyas explain the build issue since he's dug into it more That said, am not understanding why |
There are dozens of build scripts with just |
Was curious how many recipes might be in this situation so did a quick This is more than would be comfortable to PR manually, but maybe it could be done in an automated way. The change would be
|
@vyasr can you help us understand more what is happening? What kind of issues? Thanks! |
Another use case for the install prefix being set are folks prototyping with conda. We do want that set already to avoid path confusion. Also, fixing many feedstocks instead of one does not sounds like the best strategy. @jakirkham and @vyasr is there a fix for you problem that does not require us to change multiple feedstocks and break a user experience on folks who use cmake with conda envs? |
The problem that we ran into may be a bug in scikit-build, and I just documented it here. Some quick background: scikit-build is a build tool that injects CMake into the various setuptools commands to facilitate better integration of Python packages with C(++) libraries and making it easier to develop extension modules with complete build systems for the Python and C(++) components. The issue appears to be a problem with the way that While our problem may be caused by unexpected behavior in scikit-build, though, I raised this discussion at @jakirkham's request because I think it is independently worth having. As @jakirkham pointed out, it may not really make sense to default the install prefix within this script. Most installations that actually care about the prefix probably should be setting the prefix on their own, and expecting a default behavior seems like it would be unexpected behavior if not for the fact that recipes have been taught to rely on it up to this point. |
Outside of conda-forge I kind of agree. But in in our case it does make sense b/c we do want to force packages to use that install prefix to keep things consistent. Even when prototyping locally as I mentioned above. I believe you can unset that if you are using our compilers in another context that is not building packages for conda-forge. Would that help you? |
scikit-build already removes |
It's certainly not work having if it would break 160 feedstocks just to make it easier for one feedstock. That's incredibly selfish IMHO. You can remove (Btw as John said, we can fix 160 feedstocks before we do the change, but people expect the variable now) |
Yup, that's the workaround that I already have in place and that does resolve the issue for our use case. Thanks @ocefpaf!
I'm not suggesting that we make this change just to fix a single feedstock, I'm suggesting it because as a developer it would adhere more to the behavior that I would expect. That's no different than a package making a breaking API change in the belief that the breaking change improves the experience in the long run. If you disagree that this is a useful change, perhaps because you agree with @ocefpaf that in the context of conda-forge it does make sense to enforce a standard install prefix (and I do see that point) please say so. |
Yes, I disagree that this is a useful change. Sorry I didn't make it clear. I think what you are asking for will degrade the experience in the long run instead of improve. Can you also comment on #77 (comment)? |
You are correct, we're running into this problem because we have build scripts that perform their own command line parsing and attempt to combine the environment variables with command line-provided I'll reiterate that I'm not suggesting the change here as a way to fix our issues, but only if it improves the developer experience with conda-forge and conda-build. I'd like to hear from @jakirkham on that topic since I suspect he'll have a much more informed take than I will. |
@vyasr just to put things on perspective. When it comes to packaging there is no right answer. There are so many bells and whistles we need to adjust. For example, coming from a pure cmake perspective, I would say that what we do in conda-forge is outrageous. Really, setting your own prefix in a compiler activation!? However, from the conda-forge packaging side, that is an option that ensure consistency in our ecosystem. I was an openSUSE packager for a while and we tried to make our recipes consistent with Fedora, jeez, you have no idea of how the build flags and env vars were messy and inconsistent. And it was all "Linux" with the same build tools! TL;DR we appreciate your input and we want to find the solution that takes the path of least resistance (and minimum change). |
Hopefully this is clear at this point, but no one is suggesting making a change without considering effects (or just to solve a particular issue). Discussion is certainly a goal here (hence why this is an issue) with an eye towards broader usability (though this came out of an odd edge case). Think the important point to highlight is that our compilers are used outside conda-forge to build things in a way that is compatible with conda-forge either as part of development or to produce binaries downstream of conda-forge. Setting CMake flags like this complicates these efforts. Can people This could also present other issues for us down the road ( in fact in the more general activation case this already has with To this end wonder if there is a better approach. For example these might make more sense in the CMake package itself (maybe in some configuration file). Alternatively maybe we can bake these things into conda-build itself (as was done with |
EDIT: This is a response to Filipe's comment two ago, looks like John and I posted at the same time. Yeah that's very valid. Coming from a CMake perspective I was initially quite confused while debugging because the issue only occurred in a very specific instance that turns out to be our CI step that actually uses Using scikit-build adds another layer of potential confusion to the mix because various build steps may be making assumptions about how Python builds don't use CMake. I will add that I find the lines that @isuruf linked to in scikit-build a bit unexpected as well; while it's fine for scikit-build to respect a special environment variable |
None of the concerns by @jakirkham is particular towards
Please raise it with upstream. Upstream added it to support cross-compiling in conda-forge projects specifically. |
Opened scikit-build/scikit-build#722 to discuss the upstream scikit-build question. |
Currently the activate-gcc.sh script sets numerous environment variables when run, including populating the CMake variable
CMAKE_ARGS
. While most of the contents of this variable are fine, the scripts should leave settingCMAKE_INSTALL_PREFIX
to individual recipes using this script. I am proposing to remove this line so that theCMAKE_ARGS
do not contain the install prefix by default.The text was updated successfully, but these errors were encountered: