-
Notifications
You must be signed in to change notification settings - Fork 231
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
Add CIBW_ENVIRONMENT option #16
Comments
We discussed in #6 the possibility of a |
#7 would also be useful for this too |
Thanks! Hadn't found that issue. I'll have a look at that, and see what I can do to implement something and get a pull request! |
Did you have anything in mind on what that CIBW_ENVIRONMENT would do? |
CIBW_ENVIRONMENT would purely set environment variables. We'll need format that'll fit into an environment variable itself - I'm thinking space-separated variables, as parsed by |
Sounds reasonable, and fairly easily implementable. I'll start working on that in a bit. Three more questions/thougts:
|
You meant to say Linux here correct? Otherwise I'm confused. I'll give some input when I get some time but just wanted to ask: What issues/limitations are you having using CIBW_BEFORE_BUILD? It's not ideal I know, but I just want to know what specific issues you were having with it. Are you able to get your use case working using BEFORE_BUILD or is it currently not even possible? |
Thanks for the answer!
Yeah, sorry, I'll edit that.
Since that's being run in
The best I can come up with right now is to move the executable So yeah, I could do it (and I will if this issue would be deemed to be 'out of scope' of cibuildwheel), but I'd like to use this project to simplify my building process life, not to make it harder :-D |
I think what has been discussed so far has been the lack of ability to customize the linux docker environment so I would tend to focus on that. But even if focusing on just linux there is the case of 32-bit and 64-bit architectures. Do we provide a separate ENVIRONMENT variable for each of these? Maybe. But if we start going the way of adding specific options for every possible platform things get kinda ugly quick. (And somebody has to maintain that mess..)
And if the |
@tgarc Agreed! We should think this through and not just start adding bits and pieces everywhere. (That's why I started discussing instead of implementing straight away and why I tried to involve you.)
Probably, yeah. I would not be pretty (e.g. writing code to not extend |
I don't know. @joerick ? It seems like if we did remove the 'sh -c' prefix, we wouldn't want to add any |
I think we need to keep the |
@YannickJadoul OTOH, if you only need to modify the docker environment for some pre-build commands you should be able to do that by using |
@tgarc Yeps, that's correct. I would want/need to:
I could add all of this to |
Yeah I wasn't suggesting you do all that in the setup.py. But the two steps of adding the compiler to the PATH and setting CXXFLAGS would seem appropriate to add into your setup.py. Would that make sense in your case? |
Hmm, but I don't feel like tweaking my I mean, of course it's possible, and if needed, I can do that. But it feels the wrong way around, design-wise. (Though, of course, it would fix things.) |
@YannickJadoul I think the planned CIBW_ENVIRONMENT option would fix things for you though? |
Probably, yes. Can't think of a reason yet why it would not. |
😎 great! That's the direction I'd like to go. I won't have time in the next two weeks to implement but PRs are welcome if someone wants to have a go at implementing :) |
Ps @YannickJadoul in the meantime, perhaps something like this in your setup.py would work
(on phone so haven't tested this ⬆️) You could create that file in your Travis yml to keep the settings isolated 🙂 |
@joerick Hmmm, yeah, that would be a reasonably clean solution, actually. I'm not sure how much time I'll have over the next weeks either, but I'll see. If I do, I can see how easy |
I'm getting rather fed up with that whole build environment tweaking :-D
Right there with you! That's why these things take time...if you're like
most people you just want your build automation to work without having to
endlessly tweak it. I would recommend to keep your own fork of cibuildwheel
with the changes you need to work for your build. Then as you feel you've
worked out issues with your own build, you can propose some changes to
cibuildwheel, or - if you don't have the time or patience - let people know
what you did to make it work for your build so people can learn from it.
Luckily it is easy enough in a travis/appveyor build environment to git
clone your own fork of cibuildwheel. That's what I've been doing anyway...
…On Thu, Jul 13, 2017 at 9:22 AM, Yannick Jadoul ***@***.***> wrote:
@joerick <https://github.com/joerick> Hmmm, yeah, that would be a
reasonably clean solution, actually.
Right now, I had actually realized it's not that much code (since I don't
want tests, or so, those are done immediately by CMake, and not via
wheels), and started making an ad-hoc implementation of that in my
.travis.yml. (Since ... I want to program again; I'm getting rather fed
up with that whole build environment tweaking :-D )
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAaVHIUxBJwToD-PtY0iY4N8V6vkycxhks5sNig9gaJpZM4OOYxw>
.
|
@tgarc Yeah, that's true, actually. I was planning that at some point, but then I'd forgotten about the possibility. |
I still don't know what an implementation of CIBW_ENVIRONMENT would look like. Would it set the environment for all build steps? Only the pip wheel step? |
All the build steps, I'd imagine. I think that covers the simplest use cases and follows the principle of least surprise. |
Sorry to open yet another issue, but in my efforts to try getting my wheels built on the manylinux docker image, I'm running into the problem that there seems no way in
cibuildwheel
to prepare the container (i.e. install stuff and set environment variables).In my particular case, for example, I want to install a newer GCC toolchain (https://github.com/squeaky-pl/centos-devtools/releases), set the PATH to use it, and set the
CXXFLAGS
to be picked up by my build.Am I overlooking a possibilty, or is this currently not possible?
(Probably also related to #13)
The text was updated successfully, but these errors were encountered: