Commit Graph

136 Commits

Author SHA1 Message Date
Rui Gonçalves 2318269dc5
Add CrossVersionExtra.isBinaryCompatible utility 2022-06-25 21:41:10 +01:00
Eugene Yokota 76452e53ff Drop OkHttp dependency
Ref https://github.com/sbt/sbt/issues/6912

Problem
-------
There's apparently a security issue with OkHttp 3.x,
which I am not really sure how applicable it is to our usage
of OkHttp but it is there.

Solution
--------
Since most of OkHttp-specic usage within LM is for Apache Ivy
downloading, I am going to drop this.
Since `sbt.librarymanagement.Http.http` is a public API,
I am substituting this with Apache HTTP backed implementation.
2022-06-12 22:24:44 -04:00
eugene yokota e15f0c149a
Merge pull request #393 from armanbilge/feature/sonatypeRepos
Deprecate `sonatypeRepo`, add `sonatypeOssRepos` to `Resolver`
2022-05-07 19:04:44 -04:00
Eugene Yokota a071882321 Add predefined list of licenses 2022-01-31 19:22:37 -05:00
Arman Bilge 7a2f81ea05 sonatypeRepos -> sonatypeOssRepos 2022-01-31 23:23:34 +00:00
Arman Bilge c17309a914 Deprecate sonatypeRepo, add sonatypeRepos 2022-01-16 21:43:36 +00:00
Arman Bilge a561f3a901 Add shortcut for s01.oss.sonatype.org to Resolver
Fixes https://github.com/sbt/sbt/issues/6787.
See also: https://central.sonatype.org/news/20210223_new-users-on-s01/
2022-01-16 21:34:54 +00:00
Peter Janssen f89ba48906 Respect maven.repo.local property 2021-12-23 16:38:52 +01:00
Eugene Yokota 129b43acd2 intern/flyweight ConfigRef
Fixes https://github.com/sbt/sbt/issues/6721

Problem
-------
ConfigRef is among the most created on heap.

Solution
--------
intern/flyweight it.
2021-11-20 19:39:18 -05:00
xuwei-k 3ca1898721 fix warning. prepare Scala 3 2021-11-17 12:19:45 +09:00
Roberto Tyley 9786906eca Avoid repeating versions in Eviction error message
Rather than seeing an error like this, with the evicted version numbers
being repeated many times:

```
[error] 	* org.scala-lang.modules:scala-java8-compat_2.13:1.0.0 (early-semver) is selected over {0.9.0, 0.9.0, 0.9.0, 0.9.0, 0.9.1, 0.9.1, 0.9.1}
```

...I'd much rather see an error like this:

```
[error]         * org.scala-lang.modules:scala-java8-compat_2.13:1.0.0 (early-semver) is selected over {0.9.0, 0.9.1}
```
2021-09-17 18:12:13 +01:00
Adrien Piquerez 37234e35ba Fix Scala 3 binary version
- for 3.0.1-bin-nonbootstrapped it should be 3
- for 3.0.1-SNAPSHOT it should be 3
2021-07-08 13:14:16 +02:00
Eugene Yokota 0aa7d69ee6 Fix cross-Scala suffix conflict warning
Fixes https://github.com/sbt/sbt/issues/6578

Problem
-------
The regex currently expects two segments like2.x or 3.x,
but Scala 3 uses _3 as the cross suffix, and it's not caught.

Solution
--------
Change the regex.
2021-07-05 04:11:20 -04:00
Matthias Kurz 0cc4397bf9
Use correct Sonatype releases repository 2021-05-18 10:09:44 +02:00
Eugene Yokota ae9f17c8fc Permit dot in cross util version parsing
Ref #377
2021-05-15 14:55:23 -04:00
Eugene Yokota 0ce5142b17 Apply version number parsing fix
Ref #377

Apply the dotted-prerelease tag to SemComparator
"A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version."
2021-05-15 14:12:46 -04:00
Amina Adewusi 6f87212b9f Fixes sbt/sbt#6496 - bug in version parser
What is the problem?
sbt/sbt#6496 identifies a bug in the logic which assesses whether
different versions of the same transitive dependency are binary
compatible. If one of the transitive dependencies included a version
with a full-stop literal, it would be parsed incorrectly and an error
would be thrown to the user falsely saying that the dependencies are
binary incompatible.

