Skip to content

Commit 1b00548

Browse files
authored
Auto merge of servo#29950 - mrobinson:unify-style-crate, r=mukilan
Make Layout 2020/2013 a runtime switch This change makes the choice between Layout 2020 and Layout 2013 a runtime switch. The main part of the patch is removing all layout related compile-time flags from the style crate. This makes the style crate a lot simpler, but now Layout 2020 parses a good deal of features that it doesn't support (table, vertical-align, etc). The good news is that we plan to add these features to Layout 2020. - Compile a single style for both Layout 2020 and Layout 2013 - Remove layout_2020/layout_2013 features - Update GitHub workflows for single compilation - Update test results <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix servo#29942 - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2 parents 2e0517d + d31cdb6 commit 1b00548

File tree

262 files changed

+1808
-3768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+1808
-3768
lines changed

.github/workflows/linux.yml

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: Linux workflow
22
on:
33
workflow_call:
44
inputs:
5-
layout:
6-
required: true
7-
type: string
85
wpt:
96
required: false
107
type: string
@@ -21,10 +18,6 @@ on:
2118
type: string
2219
workflow_dispatch:
2320
inputs:
24-
layout:
25-
required: true
26-
type: choice
27-
options: ["2013", "2020"]
2821
wpt:
2922
default: "test"
3023
required: false
@@ -44,8 +37,6 @@ on:
4437
env:
4538
RUST_BACKTRACE: 1
4639
SHELL: /bin/bash
47-
LAYOUT: "${{ (contains(inputs.layout, '2020') || github.ref_name == 'try-wpt-2020') && 'layout-2020' || 'layout-2013' }}"
48-
PACKAGE: "${{ (contains(inputs.layout, '2020') || github.ref_name == 'try-wpt-2020') && 'linux-layout2020' || 'linux' }}"
4940
SCCACHE_GHA_ENABLED: "true"
5041
RUSTC_WRAPPER: "sccache"
5142
CCACHE: "sccache"
@@ -72,35 +63,35 @@ jobs:
7263
- name: Tidy
7364
run: python3 ./mach test-tidy --no-progress --all
7465
- name: Release build
75-
run: python3 ./mach build --release --with-${{ env.LAYOUT }}
66+
run: python3 ./mach build --release
7667
- name: Smoketest
7768
run: xvfb-run python3 ./mach smoketest
7869
- name: Script tests
7970
run: ./mach test-scripts
8071
- name: Unit tests
8172
if: ${{ inputs.unit-tests || github.ref_name == 'try-linux' }}
82-
run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }}
73+
run: python3 ./mach test-unit --release
8374
- name: Rename build timing
84-
run: cp -r target/cargo-timings target/cargo-timings-linux-${{ env.LAYOUT }}
75+
run: cp -r target/cargo-timings target/cargo-timings-linux
8576
- name: Archive build timing
8677
uses: actions/upload-artifact@v3
8778
with:
8879
name: cargo-timings
8980
# Using a wildcard here ensures that the archive includes the path.
90-
path: target/cargo-timings-*-${{ env.LAYOUT }}
81+
path: target/cargo-timings-*
9182
- name: Lockfile check
9283
run: ./etc/ci/lockfile_changed.sh
9384
- name: Package
9485
run: python3 ./mach package --release
9586
- name: Upload Package
9687
uses: actions/upload-artifact@v3
9788
with:
98-
name: ${{ env.PACKAGE }}
89+
name: linux
9990
path: target/release/servo-tech-demo.tar.gz
10091
- name: Upload
10192
if: ${{ inputs.upload }}
10293
run: |
103-
python3 ./mach upload-nightly ${{ env.PACKAGE }} \
94+
python3 ./mach upload-nightly linux \
10495
--secret-from-environment \
10596
--github-release-id ${{ inputs.github-release-id }}
10697
env:
@@ -112,7 +103,7 @@ jobs:
112103
- name: Archive binary
113104
uses: actions/upload-artifact@v3
114105
with:
115-
name: ${{ env.LAYOUT }}-release-binary
106+
name: release-binary
116107
path: target.tar.gz
117108

