7735 Commits

Author SHA1 Message Date
Max Howell
ae17944e06 Raise if sdk_path is nil for nclt
This situation should be impossible now (in that, we should detect sdk_path provided we also detected nclt), so if it happens somehow raise in such a way that the user will be encouraged to report the bug.
2012-08-31 10:27:07 -04:00
Max Howell
6c6e82a721 Set VERBOSE if --verbose
You tend to get more useful build output this way, and (more importantly?), superenv itself only outputs certain things if VERBOSE is set.
2012-08-31 10:22:11 -04:00
Max Howell
2856a97ce3 Refs Homebrew/homebrew#14558. Try to find tools when xcrun fails. 2012-08-31 10:22:11 -04:00
Max Howell
b024554872 Remove plain "-O" 2012-08-31 10:22:11 -04:00
Max Howell
b98c4792d0 Doctor check for unlicensed Xcode
Checking the license text is probably the most future proofed method. Though for future reference other possible methods are listed in the below ticket.

Closes Homebrew/homebrew#14558.
2012-08-31 10:22:11 -04:00
Max Howell
1555436f70 MacOS.sdk_path is unlicensed Xcode aware
Now we should get an sdk_path, but tools like xcodebuild, xcode-select and xcrun will still error out. But at least more of Homebrew will work.

Also putting the Xcode 3 path finder last. We get bug reports because newer Xcodes are installed in parallel to older Xcodes. We want to find and use the newer Xcode's first. Xcode.prefix is pretty smart about that.

Refs Homebrew/homebrew#14558.
2012-08-31 10:22:11 -04:00
Max Howell
d39b7b6b99 brew --env puts HOMEBREW_SDKROOT 2012-08-31 10:22:10 -04:00
Max Howell
00df962b6f Consider superenv “servile” during configure
superenv defaults to servile mode. In servile mode:

* If 'gcc' is called, then 'gcc' is run (we ignore HOMEBREW_CC)
* CFLAGS (optimizations) are not applied
* ARGV is not mangled (TODO though we should apply fixes)
* -I and -L environment is still forcibly inserted.

This fixes, eg. jack which was still broken with stdenv. Jack was broken because we set CC in stdenv, and Jack has a stupid build-system. Unsetting CC allowed Jack to find and use the gcc tool it so demanded, but (previously) we would then substitute clang under its nose. The configure still failed. In servile mode (llvm-)gcc is used and Jack compiles.

In normal circumstances clang would then be inserted again during the make phase. But Jack uses the niche-wag build tool that we don't support for setting the O HOMEBREW_CCCFG flag that disables servile mode.
2012-08-31 10:22:10 -04:00
Max Howell
05c708b9fc Revert the user-PATH fix
User paths might have anything in them, anything can break builds.

Instead special case these two formula with the view to having an eventual DSL to allow injection of user paths into superenv. Certainly defaulting to off.
2012-08-31 10:22:10 -04:00
Max Howell
113ed85e8d More brew irb examples 2012-08-31 10:22:10 -04:00
Max Howell
04173d55c2 Hide --disable-debug from non verbose output also 2012-08-31 10:22:09 -04:00
Max Howell
e7c05f558b String.f convenience function for brew irb
eg. "ack".f
2012-08-30 22:54:45 -04:00
Jack Nagel
20fdc5cd2f Simplify brew outdated even further
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-30 20:39:46 -05:00
Max Howell
d4503b1202 Fixes Homebrew/homebrew#14542; ocaml superenv issues
This patch removes most of the settings for CC, CXX etc. because we are trying to be minimal. Then we force the compiler to Homebrew's choice underneath in superenv. We however leave LD because we prefer that build-systems use the c-compiler for linking, it generally works better (copiously tested), however when the build-system explicitly calls ld, we respect that. This gets around the ocaml bug in question, since somehow clang was crashing during link, but the ld tool itself (which is kind of clang, kind of llvm-gcc) is okay with this.

