Commit Graph

3667 Commits

Author SHA1 Message Date
Havoc Pennington ca8ca042ec Merge pull request #1539 from sbt/wip/1201
Fixes #1201. Display instruction to overrideScalaVersion
2014-08-18 12:11:56 -04:00
Grzegorz Kossakowski 099ce16f8d Merge pull request #1408 from Duhemm/fix-again-1237
Never inspect twice the same macro application, fix (again) #1237
2014-08-18 13:43:26 +02:00
Martin Duhem 26e2449263 Never inspect twice the same macro application
In Scala 2.10.4, this macro can produce a stack overflow :

    def foo(a: Any): Any = macro impl
    def impl(c: Context)(a: c.Expr[Any]): c.Expr[Any] = a

Here, an application such as `foo(someVal)` will produce the expansion
`someVal`. As expected, `someVal` has `original` tree `foo(someVal)`,
but if we inspect this tree, we will find that `someVal` has an
original tree, but it shouldn't.

Moreover, in Scala 2.11, some macros have their own application as
`original` trees.

See sbt/sbt#1237 for a description of these problems.

This commit fixes these two problems.

Fixes sbt/sbt#1237
2014-08-18 09:22:16 +02:00
Martin Duhem aef9933d87 Add new pending test for sbt/sbt#1237
This test shows that macros that simply return their argument produce
a stack overflow during extraction of used names.

Consider a macro `foo(c: Context)(a: c.Expr[Any]) = a`. An
application of this macro such as `foo(someVal)` will lead to the
expansion `someVal`. sbt will extract the `original` tree from it,
and find `foo(someVal)`, and recurse infinitely on `someVal`.
2014-08-18 09:22:16 +02:00
Eugene Yokota e2412740b2 Removes println when removing unused *.class files.
#1525 removes unused *.class files created by the metabuid.
The implementation currently prints out a long list of *.class files
it’s about to remove. Unless something bad happens, this information is
not very useful to the user, so I suggest we don’t display it.
2014-08-18 01:12:39 -04:00
Eugene Yokota 8c90e7eb74 Fixes #1201. Display instruction to overrideScalaVersion
scala-library is currently treated as just one of the library modules.
This means that it’s at the mercy of eviction if some other library
uses newer version of scala-library.
This commit displays a instruction on how to force scalaVersion if
warnScalaVersionEviction flag is true on EvictionWarningOptions.
2014-08-18 00:54:19 -04:00
Eugene Yokota 8a069d0fb2 Fixes #1439. Fixes metabuild downloading unused Scala 2.10.2
Scala instance is added to the Ivy graph via autoLibraryDependency.
For metabuilds, scala-library is scoped under “provided” configuration,
which does not seem to evict modules on “compiled” configuration.
This commit turns overrideScalaVersion flag to true for the metabuilds,
so override rules are added for the following modules:
- scala-library
- scala-compiler
- scala-reflect
2014-08-17 23:18:32 -04:00
Eugene Yokota b812cdc916 Fixes #1275. Fixes pom dynamic revision conversion
Ivy and pom uses slightly different notation for version range and
dynamic revision.
This change fixes the dynamic revisions involving “+”.
First, when a revision like “1.1+” is found, it will now be treated as
“1.+”.
Next, when it finds a revision like “1+” is found, it will be treated
as “+”.
The conversion of “+” is hardcoded to be “[0,)”.
2014-08-16 22:38:35 -04:00
Ben McCann 6508429d81 Fetch tyesafe artifacts using https. See http://blog.ontoillogical.com/blog/2014/07/28/how-to-take-over-any-java-developer/ 2014-08-16 16:17:07 -07:00
eugene yokota 23f9dc26c7 Merge pull request #1535 from sbt/fix/670
Fixes #670. Exclude http.proxyPassword from update.log
2014-08-16 17:11:10 -04:00
eugene yokota ad34bf77e7 Merge pull request #1534 from havocp/wip/havocp-server-mem
Set JVM memory options for server applications
2014-08-16 17:10:47 -04:00
eugene yokota 32990f3570 Merge pull request #1533 from sbt/fix/1530
Fixes #1530. Fixes NPE by using IO.listFiles
2014-08-16 14:42:11 -04:00
eugene yokota 60c8404d5c Merge pull request #1532 from sbt/fix/1484-again
Fix NPE during update again
2014-08-16 14:39:33 -04:00
Eugene Yokota 6b6332a069 Fixes #670. Exclude http.proxyPassword from update.log 2014-08-15 18:25:06 -04:00
Havoc Pennington 705b60dc11 Use java Pattern directly in launcher instead of Scala API
This keeps the launch jar smaller
2014-08-15 15:34:11 -04:00
Havoc Pennington d7ca9c5637 Server launcher: Print errors running java -version to stderr
We forward errors from the spawned server to stderr, so we are
already using stderr and this should save someone some pain
vs. just swallowing the fail.
2014-08-15 15:24:21 -04:00
Havoc Pennington 081f6bac07 Ignore "java -version" IOException when launching servers
process.start and reading from the stderr stream could in
theory throw IOException, we want to return None then
rather than crashing.
2014-08-15 15:24:09 -04:00
Havoc Pennington 3a065dc047 Set Java memory options for server applications
The defaults here are copied from Activator which
in turn are probably copied from somewhere else.
They are of course basically arbitrary, but the
JVM's defaults if we don't set memory options
are insufficient to run most apps.