What is the solution?
This PR fixes the regex used by the parser to include full-stop literals.

Is there anything else to be done?
It is worth us checking the rest of the codebase in case this bug might
exist in other parsers. The tests are super helpful for figuring out
which strings might break the current logic.
2021-05-14 19:39:37 +01:00
Adrien Piquerez c98e51418f Fix binary version of 3.0.1-RC1 2021-03-30 17:50:50 +02:00
Eugene Yokota dc0b682d7e Implement assumedVersionScheme
Ref https://github.com/sbt/sbt/issues/6302
Ref https://github.com/sbt/sbt/issues/6301

Apparently some users are interested in keeping the eviction warning
feature, so here's an option to bring guessing back.
2021-02-21 04:49:36 -05:00
eugene yokota 70e7718353
Merge pull request #365 from eed3si9n/wip/rename
Follow up on scala3doc rename
2021-02-14 13:37:47 -05:00
Eugene Yokota 3a9b0303f8 Follow up on scala3doc rename
Ref https://github.com/sbt/sbt/issues/6307
Ref https://github.com/lampepfl/dotty/pull/11289
2021-02-14 13:21:53 -05:00
Eugene Yokota 12d46e3fce Make ModuleID#cross(...) preserve existing prefix
Fixes https://github.com/sbt/sbt/issues/6280

sbt-platform-deps implements `%%%` operator in https://github.com/portable-scala/sbt-platform-deps/blob/v1.0.0/src/main/scala/org/portablescala/sbtplatformdeps/PlatformDepsBuilders.scala#L36-L43
by setting the prefix field on `sbt.librarymanagement.Binary(...)`.
Currently `.cross(...)` would wipe this out, so `%%%` and `cross(CrossVersion.for3Use2_13)` do not compose.

This changes the implementation of `.cross(...)` so it can be chained
together and it will try to preserve the prefix (and suffix) values from
the existing `crossVersion` values.
This should fix the 2.13-3.x sandwich on Scala.JS and Scala Native.
2021-01-23 15:47:33 -05:00
Eugene Yokota 7b45fc594f Contraband files 2021-01-17 06:00:12 -05:00
Eugene Yokota 417a30f8db Update to Scala 2.12.13 + 2.13.4 2021-01-17 04:18:49 -05:00
Adrien Piquerez 2b1806ae25 Add for3Use2_13 and for2_13Use3 2021-01-08 18:25:01 +01:00
eugene yokota 42aae724f8
Merge pull request #359 from adpi2/scala3doc
Add scala3doc artifact
2021-01-03 01:07:06 -05:00
Eugene Yokota 5942ccbe1f Add Scala 2.13 support 2021-01-03 00:59:38 -05:00
Adrien Piquerez ec34dd71a3 Add scala3-tasty-inspector artifact 2020-12-30 15:01:08 +01:00
Adrien Piquerez 51d64c7eef Add scala3doc artifact 2020-12-29 16:42:20 +01:00
João Ferreira 997ce66a1a regen contraband 2020-12-21 17:43:24 +00:00
Eugene Yokota 9297139f6a Implement EvictionError
Ref https://eed3si9n.com/enforcing-semver-with-sbt-strict-update

This adds EvictionError, a replacement for EvictionWarning.
The problem with the current eviction warning is that it has too many
false positives. Using the versionScheme information that could be
supplied by the library authors and/or the build users, this eliminates
the guessing work. At which point, we can fail the resolution.
2020-12-20 19:35:15 -05:00
Eugene Yokota aac1edb426 Add Strict and Always support 2020-12-20 19:34:03 -05:00
Eugene Yokota dc0d873f7b Use evalPvp
Follow-up on https://github.com/sbt/librarymanagement/pull/352
2020-12-20 16:58:50 -05:00
eugene yokota 7547f67294
Merge pull request #352 from eed3si9n/wip/match_error
Fixes match error when using withDottyCompat
2020-12-19 17:32:40 -05:00
Eugene Yokota 2308d0a3a7 Fixes match error when using withDottyCompat
Fixes https://github.com/sbt/sbt/issues/6210

scodec-bits is published with pvp versionScheme (nice), this means that
we should just evaluate the version portion for pvp-ness, but I was
using `guessSecondSegment` that checks for Scala suffix. That's mistake
1.

`guessSecondSegment` assumes that the Scala suffix uses the given
ScalaModuleInfo, but with 2.13-3 sandwich we can't assume this.
In the reported case, Scala module is 3.0.0-M3 but scodec-bits uses
2.13. So that's mistake 2.

This attempts to correct both the mistakes.
1. Instead of `guessSecondSegment`, this adds a simpler `evalPvp`
function.
2. `guessSecondSegment` just looks for `_2.` or `_3` and ignores the
Scala module.
2020-12-19 17:08:24 -05:00
Adrien Piquerez 24f85fd18c Adapt ScalaOverride to Scala 3 2020-12-18 17:28:47 +01:00
Adrien Piquerez 48b2a7a0a1 Add Scala 3 artifacts 2020-12-17 09:32:40 +01:00
Adrien Piquerez f1ede7cd06 Add Scala 3 binary versioning 2020-12-17 09:32:40 +01:00
Eugene Yokota 39090fa0d3 Formatting 2020-09-21 22:29:08 -04:00
izharahmd fa0f859552 retry with backoff while publishing 2020-09-15 20:32:38 +05:30
Eugene Yokota 9d87715100 Automatic eviction warning
This extracts info.versionScheme from POM and uses that to guide the
eviction report instead of taking a stab in the dark that all Scala
libraries are using pvp.
2020-08-05 16:39:11 -04:00
Eugene Yokota 5f4cbad6c4 support UNC path
Fixes https://github.com/sbt/sbt/issues/5596
2020-06-25 23:24:43 -04:00
Eugene Yokota 375613efbf Make validateProtocol return Boolean
Ref https://github.com/sbt/sbt/issues/4905

To deprecate and unsupport HTTP, first log all the error messages out then throw at sbt level.
2020-06-06 19:29:09 -04:00
Eugene Yokota fd71e8cb17 Bump Contraband 2020-04-06 18:15:46 -04:00
Eugene Yokota b01b61384e Add custom handling for Disabled companion object
https://github.com/sbt/librarymanagement/pull/316 started returning Disabled companion object for `apply()` instead of creating a new instance.
This leaked into JSON as it uses runtime types for union. This works around that by providing a hand-crafted format.

Ref https://github.com/sbt/sbt/pull/4997
2019-08-28 18:33:46 -04:00
Eugene Yokota 2071b29748 Remove unused file 2019-08-28 18:28:30 -04:00
Eugene Yokota 337716830f Deprecate HTTP resolvers (take 2)
Ref https://github.com/sbt/sbt/issues/4905
Ref https://github.com/sbt/librarymanagement/pull/312

Based on the discussion in https://github.com/sbt/sbt/issues/4905, this will exempt localhost, and also allows per-resolver opt-in for HTTP.
2019-08-28 15:20:23 -04:00
Eugene Yokota 7ad02276e9 adding try-catch per review 2019-08-27 23:37:45 -04:00
Eugene Yokota 5480646715 pass in Locale
toLowerCase would act differently in Turkey.
2019-08-27 17:51:19 -04:00
Eugene Yokota c5ce636376 Flip the default to not use Gigahorse by default
Fixes https://github.com/sbt/sbt/issues/3570

The primary motivation for bringing in Gigahorse was to speed up the dependency resolution, especially in a high-latency environment like Australia, by enabling keep-alive. One of unintended consequences was that it ended up exposing either a bug in okhttp or Nexus / Artifactory's handling of keep-alive, since corporate users behind these proxy repositories started to experience problem publishing. Multiple people have also reported that putting network proxies like HAProxy works around this issue, which seems consistent with the theory.

Now that dependency resolution has switched to using Coursier by default, I am just going to flip the default here so publishing would use Ivy's default URL handler based on `java.net.HttpURLConnection` - 5681e1a77a/src/java/org/apache/ivy/util/url/BasicURLHandler.java
2019-08-27 17:47:32 -04:00