-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Adds a allow_universal_binary to homebrew. #21664
Conversation
args << "-arch #{arch}" if archset.add?(arch) | ||
end | ||
when /^-Xarch_/ | ||
whittler.next # todo support -Xarch_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what still remains to do.
Has anyone got a clue of how to extract the arch ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorted out
I think we still want superenv to be selecting which universal archs to set; it filters out PPC arches on Intel, etc. |
So add a set of valid arches. How could this be handle to end with a |
Thinking about it, if we can transfer a set from homebrew to cc there would be no need of the extra ccfg flag, the set itself would flag that we are doing a universal binary. |
In that case we should add code so that we always get the arch we are building for in the set and detect universal_binary_allow from that. |
How could that be one though ? |
In #21636, we're adding new helpers to determine these kinds of things, and an environment variable will be propagated into superenv with the appropriate architectures - likely as a |
If the environment var is correctly set up, independently of 'u' in ccfg, which actually tells cc to add those flags, that would work, but what I would have used is rather HOMEBREW_VALID_ARCHS, with a plain list of arches we are allowed to build, that is, those that we won't remove. |
I am testing that with qt (whose universal support was broken) see #21534. |
Actually I need to make some more important modifications to refurbish |
bad news this meant much copy paste. |
The total duplication of the flag filtering is really a non-starter. |
def universal_binary | ||
append 'HOMEBREW_CCCFG', "u", '' | ||
ENV.allow_universal_binary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not what I had in mind. We need a separate flag that does not automatically add -arch
flags, but does not filter them out, either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a different flag.
But if we don't set it in universal binary, cc will remove the -arch flags added by universal binary (I supposed the CCFG flags were case sensitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any flags that we are explicitly adding should not end up going through the arg filtering. I see that you changed this, but I don't think that's a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows for de-duping -arch
flags, and the line I added ensures that those flag are not filtered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not entirely sure I understand why us adding the arch flags doesn't work for Qt? Is it because the ./configure
or qmake
screw up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the work doing here but you are speaking a lot in abstracts about what formulae "can" do and not specific problems with specific formulae. Superenv (and our chosen optimisation flags) work well as-is and are heavily tested at this point. If the problem is the Qt formula then we should try and fix that specifically in the formula rather than adding a new feature for a single, slightly broken, buildsystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see a solution that fixes the Qt configure tests so we can just use ENV.universal_binary
for the rest of the build process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the problem that superenv is massaging the compiler flags during the build but not configure, misleading Qt as to what it can/can't do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mistydemeo actually it is the contrary, the flags we add aren't expected by configure so it messes the tests.
In the build, qt handles all the flags correctly and we just duplicate the arch flag.
This PR is an answer to #17352, which also explain why I tend to speak in abstracts.
Qt is a direct application of the new feature, handling non standard universal binaries, because it is a non standard universal build.
CMake would be another and the mentioned issue shows that other formulae also preset non-standard universal binary (llvm I think)
I also fixed another superenv bug, "Xarched args" were simply removed, which broke Qt, but could also break other formula relying on -Xarch.
And also, anything that modifies superenv needs to be considered as something that can be used by other formula.
You can see what happens to qt with ENV.universal_binary
, using -verbose
passed to configure.
(Some test fail where they work perfectly in normal qt build and with this new fix, xcodeversion, dwarf2 and -Xarch (before building qmake) if I remember well)
Debug and optimization creeped into the discussion, because of the previous hack which disabled some optimization and are no longer needed with the fixed -Xarch support, and because I wondered why we strip all debug info. That's should be discussed somewhere else since it isn't the purpose of this PR, do whatever you want as for -no-sse3 -no-3d-now
(bottle, always, never)
I leave on holidays tomorrow, so feel free to play with the code yourselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mistydemeo actually it is the contrary, the flags we add aren't expected by configure so it messes the tests.
Superenv only massages compiler arguments when called from make
. It shouldn't be active during the configure phase.
As for duplication I think I am going to redesign this, filter Xarch_ and then refurbishing all the args. |
There seem to be a superenv bug with gcc and llvm-gcc, both complain about |
That's probably because you're passing it as a single argument ( |
I suggest we take a step back and make a very clear outline of the problem this is attempting to solve; I bet there is a simpler way to do it that doesn't involve such major surgery. |
Actually I simply taked the -Xarch arg apart treated the same way as the normal args but separately and put them back. It looks like major surgery because all var names have been replaced, so github sees it a major change. |
gcc and llvm-gcc back on tracks, I split in the place were there were spaces. |
Some general comments:
|
I'll fix the style error after diner.Instead of Empty string I'll use "all"I'll try to see if from all those blocks I can make one and loop over it Some general comments: Looping over all the arguments multiple times seems inefficient, we should loop over everything once, collect the arguments you wish to process further and then do so in a separate loop. — |
But by the way it seems that we are filtring debug and optimization, which makes the --with-debug-and-release option of qt.rb useless. Date: Mon, 5 Aug 2013 10:07:07 -0700 Some general comments: Looping over all the arguments multiple times seems inefficient, we should loop over everything once, collect the arguments you wish to process further and then do so in a separate loop. — |
Due to the fact some well behaved build sysytem like quake handle debug and optimization themselves, I think we should add a allow debug and optimization kind of flag to CCFG, which would then leave debug and optimization related file from the build system. letter 'D' ? |
The |
Still It has been years since qt was born, and the Trolltech, Nokia and now Digia probably new what optimization flags they needed to use, and we most probably delete those flags. (which are handled knowing the system + compiler used for compiling) QMake is not the cleverest build system, but at least it keeps a lot of information on each platform, so that it uses some decents flags. |
Sometimes some not very clever ./configure scripts will put wrong -O or debug flags, but CMake, qmake and other have enough knowledge not to break build with that and use appropriate flags, which we remove. |
Qt 32 bit support with clang remains broken. (It's an upstream issue). |
Qt built, --with-debug-and-release --universal --developer, using gcc |
Rebased everything, and fixes the test-bot failure I hope |
Well what is weird is the bot failure is that Mountain_lion claims the OS X version Qt is building on isn't supported, so OS X 10.9 must end up to be transmitted to the compiler. And Lion failed while recording the test result. |
Adds a allow_universal_binary option to to superenv. And rewrites the arg refurbishing code in cc (superenv's wrapper for compilers) Fixes -Xarch_ handling in cc
Uses the allow universal binary ENV method to fixe universal binary builds. Clang universal binary remains broken because of an upstream bug.
No, Qt decides on its own SDK I'm pretty sure. Given that most other packages are working this seems to be a Qt bug. |
I tested it on my mac and I've got 10.8 as SDK, that's weird. |
I investigate a bit Qt configuration files.
For some weird reason Xcode 5.0.0 did not return the same as 5.0.1 (it return 10.8) |
What should I do ? |
If it takes an SDK argument, go for it. It'll be: '-sdk', "macosx#{MacOS::version}" |
Give a hint as for the SDK so that Qt don't pick up the wrong SDK.
I tested that. |
Could you trigger the test build again, please. |
Having the bots rebuild qt and qt5 every time you want to test isn't brilliant, really. Are you testing this locally too? |
Well I test locally, but the bot tend not to agree with me. |
@BrewTestBot test this please |
As for Qt Assstant t seems that we didn't fix completely #20020. |
Thanks for the test. What should be done while Qt isn't updated for maverick ? |
That's because the log exhausts all the memory in the Java process. We can just leave Qt failing on Mavericks until upstream fix it. |
(See #21000). |
Hi, I've managed to get Qt building and installing on Mavericks using some patches from the Qt code review. Please see my comment here: #21000 (comment) |
So what should we do use those patch in qt5.rb, knowing that we'll have to remove them once the new release is out, or redirect people to the modified formula until the new release is out, or leave it as is ? |
The best way to use a modified formula is to create a fork of Homebrew, then create a branch, then modify / overwrite the relevant formula, and then |
@GuillaumeDIDIER Think it's unrelated to this issue. |
So that's settled. |
I'm sorry but, after discussion, thought and given this is a fix for a singular formula (which already works in another way) we're not going to accept this patch. |
Sorry for commenting on an old thread, but am I to assume that Homebrew does not support building a universal binary (i386 and x86_64) of qt (4.8.5) on Mountain Lion? This thread seems to suggest so (although it was somewhat difficult to follow) and the build failed when I tried it. If that is the case, should the --universal flag be removed from the qt.rb formula? |
I don't know in which state is qt 4 universal build. |
Adds a allow_universal_binary flag to make superenv handle non-standard universal builds under superenv
See #17352