Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into feature.color-4 #2307

Merged
merged 26 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
21eeb4d
Parse Deprecation.forVersion on compiler side (#2248)
ntkme May 30, 2024
53b9ead
Regenerate protobuf as part of default task (#2257)
nex3 May 31, 2024
5ddd7fc
Enable AOT build for linux-riscv64-musl (#2258)
ntkme Jun 6, 2024
ecff05d
Remove the heuristic where long selector lists wouldn't be trimmed (#…
nex3 Jun 11, 2024
a1b372e
Enable AOT build for linux-riscv64 (#2260)
ntkme Jun 11, 2024
cf6f9d0
Build AOT releases with native arm64 runners (#2262)
ntkme Jun 12, 2024
7aae1e6
Fix a bug where comments were incorrectly forbidden in some cases (#2…
nex3 Jun 17, 2024
860eb5a
Fix linux-ia32, linux-arm-musl, and windows-arm64 releases (#2265)
ntkme Jun 17, 2024
04b6251
Parse silent comments in `_interpolatedDeclarationValue()` (#2266)
nex3 Jun 20, 2024
a164889
Enable AOT build for windows-arm64 (#2270)
ntkme Jul 2, 2024
1edc247
Avoid `[this]` in Dartdoc comments (#2273)
nex3 Jul 9, 2024
7203d65
Deprecated mixed declarations (#2267)
nex3 Jul 9, 2024
c96b5e2
Fix windows-arm64 release (#2274)
ntkme Jul 10, 2024
d4b1939
Run pub in verbose mode on windows-arm64
nex3 Jul 11, 2024
be9c3ac
Run Windows ARM64 releases on windows-latest instead (#2275)
nex3 Jul 11, 2024
0cf4768
Bump dartdoc from 8.0.7 to 8.0.8 (#2284)
dependabot[bot] Jul 22, 2024
e03547f
Enable AOT build for windows-arm64 (#2286)
ntkme Jul 24, 2024
d0e02eb
Let dependabot check updates for composite actions (#2287)
ntkme Jul 24, 2024
7e1ea80
Bump dartdoc from 8.0.7 to 8.0.8 (#2289)
dependabot[bot] Jul 29, 2024
715a93f
Bump bufbuild/buf-setup-action in /.github/util/initialize (#2288)
dependabot[bot] Jul 29, 2024
b0271a5
Refactor duplicated code in CI (#2295)
ntkme Jul 30, 2024
9f786f4
Fix analysis issues (#2294)
jathak Jul 30, 2024
8541f80
Add a changelog entry for sass/embedded-host-node#313 (#2296)
nex3 Aug 1, 2024
9aeefc9
Fix dart vm lockup during shutdown with pending requests (#2279)
ntkme Aug 1, 2024
613fb17
Add a changelog entry for https://github.com/sass/embedded-host-node/…
ntkme Aug 6, 2024
08fce97
Merge remote-tracking branch 'origin/main' into merge
nex3 Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ updates:
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
directories:
- "/"
- "/.github/util/*/"
schedule:
interval: "weekly"
26 changes: 22 additions & 4 deletions .github/util/initialize/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,38 @@ runs:
with:
node-version: "${{ inputs.node-version }}"

# See: https://github.com/dart-lang/sdk/issues/52266
- run: Invoke-WebRequest https://pub.dev
if: runner.os == 'Windows'
shell: powershell

# See: https://github.com/orgs/community/discussions/131594
# The composite action requires an explict shell, but bash is not available on windows-arm64 runner.
# For the following commands conditionally use bash or powershell based on the runner.os:
- run: dart pub get
shell: bash
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}

- run: npm install
shell: bash
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}

- uses: bufbuild/buf-setup-action@v1.30.0
- uses: bufbuild/buf-setup-action@v1.35.1
with: {github_token: "${{ inputs.github-token }}"}

# This composite action requires bash, but bash is not available on windows-arm64 runner.
# Avoid running this composite action on non-PR, so that we can release on windows-arm64.
- name: Check out the language repo
if: github.event_name == 'pull_request'
uses: sass/clone-linked-repo@v1
with: {repo: sass/sass, path: build/language}

# Git is not pre-installed on windows-arm64 runner, however actions/checkout support
# downloading repo via GitHub API.
- name: Check out the language repo
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
with: {repository: sass/sass, path: build/language}

- name: Generate Dart from protobuf
run: dart run grinder protobuf
env: {UPDATE_SASS_SASS_REPO: false}
shell: bash
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}
7 changes: 6 additions & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,32 @@ jobs:
build:
name: Build

runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}

strategy:
fail-fast: false
matrix:
include:
- arch: x64
lib: lib64
runner: ubuntu-latest
platform: linux/amd64
- arch: ia32
lib: lib
runner: ubuntu-latest
platform: linux/amd64
- arch: arm64
lib: lib64
runner: linux-arm64
platform: linux/arm64
- arch: arm
lib: lib
runner: linux-arm64
platform: linux/arm64
# There is no docker image for riscv64 dart-sdk, build kernel snapshot instead.
- arch: riscv64
lib: lib64
runner: ubuntu-latest
platform: linux/amd64 # linux/riscv64

steps:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build-linux-musl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ jobs:
build:
name: Build

runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}

strategy:
fail-fast: false
matrix:
include:
- arch: x64
runner: ubuntu-latest
platform: linux/amd64
- arch: ia32
platform: linux/386
runner: ubuntu-latest
platform: linux/amd64
- arch: arm64
runner: linux-arm64
platform: linux/arm64
# There is a bug in qemu's mremap causing pthread_getattr_np in musl to stuck in a loop on arm.
# Unless qemu fixes the bug or we get a real linux-arm runner, we cannot build aot-snapshot
# for arm on CI. So, we create a kernel snapshot for arm build in amd64 container instead.
# https://gitlab.com/qemu-project/qemu/-/issues/1729
- arch: arm
platform: linux/amd64 # linux/arm/v7
# There is no docker image for riscv64 dart-sdk, build kernel snapshot instead.
runner: linux-arm64
platform: linux/arm/v7
- arch: riscv64
platform: linux/amd64 # linux/riscv64
runner: ubuntu-latest
platform: linux/riscv64

steps:
- uses: actions/checkout@v4
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Build
run: |
docker run --rm -i \
--platform ${{ matrix.arch == 'arm' && 'linux/amd64' || matrix.platform }} \
--platform ${{ matrix.platform }} \
--volume "$PWD:$PWD" \
--workdir "$PWD" \
ghcr.io/dart-musl/dart <<'EOF'
Expand Down
45 changes: 39 additions & 6 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@ jobs:
build:
name: Build

runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}

strategy:
fail-fast: false
matrix:
include:
- arch: x64
runner: ubuntu-latest
platform: linux/amd64
- arch: ia32
runner: ubuntu-latest
platform: linux/amd64
- arch: arm
platform: linux/arm/v7
- arch: arm64
runner: linux-arm64
platform: linux/arm64
# There is no docker image for riscv64 dart-sdk, build kernel snapshot instead.
# https://github.com/dart-lang/dart-docker/issues/96#issuecomment-1669860829
- arch: arm
runner: linux-arm64
platform: linux/arm/v7
- arch: riscv64
platform: linux/amd64 # linux/riscv64
runner: ubuntu-latest
platform: linux/riscv64

steps:
- uses: actions/checkout@v4
Expand All @@ -46,6 +49,7 @@ jobs:
EOF

- name: Build
if: matrix.arch != 'riscv64'
run: |
docker run --rm -i \
--platform ${{ matrix.platform }} \
Expand All @@ -57,6 +61,35 @@ jobs:
dart run grinder pkg-standalone-linux-${{ matrix.arch }}
EOF

# https://github.com/dart-lang/dart-docker/issues/96#issuecomment-1669860829
# There is no official riscv64 dart container image yet, build on debian:unstable instead.
# The setup is adopted from: https://github.com/dart-lang/dart-docker/blob/main/Dockerfile-debian.template
- name: Build riscv64
if: matrix.arch == 'riscv64'
run: |
DART_CHANNEL=stable
DART_VERSION=$(curl -fsSL https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/latest/VERSION | yq .version)
curl -fsSLO https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/$DART_VERSION/sdk/dartsdk-linux-${{ matrix.arch }}-release.zip

docker run --rm -i \
--platform ${{ matrix.platform }} \
--volume "$PWD:$PWD" \
--workdir "$PWD" \
docker.io/library/debian:unstable-slim <<'EOF'
set -e
apt-get update
apt-get install -y --no-install-recommends ca-certificates curl dnsutils git openssh-client unzip

export DART_SDK=/usr/lib/dart
export PATH=$DART_SDK/bin:/root/.pub-cache/bin:$PATH

SDK="dartsdk-linux-${{ matrix.arch }}-release.zip"
unzip "$SDK" && mv dart-sdk "$DART_SDK" && rm "$SDK"

dart pub get
dart run grinder pkg-standalone-linux-${{ matrix.arch }}
EOF

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- arch: x64
runner: macos-13
- arch: arm64
runner: macos-14
runner: macos-latest

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- arch: ia32
runner: windows-latest
- arch: arm64
runner: windows-latest
runner: windows-arm64

steps:
- uses: actions/checkout@v4
Expand Down
54 changes: 53 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.78.0
## 1.79.0

* **Breaking change**: Passing a number with unit `%` to the `$alpha` parameter
of `color.change()`, `color.adjust()`, `change-color()`, and `adjust-color()`
Expand Down Expand Up @@ -188,6 +188,58 @@

* Remove `RgbColor`, `HslColor` and `HwbColor` SassScript values.

## 1.78.0

### Embedded Sass

* Explicitly expose a `sass` executable from the `sass-embedded` npm package.
This was intended to be included in 1.63.0, but due to the way
platform-specific dependency executables are installed it did not work as
intended. Now users can run `npx sass` for local installs or just `sass` when
`sass-embedded` is installed globally.

* Add linux-riscv64, linux-musl-riscv64, and android-riscv64 support for the
`sass-embedded` npm package.

* Fix an edge case where the Dart VM could hang when shutting down when requests
were in flight.

## 1.77.8

* No user-visible changes.

## 1.77.7

* Declarations that appear after nested rules are deprecated, because the
semantics Sass has historically used are different from the semantics
specified by CSS. In the future, Sass will adopt the standard CSS semantics.

See [the Sass website](https://sass-lang.com/d/mixed-decls) for details.

* **Potentially breaking bug fix:** `//` in certain places such as unknown
at-rule values was being preserved in the CSS output, leading to potentially
invalid CSS. It's now properly parsed as a silent comment and omitted from the
CSS output.

## 1.77.6

* Fix a few cases where comments and occasionally even whitespace wasn't allowed
between the end of Sass statements and the following semicolon.

## 1.77.5

* Fully trim redundant selectors generated by `@extend`.

## 1.77.4

### Embedded Sass

* Support passing `Version` input for `fatalDeprecations` as string over
embedded protocol.

* Fix a bug in the JS Embedded Host where `Version` could be incorrectly accepted
as input for `silenceDeprecations` and `futureDeprecations` in pure JS.

## 1.77.3

### Dart API
Expand Down
4 changes: 2 additions & 2 deletions analysis/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage: https://github.com/sass/dart-sass/tree/master/analysis
publish_to: none

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
lints: ^2.0.0
lints: ^4.0.0
12 changes: 12 additions & 0 deletions lib/src/ast/selector/compound.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ final class CompoundSelector extends Selector {
SimpleSelector? get singleSimple =>
components.length == 1 ? components.first : null;

/// Whether any simple selector in this contains a selector that requires
/// complex non-local reasoning to determine whether it's a super- or
/// sub-selector.
///
/// This includes both pseudo-elements and pseudo-selectors that take
/// selectors as arguments.
///
/// #nodoc
@internal
late final bool hasComplicatedSuperselectorSemantics = components
.any((component) => component.hasComplicatedSuperselectorSemantics);

CompoundSelector(Iterable<SimpleSelector> components, super.span)
: components = List.unmodifiable(components) {
if (this.components.isEmpty) {
Expand Down
4 changes: 4 additions & 0 deletions lib/src/ast/selector/pseudo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ final class PseudoSelector extends SimpleSelector {
bool get isHostContext =>
isClass && name == 'host-context' && selector != null;

@internal
bool get hasComplicatedSuperselectorSemantics =>
isElement || selector != null;

/// The non-selector argument passed to this selector.
///
/// This is `null` if there's no argument. If [argument] and [selector] are
Expand Down
10 changes: 10 additions & 0 deletions lib/src/ast/selector/simple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ abstract base class SimpleSelector extends Selector {
/// sequence will contain 1000 simple selectors.
int get specificity => 1000;

/// Whether this requires complex non-local reasoning to determine whether
/// it's a super- or sub-selector.
///
/// This includes both pseudo-elements and pseudo-selectors that take
/// selectors as arguments.
///
/// #nodoc
@internal
bool get hasComplicatedSuperselectorSemantics => false;

SimpleSelector(super.span);

/// Parses a simple selector from [contents].
Expand Down
3 changes: 1 addition & 2 deletions lib/src/async_import_cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ final class AsyncImportCache {
// If multiple original URLs canonicalize to the same thing, choose the
// shortest one.
minBy<Uri, int>(
_canonicalizeCache.values
.whereNotNull()
_canonicalizeCache.values.nonNulls
.where((result) => result.$2 == canonicalUrl)
.map((result) => result.originalUrl),
(url) => url.path.length)
Expand Down
11 changes: 8 additions & 3 deletions lib/src/deprecation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum Deprecation {
// DO NOT EDIT. This section was generated from the language repo.
// See tool/grind/generate_deprecations.dart for details.
//
// Checksum: eb5e3889156f5ed12e119f11786f06f91a5f05c2
// Checksum: b87f31f543f52c97431cce85ef11e92b6a71cfde

/// Deprecation for passing a string directly to meta.call().
callString('call-string',
Expand Down Expand Up @@ -90,14 +90,19 @@ enum Deprecation {
deprecatedIn: '1.76.0',
description: 'Function and mixin names beginning with --.'),

/// Deprecation for declarations after or between nested rules.
mixedDecls('mixed-decls',
deprecatedIn: '1.77.7',
description: 'Declarations after or between nested rules.'),

/// Deprecation for certain uses of built-in sass:color functions.
color4Api('color-4-api',
deprecatedIn: '1.78.0',
deprecatedIn: '1.79.0',
description: 'Certain uses of built-in sass:color functions.'),

/// Deprecation for using global color functions instead of sass:color.
colorFunctions('color-functions',
deprecatedIn: '1.78.0',
deprecatedIn: '1.79.0',
description: 'Using global color functions instead of sass:color.'),

/// Deprecation for @import rules.
Expand Down
Loading