Also moved the setting of O (so that cc-args are refurbished) into a make wrapper. Not sure if this matter much, but seems more consistent.
2012-08-30 20:02:29 -04:00
Jack Nagel
a4ccf68602 superenv: look for pc files under prefix, not repository
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-30 16:08:24 -05:00
Max Howell
8f299d9779 Work for users who delete /usr/bin/ruby
Some people do insane things and are then surprised things break.

Fixes Homebrew/homebrew#14546.
2012-08-30 09:55:33 -04:00
Max Howell
ea12f340e7 Put user's PATHs at end of superenv PATH
Making sure to remove X11, should be safe if this order is kept.

Refs Homebrew/homebrew#14519.
Fixes Homebrew/homebrew#14544.
2012-08-30 09:45:33 -04:00
Jack Nagel
be8827d8a4 tests: avoid unnecessary chdir
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-30 00:10:02 -05:00
Max Howell
1a9c2917a4 Some flags must be specified -Wl,foo
Finishes fixing qrupdate. And maybe others.
2012-08-29 22:43:52 -04:00
Max Howell
fc9b18c291 Don't catch build errors 2012-08-29 22:25:29 -04:00
Max Howell
3fbe631b02 Block form of chdir can only be used once
If you nest them, the library complains. So let's not do that.

/cc @jacknagel
2012-08-29 19:49:11 -04:00
Max Howell
e1ff17ed75 Force Wine to use stdenv for now
Fixes Homebrew/homebrew#14535.
2012-08-29 19:49:10 -04:00
Jack Nagel
b7bdd2f578 tests: support "rake rcov" if rcov is installed
If the rcov gem is installed, `rake rcov` will generate a test coverage
report in the coverage directory.

I picked rcov because it is 1.8 compatible. But it could easily be
swapped out for another coverage tool.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-29 15:56:36 -05:00
Jack Nagel
8abfee7d9c tests: adjust expectations for 'opt' directory
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-29 15:37:58 -05:00
Max Howell
5790f4b523 Display skip-clean warning only before clean
Not anytime the formula loads.
2012-08-29 15:43:28 -04:00
Max Howell
a7946e0088 Warn about removed warnings less shockingly
The problem here now is though that the warnings only appear when compiling verbosely. But they should thus be visible if the build fails. Or if people are hunting for problems.
2012-08-29 15:19:42 -04:00
Max Howell
466a240bbe Fixes Homebrew/homebrew#14528; undefined vars.
Due to copy/pasta.
2012-08-29 14:54:07 -04:00
Max Howell
491be4fa89 Typo
Not sure how I forgot to test that.
2012-08-29 14:52:00 -04:00
Max Howell
096ba6c17c Don't fail pre-Xcode 4.3
Refs Homebrew/homebrew#14392.
2012-08-29 14:49:03 -04:00
Max Howell
95164a5d46 Use fortran from std-env in superenv
Fixes Homebrew/homebrew#14524.
2012-08-29 14:45:04 -04:00
Max Howell
4feb8e1cb4 Deprecate skip_clean :all
This was mostly used to prevent stripping. Now we don't strip. Force formula to remove this setting or be more specific about folders they don't want pruned.
2012-08-29 14:45:04 -04:00
Adam Vandenberg
1eb808c109 Homebrew 0.9.3 for superenv 0.9.3 2012-08-29 10:08:46 -07:00
Max Howell
bdd6193587 brew sh: a shell with superenv loaded
If you need to build software on OS X by hand, a brew shell is the way to do it.

Closes Homebrew/homebrew#14381.
2012-08-29 12:41:38 -04:00
Max Howell
a360a41472 superenv only adds X11 paths if required
Since we are moving towards only depending on X11 for X-headers, superenv now doesn't automatically add X11 compilation. I was reluctant to do this, but it is the right thing to do now that X11 is not automatically installed by OS X or Xcode.

I didn't implement ENV.x11 because the order that the X headers are inserted is important. It must be done at initial setup to ensure that brewed versions of e.g. freetype and Cairo are used and not the ones installed by XQuartz.
2012-08-29 12:41:37 -04:00
Max Howell
b834027b17 Doctor suggest git clean -f if unstaged files
This is safe, I tested various scenarios, including Homebrew installed in ~. The only files that are removed are unexpected files in Homebrew's already managed directories.
2012-08-29 12:41:37 -04:00
Max Howell
2cecc3bd51 If exception has no message raise again
Shows full backtrace, which is useful. Now blank "raise" statements are the equivalent of admitting programmer error. The backtrace will be useful.
2012-08-29 12:41:37 -04:00
Max Howell
7d8954d74c Warn user if they set CFLAGS, etc. with superenv
Since we remove some CFLAGS under their noses, this would otherwise be quite confusing.

Notably, this will now trigger in numerous formula. Sucks.
2012-08-29 12:41:37 -04:00
Max Howell
24bcc694e5 Speed up brew instantiation
Adding MacOS.dev_tools_path to our PATH was slow. We no longer need to do this because of the previous commit making a script wrapper for git and svn. It was slow because the function calls out to lots of slow utilities to determine this path.
2012-08-29 12:41:36 -04:00
Max Howell
672388d4f7 Always find git and svn without trying hard
Two wrapper scripts that find git and svn using the ENV variables we support and then searching through the PATH and looking inside Xcode.app if necessary.

Now just calling git or svn in Homebrew code will find and exec the right tool and we can stop fussing.

Apologies to @adamv who is probably unimpressed that the cmds directory has non-commands in it now. If it's consolation these are temporary pending some more work on superenv whereby some more directories are created under the superenv root.
2012-08-29 12:41:36 -04:00
Max Howell
0ac3e83a7a Make brew --prefix very fast
Because people use this in .bash_profile etc. We should be as fast as possible.
2012-08-29 12:41:36 -04:00
Max Howell
0efd1b9efe Attempt to fix opt link if absent
This is mainly to prevent errors when users for the transitionary period where most installed kegs do not have an opt link.
2012-08-29 12:41:36 -04:00
Max Howell
d89b3272f4 Ensure mktemp cleans up after itself
Ignore interrupts.
2012-08-29 12:41:36 -04:00
Max Howell
336c4d1b05 If installed but not linked, say so
Rationale: if ack is unlinked but installed, typing ack does nothing, but then user tries to install and it says it is already installed. What gives? The user thinks.

Formula ending up unlinked can happen due to failures during the link phase and we recommend unlinking formula for conflicts. So common enough to justify this amendment.
2012-08-29 12:41:35 -04:00
Max Howell
20ce16a3ff Much better CTRL-C handling
Let's not show weird error messages when user interrupts during various stages of brew initialization.

Tested by doing `for x in $(brew search); do brew install $x; done` and pressing CTRL-C at random short intervals.
2012-08-29 12:41:35 -04:00
Max Howell
fb8c7e0aaf Allow eg. brew --env libxml2
Example useful usage:

    eval $(brew --env gettext) && clang -Wl,-t -lssl 2>/dev/null
2012-08-29 12:41:35 -04:00
Max Howell
4f06d131df Superenv wrapper for sed
Fixes Mountain Lion specific sed issue.

Provided scripts don't use the full-path to see we are fine. They never do though, that would assume too much.
2012-08-29 12:41:35 -04:00
Max Howell
1ec368759e Support HOMEBREW_MAKE_JOBS 2012-08-29 12:41:34 -04:00
Max Howell
36de29f65e Force --env=std for stuff using scons, etc.
Python et al, require stdenv because otherwise pip, gem, etc. don't work. Can be fixed, just I'm not doing it now.

We want a DSL to do this but I couldn't be bothered to make that work etc. I want to commit. Apologies.
2012-08-29 12:41:34 -04:00
Max Howell
65d195dcaa superenv: build-environments that just work
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds.
2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools.

Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't.

The previous ENV-system is still available when --env=std is specified.

superenv applies to Xcode >= 4.3 only currently.
2012-08-29 12:41:34 -04:00
Max Howell
57df15afd0 Use opt paths in keg-only messages 2012-08-29 12:41:34 -04:00