Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Aug 12, 2024
2 parents f1b51cd + 613fb17 commit 08fce97
Show file tree
Hide file tree
Showing 73 changed files with 456 additions and 140 deletions.
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

0 comments on commit 08fce97

Please sign in to comment.