-
Notifications
You must be signed in to change notification settings - Fork 88
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
Environment variables defined in library_builders.sh are problematic #116
Comments
The best ideas I currently have are:
|
Multibuild builds fat OSX binaries by default. If you want, submit a PR moving/disabling that behavior with an environment variable. |
I think the user will usually want the build arteifacts on the include / library path - right? Hence the build flags being global. It's not a bad idea adding something like |
@xoviat The problem is not that I'm unhappy with the default choice, or can't override it (I just did in the linked commit). The problem is that neither I, nor @skvark ever saw this choice being made in the first place. @matthew-brett Setting up build environment and building dependencies are two different stages of the build process. The latter one is even optional. The name " I expected any logic that performs build environment setup to rather be together with the rest of the logic responsible for that step - i.e. somewhere like |
This is an OSS project. If you think that something should be different, submit a PR. |
I need to know what to submit before investing time into it. |
Variants about relocating build environment setup code that crossed my mind. Each one has drawbacks. For clarity, let's call each option, combined, as "Option X", and its parts that address the 1st and 2nd issues "Option X-1" and "X-2", correspondingly.
|
We should use the third approach. Although functions don't support partial-reuse, it's what's previously been used for multibuild.
The function should be named the same for any OS, and should handle both OSX and Linux. |
What about the "no inheritance" part? How are you going to call the stock function from the user-defined one with the same name? (And so on |
There's no inheritance in multibuild. See any of the other functions. |
No other function needs to be inherited. The very few existing functions that are designed to be overridden (e.g. When I monkey-patched |
So, theoretically on the multibuild side:
And in
|
Then you need an entry point before and between each step :) To be honest, there is a way to rename a function in Bash (so you can invoke it from the overriding one). And it's not pretty. (You also need to come up with a unique identifier for the rename.) |
That's correct. You can add entry points where you think they should go. |
This makes three already: before |
Yes, of course. |
There's yet another option that evaded me when writing https://github.com/matthew-brett/multibuild/issues/116#issuecomment-357372450.
This will eliminate the need for the 1st entry point (however it's implemented). The 2nd entry point isn't really needed atm to begin with 'cuz And the 3rd point is already covered by So, with this, we can go the 1st/2nd option minus the 2nd config file. I also came up with the proposed names -- Besides, this is arguably a more intuitive solution 'cuz the normal expectation is for the initially set envvars to persist throughout the build. |
@native-api - I think you're proposing something like
in The alternative I was proposing initially was to have an
etc, and which would be sourced from within the docker container - and by the OSX builds - before sourcing the other I'm not sure what you mean by "And the 3rd point is already covered by config.sh." - could you explain? |
So the |
It's OK with me - yes. Is that OK with you @native-api ? |
Well, the fact that in config.sh, I cannot use the variables defined
earlier in the build process was surprising enough to warrant a comment
(
native-api/opencv-python@de9c286
).
Other than that (nitpick), this is the simplest solution of all, so fine
by me, too (and, conveniently enough, has a PR ready ;-) ).
Also note that it only addresses issue 2, so we still need to decide if
anything needs to be done about the location of the build env setup code.
|
On issue 1, the names in https://github.com/matthew-brett/multibuild/issues/116#issuecomment-357821839 and the already listed options is all I could come up with. Due to this being quite a memorable experience, I personally "know" about that So, if you have qualms about it, we can close this issue and wait for another poor sap to step on this landmine and try to come up with something better... (this can very well be me again after several months). |
Issue 1 is that it's not obvious that "library_builders.sh" configures the build environment for all later steps. How about having a separate file called |
@matthew-brett That's the option 2-1 earlier. I came up with |
* Add config.pre to override envvars used in `library_builders.sh` Fixes part 2 of https://github.com/matthew-brett/multibuild/issues/116 * rename config_pre.sh to env_vars.sh as suggested
A dedicated |
* Add config.pre to override envvars used in `library_builders.sh` Fixes part 2 of https://github.com/matthew-brett/multibuild/issues/116 * rename config_pre.sh to env_vars.sh as suggested
https://github.com/matthew-brett/multibuild/blob/devel/library_builders.sh defines numerous environment variables, globally. In MacOS, that includes compiler flags.
There are a least two problems here:
-arch i386 -arch x86_64
" comes from 'cuz I never expected something called "library_builders.sh
" to affect anything but library builds and blamed CMake logic or Travis.)library_builders.sh
, so it's impossible to override them there.I'm not quite sure which course of action would be in line with the big design, so prefer to discuss this first.
The text was updated successfully, but these errors were encountered: