Commit Graph
381 Commits
Author SHA1 Message Date
Jack Nagel 460ae7f5ab VCSDownloadStrategy: rename checkout_name to cache_filename 2013-10-11 00:21:23 -05:00
Mike McQuaid c1e06c65da git_etc: update based on bottle etc/var changes. 2013-10-10 16:46:47 +01:00
Jack Nagel 0588dea2d3 Extract a new superclass for VCS-based download strategies 2013-10-09 21:41:15 -05:00
Xiyue Deng 122ac08b1f Fix test failure for C++ stdlib. 2013-10-07 03:40:41 -07:00
Misty De Meo 77b678cea9 CxxStdlib: allow for nil stdlibs
A nil stdlib value represents non-C++ code.
2013-10-06 19:26:06 -07:00
Jack Nagel 86e6ff5e80 Check types in Formula#==
Comparing two objects should not raise an exception, even if they have
different types.

The semantics of #== are now the same as #eql?, so make one an alias.
2013-10-04 21:19:15 -05:00
Jack Nagel f1a5f559e3 Handle invalid names in download strategies
When subformulae are initialized without a name parameter, Homebrew
assigns the name "__UNKNOWN__". This may cause collisions in the cache.

Currently CurlDownloadStrategy and its descendants handles this by
extracting the basename form the URL and using that as the cached
filename. However, other strategies simply raise an exception.

We can improve the other strategies by URL-encoding the URL string and
using that as the cached directory name.

Note that this happens very rarely, especially now that resources (which
always have a name) are preferred to subformulae. The most common case
is a subformula that specifies a head download.

Closes #22949.
2013-09-30 22:56:02 -05:00
Jack Nagel a961e1e134 Infer dependencies from download strategies and URLs
Closes #20849.
Closes #22871.
2013-09-28 16:37:05 -05:00
Jack Nagel dd43a9552a Raise when given an invalid download strategy spec
When DownloadStrategyDetector.detect is given a second argument, and
that argument is not a symbol or an AbstractDownloadStrategy subclass,
it is silently ignored, and we fall back to guessing the strategy based
on the URL.

This means I can do

  url 'http://foo.com/bar.tar.gz', :using => Class.new

and things will appear to work, even though I have clearly passed an
invalid value for :using.

A more useful behavior is to raise an exception for unknown strategy
specifications.
2013-09-26 17:00:00 -05:00
Jack Nagel 138b0b177d Set owner of resources to SoftwareSpec object 2013-09-23 21:39:33 -05:00
Jack Nagel 0af7d5611e Move dependencies to SoftwareSpec 2013-09-21 19:27:24 -05:00
Jack Nagel d2c4be9ebe Move options to SoftwareSpec 2013-09-21 19:27:24 -05:00
Jack Nagel 617f2cdb9f Add tests to ensure ENV.compiler is correct 2013-09-20 22:54:07 -05:00
Jack Nagel a2c9d9e2bc At some point this started working again 2013-09-20 15:52:08 -05:00
Jack Nagel e068606c98 Make spec-scoped resources override top-level resources 2013-09-17 21:29:53 -05:00
Jack Nagel 73ddbb6df5 SoftwareSpec tests are now Resource tests 2013-09-17 21:29:50 -05:00
Jack Nagel 8d88a52859 Copies of BuildOptions should not share underlying collections 2013-09-14 17:03:56 -05:00
Jack Nagel 456d8eb2ec Tear down the cache after installation tests 2013-09-14 11:53:32 -05:00
Jack Nagel 11c4e24124 Move SoftwareSpec to a separate file 2013-09-14 10:16:52 -05:00
Jack Nagel 2103007b71 Stop exposing the download strategy from Formula 2013-09-13 22:33:46 -05:00
Jack Nagel 74542a5c5c Stop mutating dependency specifications 2013-09-13 09:57:53 -05:00
Misty De Meo 3483d68578 Fix CompilerSelector test for llvm
Update test to reflect that llvm-gcc should take precedence over
non-Apple GCC.
2013-09-10 13:08:03 -07:00
Mike McQuaid 698e5624be Optionally use git to keep brew etc versioned.
Still in alpha state.
Handles defaults and merging changes with new versions.
Enable by setting the HOMEBREW_GIT_ETC environment variable.

Closes #15751.
Closes #17713.
2013-09-07 13:39:43 +01:00
Jack Nagel a098f46e10 Fix breakage in option recognition
Fixes #22347.
2013-09-05 18:51:27 -05:00
Samuel John fd03aa527d Improve python tests for brew bots
Allow `build.with?` and similar methods to be used during the test
phase. The BuildOptions (`build`) are initialized with the
`Tab.used_options` unless explicitly overwritten on the command line.

So basically `build.with?` works in `def install` and in `test do` as
one would naively expect. (For the test, gramatically it should be
`built.with?` but who cares)

If a formula was installed `--with-python`, now the tests are also
run `--with-python`. This enables us to use the `python do ... end` in
a meaningful manner.

Using `python do ... end` blocks for the tests, because the bot.brew.sh has
system python per default and we need to set the PYTHONPATH for the test.
Potentially to different values for Python 2.x and 3.x.
2013-09-05 15:26:57 +02:00
Misty De Meo 881d2295ea Tab: track C++ stdlib in use
There are subtle incompatibilities between Apple's libstdc++ and the
libstdc++ used by the various GNU GCC formulae. In addition, we'll
likely also be supporting libc++ in the future, and that's also
incompatible with the other stdlibs.

Tracking it in the tab lets us make sure that dependencies are all
built against the same stdlib to avoid subtle breakage.
2013-09-01 13:19:13 -07:00
Misty De Meo 733076ec22 Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:

fails_with :gcc => '4.8.1' do
  cause 'Foo'
end

Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings instead.

Internally non-Apple compilers can be distinguished because they are
passed around as strings instead of symbols.

In addition, this alters the priority list for compilers, with the
following changes:

* Apple GCC 4.2 and LLVM-GCC swap positions, with GCC now taking
  priority. (Maybe LLVM-GCC should just go away.)
* Non-Apple GCC compilers are ranked below GCC 4.2 but above LLVM-GCC
  and Apple GCC 4.0.
2013-09-01 13:19:13 -07:00
Jack Nagel de55321663 Add test for option description rules 2013-08-31 20:40:06 -05:00
Jack Nagel ca7205ea9c Add test for dependency options 2013-08-31 16:09:49 -05:00
Jack Nagel 896bb1bf72 Add some tests for ENV.{append,prepend} behavior 2013-08-26 15:02:51 -05:00
Jack Nagel 94da753a73 Options: ensure copies do not share the underlying collection 2013-08-22 11:49:24 -05:00
Jack Nagel 5770f9bbf8 Demonstrate the Set-like nature of Options collections
Options collections are backed by Sets, and thus trying to push a new
option with a name that duplicates an existing option cannot succeed.

Later, we can exploit this behavior and remove some conditionals.
2013-08-22 11:35:00 -05:00
Jack Nagel ad3864534d Add tests for ENV.{append,prepend}_path 2013-08-19 17:21:14 -05:00
Jack Nagel 79e06fc9ea Use ENV.append_path 2013-08-19 17:21:13 -05:00
Amos Wenger 13c2776795 Use File::PATH_SEPARATOR globally instead of ':'
On Unix, the path separator is ':', whereas on Windows,
it is ';'. This is the first of a series of patch to bring
macbrew's and winbrew's codebases closer together.

The main places the magic constant ':' was being used were:
  - the $PATH environment variable
  - CMAKE-related environment variables
  - pkg-config related environment variables

Closes #21921.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-08-19 13:35:44 -05:00
Jack Nagel fe1032b669 Initial tests for superenv sanity 2013-08-19 12:33:00 -05:00
Jack Nagel e1b6ebb4ff No longer call ENV.userpaths! in requirements
Instead we use which with a custom PATH.
2013-08-19 12:33:00 -05:00
Jack Nagel a1ce0dba12 More robust implementation of ENV.with_build_environment 2013-08-19 12:32:59 -05:00
Jack Nagel c0f5d3aa01 Rename HomebrewEnvExtension to Stdenv 2013-08-19 12:32:59 -05:00
Misty De Meo 2bd3eac3d1 Mach: improve tests 2013-08-15 22:46:56 -07:00
Adam Vandenberg cbdc8dc58b pathname: remove unused return values
Return value was used only by one test, rewrote test to know expected value.
2013-08-13 20:41:08 -07:00
Jack Nagel 11c9eca76b Always prune empty toplevel directories when unlinking
Closes #21750.
2013-08-09 20:55:54 -05:00
Jack Nagel 102f760f9a Keep track of pruned parent directories 2013-08-09 20:50:43 -05:00
Jack Nagel 16f134c14f Add tests to demonstrate failure to prune empty directories 2013-08-09 20:50:43 -05:00
Jack Nagel 2ae78fd9a2 Remove hardcoded paths in keg tests 2013-08-09 20:50:42 -05:00
Jack Nagel a4cc482162 Remove keg test dependency on formula 2013-08-09 20:50:42 -05:00
Mike McQuaid 5bbe98f3a1 bottle_versions: add ssh_copy_id bottle detection. 2013-08-03 22:27:42 -07:00
Mike McQuaid 36dcc6ba02 bottle_versions: add perforce bottle detection. 2013-08-03 22:27:42 -07:00
Mike McQuaid ee972d943b bottles: use dedicated version class. 2013-08-03 22:27:42 -07:00
Mike McQuaid b9b5ff7719 versions: remove perforce bottle detection. 2013-08-03 22:27:42 -07:00