If the user sets any memory options in the configuration,
we completely leave them alone and don't set any of
our own. So it's always possible to override.
2014-08-15 11:07:19 -04:00
Havoc Pennington b0db0a847e Scalariform reformat of JUnitXmlTestsListener.scala 2014-08-15 09:56:44 -04:00
Eugene Yokota 65e4b773d4 Fixes #1530. Fixes NPE by using IO.listFiles 2014-08-15 03:52:54 -04:00
Eugene Yokota e1d60b6de0 Fixes #1484. Fixes another variant of update NPE
Ivy gives an array that contains null for caller configurations.
sbinary barfs when it sees null. Curiously two of the sbt plugins that
hit this bug happens to be from Typesafe:
    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2")
    addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager"  % "0.7.3")
2014-08-15 02:57:17 -04:00
Eugene Yokota 074fbdb9e6 ModuleDetailReport => OrganizationArtifactReport
ModuleDetailReport hasn’t been released yet, so this rename is safe.
2014-08-15 01:57:21 -04:00
Eugene Yokota 482bdc1b77 scalariform changes 2014-08-15 01:52:31 -04:00
eugene yokota 12c748e0ef Merge pull request #1525 from sbt/wip/fix-eval-issues
Fix Eval issues
2014-08-14 17:48:22 -04:00
Josh Suereth a1b3117a42 Track generated .class files and clean leftovers after project load.
Fixes #1524

* Track generated .class files from Eval
* While loading, join all classfiles throughout Load, lots of bookkeeping.
* When a given build URI is done loading, we can look at its
  project/target/config-classes directory and clean out any extra items
  that are lingering from previous build definitions.
* Add TODOs to handle the same thing in global directories.  Right now,
  given the shared nature of these projects, it's a bit too dangerous to
  do so.
2014-08-14 10:03:24 -04:00
Josh Suereth 0bfb5a4118 Ensure random file hash for .sbt DSL doesn't conflict across .sbt files.
Fixes #1465
2014-08-14 10:01:02 -04:00
Grzegorz Kossakowski 12b6bd148d Merge pull request #1531 from gkossakowski/positions-crash
Set currentRun and currentUnit in Eval
2014-08-14 15:52:01 +02:00
Grzegorz Kossakowski 3fa6b87319 Set currentRun and currentUnit in Eval
First of all, we revert changes to Eval made in
a9cdd96152. That was a work-around
for problem with broken positions set on some trees. The rest of
the commit describes a fix.

Scala compiler's Global has `currentRun` method which is supposed to
return an instance of Run currently in use. Sbt's Eval which wraps
Global would create an instance of Run but not register it in Global.
Similarly, Eval would create an instance of `CompilationUnit` but not
set it in Run.

This would result in some silent failures like assigning broken positions
to parsed trees even if parser *has* received an instance of compilation
unit. See https://issues.scala-lang.org/browse/SI-8794 for details.

We fix the issue by subclassing Global and making it possible to set
current Run instance externally. Then we use this capability to set a run
instance right before we call compiler phases. We also make sure that
current run has current compilation assigned to it.

