Commit Graph

16 Commits

Author SHA1 Message Date
Michael Thomsen 9ef6c1e1a4 Update deps to new version of package_config
Fixes https://github.com/dart-lang/language/issues/879

Closes https://github.com/dart-lang/sdk/pull/41127
https://github.com/dart-lang/sdk/pull/41127

GitOrigin-RevId: ab6f2b79c28b0261d334e802ab8acb538b328249
Change-Id: Iff648b71d6e4d3982a3c7580b64e813e63be43fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140244
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-03-25 13:07:32 +00:00
Jens Johansen a55fed2e5f [CFE] Get in line with update on which package description file to use
Fixes #40864

Change-Id: I681186660162c55e66c1deee68a4052de4cfcfe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139201
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-12 11:33:52 +00:00
Johnni Winther 5829fc7829 [analyzer,cfe,dart2js] Add marker.options files to automate running id tests on all configurations
Change-Id: Ib5eb7f3967634721047f8dcc57b9e6c350b91a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136226
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-21 08:34:26 +00:00
Jens Johansen 81d4ac07d4 [CFE] Use package config v2
Change-Id: I32da9e8b2c1040db1521af4345f8e952c22bd30d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130864
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-12 10:07:25 +00:00
Johnni Winther 8d874a5bd8 [cfe] Avoid cascading errors from part versioning mismatch
Change-Id: I8a233ff6c3b727176b812db203dac87f022f8a84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126643
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-28 10:48:34 +00:00
Jens Johansen 10f8a00e9f [CFE] Update language versioning implementation to conform with specification v1.3
In the feature specification v1.2 libraries in a package with a default
version wasn't allowed to specify a language version higher than that.
In v1.3 thats allowed as long as its below the sdk limit.

Change-Id: I85f5c36a9c9c427da03fc540f9175195134ad47f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114604
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-28 09:30:12 +00:00
Jens Johansen b99df2be86 [CFE] Language versioning - additional tests
Change-Id: I0dd93c3a1d422bbbbbd920fae21569a7bdc91e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112341
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 10:08:20 +00:00
Jens Johansen 10e63b7840 [CFE] Get fragment from default package - use language version if any
Language versioning specifies that an empty-name-entry in .packages
specifies a sort of "default package" that a non-package file should
pretend to be a part of "for any purpose where that matters,
including choosing the default language level."

Change-Id: I16f4b2f5e4d3ca1e82d2189321e2be5c43e3b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112089
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 09:06:32 +00:00
Jens Johansen b9217efc77 [CFE] [Language versioning] Issue error on multiple 'dart=' entries
Issue error when the .packages file specifies more than on 'dart=' entry.
Also add another test of the library and part mismatch being an error.

Change-Id: I0a894e6ef86eb9f976b9fbdce67f0c9adb03be9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112881
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-13 10:07:39 +00:00
Jens Johansen aac8204ad3 [CFE] Error when library and part(s) doesn't agree on language version
From the feature spec: "Part files must be marked with the same version
as their library. They must always be treated the same way as the
library they belong to, so it is a compile-time error if a part file has
a different language level override than its library. It is also a
compile-time error if a part file has no language version marker,
and the importing library does".

Change-Id: I29805e261e63b89a7d8832770ed2b007fb6df37f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112247
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-08 08:07:53 +00:00
Jens Johansen b9c0f5c09f [CFE] Issue error when .packages specifies wrong language version
From the feature specification: "If an entry contains an invalid dart
version value, #dart=arglebargle or #dart= or any other value which is
not a semantic versioning version, then tools which need the version
should report an error."

Change-Id: Ieb54dbbad6f2fecb341e27b468e3ffdf90717a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112245
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-08 07:05:00 +00:00
Jens Johansen 21b026dd88 [CFE] Issue error when langauge version is specified too high
Specifying a language version higher than the highest supported version
(aka the default version) is an error.

Specifying a language verison in code that is higher than the one
specified in .packages is an error.

Change-Id: I44e1c8c45cef715038786dbf248925b73bd6cd7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-08 06:55:38 +00:00
Jens Johansen ef9b09abe3 [CFE] Language versioning positive tests
Add a bunch of positive tests to the langauge versioning.

Change-Id: Ic3f85c49a82e47f2c192fb7ac38fda1210b5d32e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112090
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-07 06:23:47 +00:00
Jens Johansen 574c4a51c6 [CFE] Initial support for parsing language version from .packages
If the .packages file specifies a fragment on a uri on the form
"dart=x.y", x.y becomes the default lanaguage version for libraries in
that package.

Change-Id: I69cb4157fdf5852184cc3519b033c3624792f783
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112082
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-06 12:42:47 +00:00
Jens Johansen 69ae29076a Default language version if nothing is specified
A kernel library will say it has the newest language version if no
language version is set.
This basically preserves the current semantics of always being on the
newest version (if nothing is explicitly done), e.g. if creating a kernel
library by hand and not setting it.
The front_end also utilize this and just doesn't set it, if it isn't set.

Change-Id: I033fef13626ee034030ba8fc9d141b182ba1a5ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111739
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-06 09:13:29 +00:00
Jens Johansen 6d1c9975d7 [CFE] Initial language versioning "support"
This CL sets up the bare minimum support for saving the language version
specified in a file on the kernel library, and adds simple support for
testing it.

The data is not serialized out, error checked or similar in this change.

Change-Id: I4b061ce617acae7964b85be105e0ad0e3e031aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111640
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-05 07:03:04 +00:00