118109
linux-wpt:
@@ -125,14 +116,15 @@ jobs:
125116
strategy:
126117
fail-fast: false
127118
matrix:
119+
layout: ["layout-2020", "layout-2013"]
128120
chunk_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
129121
steps:
130122
- uses: actions/checkout@v3
131123
with:
132124
fetch-depth: 2
133125
- uses: actions/download-artifact@v3
134126
with:
135-
name: ${{ env.LAYOUT }}-release-binary
127+
name: release-binary
136128
path: release-binary
137129
- name: unPackage binary
138130
run: tar -xzf release-binary/target.tar.gz
@@ -151,45 +143,43 @@ jobs:
151143
- name: Run tests
152144
if: ${{ inputs.wpt != 'sync' }}
153145
run: |
154-
python3 ./mach test-wpt --with-${{ env.LAYOUT }} \
146+
python3 ./mach test-wpt --with-${{ matrix.layout }} \
155147
--release --processes $(nproc) --timeout-multiplier 2 \
156148
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
157-
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
158-
--log-raw-unexpected unexpected-test-wpt.${{ matrix.chunk_id }}.log \
159-
--filter-intermittents filtered-test-wpt.${{ matrix.chunk_id }}.json
149+
--log-raw test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log \
150+
--log-raw-unexpected unexpected-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log \
151+
--filter-intermittents filtered-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.json
160152
env:
161153
GITHUB_CONTEXT: ${{ toJson(github) }}
162154
INTERMITTENT_TRACKER_DASHBOARD_SECRET: ${{ secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET }}
163155
- name: Run tests (sync)
164156
if: ${{ inputs.wpt == 'sync' }}
165157
run: |
166-
python3 ./mach test-wpt --with-${{ env.LAYOUT }} \
158+
python3 ./mach test-wpt --with-${{ matrix.layout }} \
167159
--release --processes $(nproc) --timeout-multiplier 2 \
168160
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
169161
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
170-
--log-servojson wpt-jsonsummary.${{ matrix.chunk_id }}.log \
171162
--always-succeed
172163
- name: Archive filtered results
173164
uses: actions/upload-artifact@v3
174165
if: ${{ always() && inputs.wpt != 'sync' }}
175166
with:
176-
name: wpt-filtered-results-linux-${{ env.LAYOUT }}
167+
name: wpt-filtered-results-linux
177168
path: |
178-
filtered-test-wpt.${{ matrix.chunk_id }}.json
179-
unexpected-test-wpt.${{ matrix.chunk_id }}.log
169+
filtered-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.json
170+
unexpected-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log
180171
- name: Archive logs
181172
uses: actions/upload-artifact@v3
182173
if: ${{ failure() && inputs.wpt != 'sync' }}
183174
with:
184-
name: wpt-logs-linux-${{ env.LAYOUT }}
175+
name: wpt-logs-linux
185176
path: |
186-
test-wpt.${{ matrix.chunk_id }}.log
187-
filtered-wpt-results.${{ matrix.chunk_id }}.json
177+
test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log
188178
- name: Archive logs
189179
uses: actions/upload-artifact@v3
190180
if: ${{ inputs.wpt == 'sync' }}
191181
with:
192-
name: wpt-logs-linux-${{ env.LAYOUT }}
182+
name: wpt-logs-linux-${{ matrix.layout }}
193183
path: |
194184
test-wpt.${{ matrix.chunk_id }}.log
195185
wpt-jsonsummary.${{ matrix.chunk_id }}.log
@@ -206,18 +196,23 @@ jobs:
206196
fetch-depth: 2
207197
- uses: actions/download-artifact@v3
208198
with:
209-
name: wpt-filtered-results-linux-${{ env.LAYOUT }}
199+
name: wpt-filtered-results-linux
210200
path: wpt-filtered-results-linux
211201
- name: Create aggregated unexpected results
212-
run: cat wpt-filtered-results-linux/*.log > unexpected-test-wpt.log
202+
run: |
203+
cat wpt-filtered-results-linux/*-layout-2020.*.log > unexpected-test-wpt-layout-2020.log
204+
cat wpt-filtered-results-linux/*-layout-2013.*.log > unexpected-test-wpt-layout-2013.log
213205
- name: Archive aggregate results
214206
uses: actions/upload-artifact@v3
215207
with:
216-
name: wpt-filtered-results-linux-${{ env.LAYOUT }}
208+
name: wpt-filtered-results-linux
217209
path: |
218-
unexpected-test-wpt.log
210+
unexpected-test-wpt-layout-2020.log
211+
unexpected-test-wpt-layout-2013.log
219212
- name: Comment on PR with results
220-
run: etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-${{ env.LAYOUT }}" wpt-filtered-results-linux/*.json
213+
run: |
214+
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-2020" wpt-filtered-results-linux/*-layout-2020.*.json
215+
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-2013" wpt-filtered-results-linux/*-layout-2013.*.json
221216
env:
222217
GITHUB_CONTEXT: ${{ toJson(github) }}
223218
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/mac.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Mac workflow
33
on:
44
workflow_call:
55
inputs:
6-
layout:
7-
required: true
8-
type: string
96
unit-tests:
107
required: false
118
default: false
@@ -19,10 +16,6 @@ on:
1916
type: string
2017
workflow_dispatch:
2118
inputs:
22-
layout:
23-
required: true
24-
type: choice
25-
options: ["2013", "2020"]
2619
unit-tests:
2720
required: false
2821
default: false
@@ -37,8 +30,6 @@ on:
3730
env:
3831
RUST_BACKTRACE: 1
3932
SHELL: /bin/bash
40-
LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}"
41-
PACKAGE: "${{ contains(inputs.layout, '2020') && 'mac-layout2020' || 'mac' }}"
4233
SCCACHE_GHA_ENABLED: "true"
4334
RUSTC_WRAPPER: "sccache"
4435
CCACHE: "sccache"
@@ -60,35 +51,35 @@ jobs:
6051
python3 ./mach bootstrap
6152
- name: Release build
6253
run: |
63-
python3 ./mach build --release --with-${{ env.LAYOUT }}
54+
python3 ./mach build --release
6455
- name: Smoketest
6556
run: python3 ./mach smoketest
6657
- name: Script tests
6758
run: ./mach test-scripts
6859
- name: Unit tests
6960
if: ${{ inputs.unit-tests || github.ref_name == 'try-mac' }}
70-
run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }}
61+
run: python3 ./mach test-unit --release
7162
- name: Package
7263
run: python3 ./mach package --release
7364
- name: Package smoketest
7465
run: ./etc/ci/macos_package_smoketest.sh target/release/servo-tech-demo.dmg
7566
- name: Rename build timing
76-
run: cp -r target/cargo-timings target/cargo-timings-macos-${{ env.LAYOUT }}
67+
run: cp -r target/cargo-timings target/cargo-timings-macos
7768
- name: Archive build timing
7869
uses: actions/upload-artifact@v3
7970
with:
8071
name: cargo-timings
8172
# Using a wildcard here ensures that the archive includes the path.
82-
path: target/cargo-timings-*-${{ env.LAYOUT }}
73+
path: target/cargo-timings-*
8374
- name: Upload package
8475
uses: actions/upload-artifact@v3
8576
with:
86-
name: ${{ env.PACKAGE }}
77+
name: mac
8778
path: target/release/servo-tech-demo.dmg
8879
- name: Upload
8980
if: ${{ inputs.upload }}
9081
run: |
91-
python3 ./mach upload-nightly ${{ env.PACKAGE }} --secret-from-environment \
82+
python3 ./mach upload-nightly mac --secret-from-environment \
9283
--github-release-id ${{ inputs.github-release-id }}
9384
env:
9485
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
@@ -100,7 +91,7 @@ jobs:
10091
- name: Archive binary
10192
uses: actions/upload-artifact@v3
10293
with:
103-
name: release-${{ env.LAYOUT }}-binary-macos
94+
name: release-binary-macos
10495
path: target.tar.gz
10596

10697
# mac-wpt:

.github/workflows/main.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,20 @@ jobs:
3838
needs: ["decision"]
3939
uses: ./.github/workflows/windows.yml
4040
with:
41-
layout: '2013'
4241
unit-tests: true
4342

4443
build-mac:
4544
name: Mac
4645
needs: ["decision"]
4746
uses: ./.github/workflows/mac.yml
4847
with:
49-
layout: '2013'
5048
unit-tests: true
5149

5250
build-linux:
5351
name: Linux
5452
needs: ["decision"]
5553
uses: ./.github/workflows/linux.yml
5654
with:
57-
layout: '2013'
58-
wpt: 'test'
59-
unit-tests: true
60-
61-
build-linux-layout-2020:
62-
name: Linux (layout-2020)
63-
needs: ["decision"]
64-
uses: ./.github/workflows/linux.yml
65-
with:
66-
layout: '2020'
6755
wpt: 'test'
6856
unit-tests: true
6957

@@ -77,7 +65,6 @@ jobs:
7765
- "build-win"
7866
- "build-mac"
7967
- "build-linux"
80-
- "build-linux-layout-2020"
8168

8269
steps:
8370
- name: Mark the job as successful

.github/workflows/nightly.yml

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,8 @@ jobs:
5959
needs:
6060
- create-draft-release
6161
- upload-linux
62-
- upload-linux-2013
6362
- upload-win
64-
- upload-win-2013
6563
- upload-mac
66-
- upload-mac-2013
6764

6865
upload-win:
6966
# This job is only useful when run on upstream servo.
@@ -73,20 +70,6 @@ jobs:
7370
- create-draft-release
7471
uses: ./.github/workflows/windows.yml
7572
with:
76-
layout: '2020'
77-
upload: true
78-
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
79-
secrets: inherit
80-
81-
upload-win-2013:
82-
# This job is only useful when run on upstream servo.
83-
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
84-
name: Upload nightly (Windows layout-2013)
85-
needs:
86-
- create-draft-release
87-
uses: ./.github/workflows/windows.yml
88-
with:
89-
layout: '2013'
9073
upload: true
9174
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
9275
secrets: inherit
@@ -99,20 +82,6 @@ jobs:
9982
- create-draft-release
10083
uses: ./.github/workflows/mac.yml
10184
with:
102-
layout: '2020'
103-
upload: true
104-
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
105-
secrets: inherit
106-
107-
upload-mac-2013:
108-
# This job is only useful when run on upstream servo.
109-
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
110-
name: Upload nightly (macOS layout-2013)
111-
needs:
112-
- create-draft-release
113-
uses: ./.github/workflows/mac.yml
114-
with:
115-
layout: '2013'
11685
upload: true
11786
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
11887
secrets: inherit
@@ -125,20 +94,6 @@ jobs:
12594
- create-draft-release
12695
uses: ./.github/workflows/linux.yml
12796
with:
128-
layout: '2020'
12997
upload: true
13098
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
131-
secrets: inherit
132-
133-
upload-linux-2013:
134-
# This job is only useful when run on upstream servo.
135-
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
136-
name: Upload nightly (Linux layout-2013)
137-
needs:
138-
- create-draft-release
139-
uses: ./.github/workflows/linux.yml
140-
with:
141-
layout: '2013'
142-
upload: true
143-
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
144-
secrets: inherit
99+
secrets: inherit

.github/workflows/pull-request.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,4 @@ jobs:
1111
if: github.repository == 'servo/servo'
1212
uses: ./.github/workflows/linux.yml
1313
with:
14-
layout: '2013'
15-
unit-tests: true
16-
17-
build-linux-layout-2020:
18-
name: Linux (layout-2020)
19-
if: github.repository == 'servo/servo'
20-
uses: ./.github/workflows/linux.yml
21-
with:
22-
layout: '2020'
23-
unit-tests: false
14+
unit-tests: true

0 commit comments

Comments
 (0)