Fixes #1181
Fixes #1501
Fixes #1523
2014-08-13 23:32:14 +02:00
eugene yokota 52fb91844f Merge pull request #1512 from sbt/wip/fix-1506
Fix unknown host exception in junit xml listener.
2014-08-12 14:55:20 -04:00
eugene yokota 4f18aea818 Merge pull request #1521 from sbt/wip/fix-flaky-settings-test
Fixes flaky no-such-element exception from bad generation of random test...
2014-08-12 11:12:44 -04:00
eugene yokota 3d59b18aef Merge pull request #1516 from sbt/wip/fix-1455
Allow root plugins to be disabled.
2014-08-12 11:12:18 -04:00
Josh Suereth 58175e28c1 Merge pull request #1520 from sbt/fix/1514
Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver
2014-08-12 10:04:10 -04:00
Eugene Yokota d11427dd85 Using iterators 2014-08-11 22:49:48 -04:00
Josh Suereth a151ac9c94 Ok, this is actually the flaky issue with the test.
We use the ch key for testing, so it can't be part of the autogenerated set.
2014-08-11 16:13:26 -04:00
Josh Suereth 0817800065 Fixes flaky no-such-element exception from bad generation of random tests. 2014-08-11 14:54:33 -04:00
Eugene Yokota 01c95b5d62 Special treatment for a special resolver: inter-project 2014-08-11 12:45:14 -04:00
Josh Suereth 86d0cd9aeb Remove printlns. 2014-08-11 09:04:26 -04:00
Eugene Yokota b8ab638b74 So apparently scalariform was unable to parse these files. 2014-08-11 09:03:35 -04:00
Josh Suereth 274e0b446c Added notes so we have a merge conflict for @eed3si9n to deal with. 2014-08-11 09:03:31 -04:00
Josh Suereth 2d0aafc8b0 Allow root plugins to be disabled.
Fixes #1455

* Add a mechanism to detect if a plugin clause includes/excludes
  a particular plugin.
* Add a filter for our "enabling" clauses so that user-excluded
  root plugins do not show up.
* Add a test to ensure this succeed.
2014-08-11 09:01:18 -04:00
Josh Suereth f7c4898a97 Merge pull request #1491 from sbt/fix/528
Unresolved dependency warning includes source position. Fixes #528
2014-08-11 07:51:33 -04:00
Eugene Yokota 286d567781 Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver.
Adds `lastestSnapshots` flag to `updateOptions`, which controls the behavior of the chained resolver. Up until 0.13.6, sbt was picking the first `-SNAPSHOT` revision it found along the chain. When  is enabled (default: ), it will look into all resolvers on the chain, and compare them using the publish date.
The tradeoff is probably a longer resolution time if you have many remote repositories on the build or you live away from the severs. So here's how to disable it:

    updateOptions := updateOptions.value.withLatestSnapshots(false)

Ivy by default uses latest-revision as the latest strategy. This strategy I don't think takes in account for the possibility that a changing revision may exist in multiple repositories/resolvers with having identical version number like 0.1.0-SNAPSHOT.
The implementation is a bit hacky, but I think it attacks the core of this problem.
2014-08-10 18:56:58 -04:00
Eugene Yokota 15185d9004 Minimizing scripted repro 2014-08-09 21:23:07 -04:00
Eugene Yokota 899d5295c8 Adds a test case that exercises the multiple-repository -SNAPSHOT issue. #1514
* Create a project "common" which publishes a "bad" artifact.
* Resolve project "dependent" which resolves the "bad" artifact into the cache.
* Publish a new "common" snapshot to a diffferent repository (publishLocal)
* Attempt to build the new project, leading to issues.
2014-08-09 20:42:19 -04:00
eugene yokota 6f0b6669f6 Merge pull request #1515 from sbt/wip/fix-1398
Disable flaky test, as it's timeout based.
2014-08-09 18:31:41 -04:00
eugene yokota b63ce455df Merge pull request #1507 from sbt/wip/optional-https-maven-central
"Use HTTPS for downloading artifacts from Maven Central" + disable flag
2014-08-09 18:31:13 -04:00
Roberto Tyley d46087ff08 Fix pom-export of Maven Central repository
Commit a1e26ca6 broke the `make-pom` & `pom-advanced` dependency-management
tests by replacing one reference to `IBiblioResolver.DEFAULT_M2_ROOT` in
`Resolver`, but not the other reference in `MakePom`:

https://travis-ci.org/sbt/sbt/jobs/31939788#L2517-L2519

...the secure url was no longer recognised as the default Maven Repository
root, so was erroneously exported.
2014-08-08 17:08:54 -04:00
Eugene Yokota f3d71f98e4 Adds sbt.repository.secure (default: true) #1494 2014-08-08 17:08:54 -04:00
Eugene Yokota bc91e456f7 scalariform project/Docs.scala 2014-08-08 17:07:44 -04:00
Roberto Tyley 0bada62349 Update misc tests and doc to reflect HTTPS access for Maven Central 2014-08-08 17:07:44 -04:00