Compare commits
266 Commits
mesa-22.2.
...
mesa-22.1.
Author | SHA1 | Date | |
---|---|---|---|
|
6fade22da9 | ||
|
d25f388853 | ||
|
b7366e6acb | ||
|
03d5e496d9 | ||
|
0b90d3dc58 | ||
|
8e84d6fded | ||
|
c6e7e2977f | ||
|
0c50ee124a | ||
|
f9cc403ebe | ||
|
659e41fe79 | ||
|
e2c69cd976 | ||
|
3830fb9769 | ||
|
5b82328bbd | ||
|
7c24f4fbc9 | ||
|
7feaf6c548 | ||
|
cf289ff969 | ||
|
38ac16dbff | ||
|
9adf6d9d7e | ||
|
34261b1084 | ||
|
a4189af168 | ||
|
29b1c19e6c | ||
|
540fa4ecd7 | ||
|
7b8c243ae5 | ||
|
287a776bed | ||
|
f5707aae3c | ||
|
a068671262 | ||
|
07a7306d81 | ||
|
9d05943813 | ||
|
32c596ef90 | ||
|
215b28f5df | ||
|
aef2c5cb70 | ||
|
da84a8ffe7 | ||
|
4b6b9e1889 | ||
|
7533fc00df | ||
|
00e217bf2e | ||
|
be08a23dc0 | ||
|
0be76e7ec1 | ||
|
2493985aae | ||
|
7e0055e4a0 | ||
|
d26843de8b | ||
|
e40dd33d1a | ||
|
a0771d809e | ||
|
7b0d367735 | ||
|
1ed9c24fb9 | ||
|
77127ce4ae | ||
|
0c9f8d3d05 | ||
|
93d28694ce | ||
|
c425166bc9 | ||
|
3d82b71516 | ||
|
1e2b6e131e | ||
|
d3095f5cf0 | ||
|
2c529a9ab9 | ||
|
89d94335e4 | ||
|
907c1bab60 | ||
|
2920e0d843 | ||
|
d39eafe93d | ||
|
5068d98157 | ||
|
6f0a7ae37b | ||
|
ca9c3ece53 | ||
|
efc5ecee9c | ||
|
f8fc9d4c09 | ||
|
0ffaf1002d | ||
|
331bc00d77 | ||
|
76ca02ff7b | ||
|
8b806828ad | ||
|
ef86acd25c | ||
|
b78272daa5 | ||
|
45cbab0442 | ||
|
718a8223ff | ||
|
b929e21fbe | ||
|
b312721d87 | ||
|
cbc697d2d6 | ||
|
533117777f | ||
|
f96b0d640b | ||
|
f857eed827 | ||
|
aab9d6df50 | ||
|
ca8af9c529 | ||
|
5346b6aac4 | ||
|
1cd83f0311 | ||
|
0dcd1ac226 | ||
|
265351f03f | ||
|
5eadf0d634 | ||
|
579a90e3c4 | ||
|
c4fac8fbbe | ||
|
218b619ab2 | ||
|
ebb13496c4 | ||
|
96202a0fab | ||
|
e5225e485d | ||
|
aaba210881 | ||
|
b465069b74 | ||
|
ae44b3365f | ||
|
f936ff8631 | ||
|
fffad80496 | ||
|
9c0b009335 | ||
|
df09d2a0ba | ||
|
6447169dee | ||
|
a5e133250f | ||
|
fdb6bb31af | ||
|
2613cd4b8d | ||
|
381ec467db | ||
|
9b60b2ecdc | ||
|
d9219c0ee6 | ||
|
965bdf7db2 | ||
|
bedc452f8b | ||
|
a9d2d3b0b7 | ||
|
9febc11af9 | ||
|
d29fe64c7e | ||
|
d9083cff8e | ||
|
52ab0ca9b0 | ||
|
ae7c0db4b3 | ||
|
b29e15e515 | ||
|
5949ead315 | ||
|
4046230c13 | ||
|
01345ad5e9 | ||
|
9fdb834853 | ||
|
2f286bfef5 | ||
|
d6accbe040 | ||
|
9b6b1445f7 | ||
|
85065859a2 | ||
|
5d41d82a6f | ||
|
33c3034765 | ||
|
ebc9a11318 | ||
|
40867789ec | ||
|
421e4d445a | ||
|
238b018789 | ||
|
d45ccc05f1 | ||
|
21753f734e | ||
|
2385ca720b | ||
|
fa4ad4f679 | ||
|
51ddb36a2d | ||
|
d630f852b9 | ||
|
0542f4ab03 | ||
|
1d33c5a2fc | ||
|
69c861ad58 | ||
|
e45737c9eb | ||
|
9f02b52ba2 | ||
|
f2d04b4fe9 | ||
|
e0bf9a7ea8 | ||
|
6993615047 | ||
|
8fb66e77e2 | ||
|
9b872cc3a5 | ||
|
721f054bae | ||
|
e8d1650625 | ||
|
c9f29c22b8 | ||
|
0d4b79d111 | ||
|
2096db8aad | ||
|
7decf4056e | ||
|
8ac563d157 | ||
|
8ab5ac0870 | ||
|
5694c04cdd | ||
|
8bae419dfe | ||
|
e1706c29c6 | ||
|
ccdebfb26a | ||
|
b39d53761c | ||
|
b674942ecc | ||
|
2e84b75047 | ||
|
431f07fcd9 | ||
|
46c9e8b811 | ||
|
0783dd7f7e | ||
|
2eba273314 | ||
|
7fb345d84a | ||
|
07a0e16324 | ||
|
a5191667d3 | ||
|
dea703ff2b | ||
|
53fe3ea095 | ||
|
276d23b4bc | ||
|
8cd82ee256 | ||
|
939a0cf876 | ||
|
c074592f3d | ||
|
63d75ac797 | ||
|
5e3b01c515 | ||
|
c7830bf873 | ||
|
e34284b7dc | ||
|
bad73e0959 | ||
|
888b4de9d4 | ||
|
5a1b1a0729 | ||
|
88b07e972b | ||
|
38fd735a72 | ||
|
3ae788a937 | ||
|
68998c0c9a | ||
|
8a53885999 | ||
|
c7fe963150 | ||
|
f6c77aa558 | ||
|
fe83982fa6 | ||
|
8939224350 | ||
|
3dd54edd12 | ||
|
7358faab52 | ||
|
100360a307 | ||
|
5634be6cb8 | ||
|
1e1b7661e2 | ||
|
f11afdbf9c | ||
|
ed6d83f01b | ||
|
12eb1548bd | ||
|
4a434c77fc | ||
|
c203721116 | ||
|
add1e87c4e | ||
|
2379bc19a8 | ||
|
99ce005b93 | ||
|
d71e9fcb15 | ||
|
5d8a4ce3c4 | ||
|
e07d4a02fe | ||
|
ff7e8aec04 | ||
|
001a5c73cc | ||
|
a1c167da48 | ||
|
acc3752a10 | ||
|
1fddd2dbeb | ||
|
e8ba43c8f8 | ||
|
f53d45cbb5 | ||
|
cfc3827890 | ||
|
ae85860679 | ||
|
0776767b15 | ||
|
5286bd22d8 | ||
|
de0c61c03b | ||
|
cbee0572ed | ||
|
c5f6ff9d3e | ||
|
a9a6fb2cf2 | ||
|
2324083fe9 | ||
|
08e22fff13 | ||
|
af570d37a7 | ||
|
a427a88f40 | ||
|
f8dc7e0d37 | ||
|
55d9bd1b64 | ||
|
692d9bce64 | ||
|
503440f0dc | ||
|
2af5c609be | ||
|
f335548405 | ||
|
9d020c5b52 | ||
|
936c5278de | ||
|
1eda70fb31 | ||
|
3bd963d88b | ||
|
7c75d83842 | ||
|
b7e08dbc06 | ||
|
f00600e1a3 | ||
|
68b25a57c1 | ||
|
6a69784335 | ||
|
3987237220 | ||
|
a6c2047ea0 | ||
|
8efeb7e3bf | ||
|
9a28aea2a2 | ||
|
30a980fb94 | ||
|
4f031f35fe | ||
|
df6dc532d2 | ||
|
c849ae36e0 | ||
|
b7fe949ab9 | ||
|
445892367a | ||
|
81b10bd0dd | ||
|
24d6489d0d | ||
|
b27d409cfd | ||
|
df84664032 | ||
|
357e3130ad | ||
|
247ecdcc05 | ||
|
72cc88d205 | ||
|
a27af70c1b | ||
|
424c960492 | ||
|
db3e06f76c | ||
|
353330c094 | ||
|
f1168c53ae | ||
|
62b00f70fd | ||
|
ff76add805 | ||
|
f48a3cffe7 | ||
|
a80f8a5ed0 | ||
|
5f5c562f00 | ||
|
653b560413 | ||
|
9a1ca294a8 | ||
|
252a858bc5 | ||
|
c519c37784 |
@@ -16,14 +16,26 @@ max_line_length = 78
|
||||
[{Makefile*,*.mk}]
|
||||
indent_style = tab
|
||||
|
||||
[*.py]
|
||||
[{*.py,SCons*}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.pl]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.m4]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.html]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.rst]
|
||||
indent_style = space
|
||||
indent_size = 3
|
||||
@@ -34,8 +46,3 @@ trim_trailing_whitespace = false
|
||||
[{meson.build,meson_options.txt}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
|
||||
[*.ps1]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
39
.github/workflows/ci.yml
vendored
39
.github/workflows/ci.yml
vendored
@@ -1,39 +0,0 @@
|
||||
name: CI
|
||||
on: push
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
CI:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cat > Brewfile <<EOL
|
||||
brew "bison"
|
||||
brew "expat"
|
||||
brew "gettext"
|
||||
brew "libx11"
|
||||
brew "libxcb"
|
||||
brew "libxdamage"
|
||||
brew "libxext"
|
||||
brew "meson"
|
||||
brew "pkg-config"
|
||||
brew "python@3.10"
|
||||
EOL
|
||||
|
||||
brew update
|
||||
brew bundle --verbose
|
||||
- name: Install Mako
|
||||
run: pip3 install --user mako
|
||||
- name: Configure
|
||||
run: meson . build -Dbuild-tests=true -Dosmesa=true
|
||||
- name: Build
|
||||
run: meson compile -C build
|
||||
- name: Test
|
||||
run: meson test -C build --print-errorlogs
|
||||
- name: Install
|
||||
run: meson install -C build
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.out
|
||||
/build
|
||||
build
|
||||
|
@@ -19,9 +19,7 @@ variables:
|
||||
# running on a particular CI farm (ie. for outages, etc):
|
||||
FD_FARM: "online"
|
||||
COLLABORA_FARM: "online"
|
||||
MICROSOFT_FARM: "online"
|
||||
LIMA_FARM: "online"
|
||||
IGALIA_FARM: "online"
|
||||
MICROSOFT_FARM: "offline"
|
||||
|
||||
default:
|
||||
before_script:
|
||||
@@ -38,12 +36,6 @@ default:
|
||||
export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
|
||||
rm "${CI_JOB_JWT_FILE}"
|
||||
|
||||
# Retry build or test jobs up to twice when the gitlab-runner itself fails somehow.
|
||||
retry:
|
||||
max: 2
|
||||
when:
|
||||
- runner_system_failure
|
||||
|
||||
include:
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: 34f4ade99434043f88e164933f570301fd18b125
|
||||
@@ -67,6 +59,7 @@ include:
|
||||
- local: 'src/gallium/drivers/crocus/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/d3d12/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/iris/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/nouveau/ci/gitlab-ci.yml'
|
||||
@@ -96,6 +89,12 @@ stages:
|
||||
- layered-backends
|
||||
- deploy
|
||||
|
||||
# Generic rule to not run the job during scheduled pipelines
|
||||
# ----------------------------------------------------------
|
||||
.scheduled_pipelines-rules:
|
||||
rules: &ignore_scheduled_pipelines
|
||||
if: &is-scheduled-pipeline '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
when: never
|
||||
|
||||
# YAML anchors for rule conditions
|
||||
# --------------------------------
|
||||
@@ -127,10 +126,10 @@ stages:
|
||||
.docs-base:
|
||||
extends:
|
||||
- .fdo.ci-fairy
|
||||
- .build-rules
|
||||
- .ci-run-policy
|
||||
script:
|
||||
- apk --no-cache add graphviz doxygen
|
||||
- pip3 install sphinx===5.1.1 breathe===4.34.0 mako===1.2.3 sphinx_rtd_theme===1.0.0
|
||||
- pip3 install sphinx breathe mako sphinx_rtd_theme
|
||||
- docs/doxygen-wrapper.py --out-dir=docs/doxygen_xml
|
||||
- sphinx-build -W -b html docs public
|
||||
|
||||
@@ -142,7 +141,7 @@ pages:
|
||||
- public
|
||||
needs: []
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: *is-mesa-main
|
||||
changes: &docs-or-ci
|
||||
- docs/**/*
|
||||
@@ -157,7 +156,7 @@ test-docs:
|
||||
stage: deploy
|
||||
needs: []
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: *is-forked-branch
|
||||
changes: *docs-or-ci
|
||||
when: manual
|
||||
@@ -178,10 +177,10 @@ test-docs-mr:
|
||||
when: on_success
|
||||
# Other cases default to never
|
||||
|
||||
# When to automatically run the CI for build jobs
|
||||
.build-rules:
|
||||
# When to automatically run the CI
|
||||
.ci-run-policy:
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
# If any files affecting the pipeline are changed, build/test jobs run
|
||||
# automatically once all dependency jobs have passed
|
||||
- changes: &all_paths
|
||||
@@ -201,7 +200,12 @@ test-docs-mr:
|
||||
- include/**/*
|
||||
- src/**/*
|
||||
when: on_success
|
||||
# Otherwise, build/test jobs won't run because no rule matched.
|
||||
# Otherwise, build/test jobs won't run
|
||||
- when: never
|
||||
retry:
|
||||
max: 2
|
||||
when:
|
||||
- runner_system_failure
|
||||
|
||||
|
||||
.ci-deqp-artifacts:
|
||||
@@ -217,8 +221,10 @@ test-docs-mr:
|
||||
- _build/meson-logs/strace
|
||||
|
||||
.container-rules:
|
||||
extends:
|
||||
- .ci-run-policy
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
# Run pipeline by default in the main project if any CI pipeline
|
||||
# configuration files were changed, to ensure docker images are up to date
|
||||
- if: *is-post-merge
|
||||
@@ -243,7 +249,8 @@ test-docs-mr:
|
||||
- changes:
|
||||
*all_paths
|
||||
when: manual
|
||||
# Otherwise, container jobs won't run because no rule matched.
|
||||
# Otherwise, container jobs won't run
|
||||
- when: never
|
||||
|
||||
# Git archive
|
||||
|
||||
@@ -252,7 +259,8 @@ make git archive:
|
||||
- .fdo.ci-fairy
|
||||
stage: git-archive
|
||||
rules:
|
||||
- !reference [.scheduled_pipeline-rules, rules]
|
||||
- if: *is-scheduled-pipeline
|
||||
when: on_success
|
||||
# ensure we are running on packet
|
||||
tags:
|
||||
- packet.net
|
||||
@@ -286,17 +294,34 @@ sanity:
|
||||
reports:
|
||||
junit: check-*.xml
|
||||
|
||||
# Rules for tests that should not block merging, but should be available to
|
||||
# optionally run with the "play" button in the UI in pre-merge non-marge
|
||||
# pipelines. This should appear in "extends:" after any includes of
|
||||
# test-source-dep.yml rules, so that these rules replace those.
|
||||
# Rules for tests that should not be present in MRs or the main
|
||||
# project's pipeline (don't block marge or report red on
|
||||
# mesa/mesa main) but should be present on pipelines in personal
|
||||
# branches (so you can opt in to running the flaky test when you want
|
||||
# to).
|
||||
.test-manual:
|
||||
rules:
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: *is-forked-branch
|
||||
changes:
|
||||
*all_paths
|
||||
when: manual
|
||||
- when: never
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
JOB_TIMEOUT: 80
|
||||
|
||||
# The above .test-manual rules doesn't allow the jobs to be available for MRs
|
||||
# but we should have an option to have manual jobs in MRs as well.
|
||||
.test-manual-mr:
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: *is-forked-branch-or-pre-merge-not-for-marge
|
||||
changes:
|
||||
*all_paths
|
||||
when: manual
|
||||
- when: never
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
JOB_TIMEOUT: 80
|
||||
|
||||
|
@@ -90,8 +90,7 @@ echo "$BM_CMDLINE" > /tftp/cmdline
|
||||
set +e
|
||||
python3 $BM/cros_servo_run.py \
|
||||
--cpu $BM_SERIAL \
|
||||
--ec $BM_SERIAL_EC \
|
||||
--test-timeout ${TEST_PHASE_TIMEOUT:-20}
|
||||
--ec $BM_SERIAL_EC
|
||||
ret=$?
|
||||
set -e
|
||||
|
||||
|
@@ -31,18 +31,52 @@ import threading
|
||||
|
||||
|
||||
class CrosServoRun:
|
||||
def __init__(self, cpu, ec, test_timeout):
|
||||
def __init__(self, cpu, ec):
|
||||
# Merged FIFO for the two serial buffers, fed by threads.
|
||||
self.serial_queue = queue.Queue()
|
||||
self.sentinel = object()
|
||||
self.threads_done = 0
|
||||
|
||||
self.ec_ser = SerialBuffer(
|
||||
ec, "results/serial-ec.txt", "R SERIAL-EC> ")
|
||||
self.cpu_ser = SerialBuffer(
|
||||
cpu, "results/serial.txt", "R SERIAL-CPU> ")
|
||||
# Merge the EC serial into the cpu_ser's line stream so that we can
|
||||
# effectively poll on both at the same time and not have to worry about
|
||||
self.ec_ser = SerialBuffer(
|
||||
ec, "results/serial-ec.txt", "R SERIAL-EC> ", line_queue=self.cpu_ser.line_queue)
|
||||
self.test_timeout = test_timeout
|
||||
|
||||
self.iter_feed_ec = threading.Thread(
|
||||
target=self.iter_feed_queue, daemon=True, args=(self.ec_ser.lines(),))
|
||||
self.iter_feed_ec.start()
|
||||
|
||||
self.iter_feed_cpu = threading.Thread(
|
||||
target=self.iter_feed_queue, daemon=True, args=(self.cpu_ser.lines(),))
|
||||
self.iter_feed_cpu.start()
|
||||
|
||||
def close(self):
|
||||
self.ec_ser.close()
|
||||
self.cpu_ser.close()
|
||||
self.iter_feed_ec.join()
|
||||
self.iter_feed_cpu.join()
|
||||
|
||||
# Feed lines from our serial queues into the merged queue, marking when our
|
||||
# input is done.
|
||||
def iter_feed_queue(self, it):
|
||||
for i in it:
|
||||
self.serial_queue.put(i)
|
||||
self.serial_queue.put(self.sentinel)
|
||||
|
||||
# Return the next line from the queue, counting how many threads have
|
||||
# terminated and joining when done
|
||||
def get_serial_queue_line(self):
|
||||
line = self.serial_queue.get()
|
||||
if line == self.sentinel:
|
||||
self.threads_done = self.threads_done + 1
|
||||
if self.threads_done == 2:
|
||||
self.iter_feed_cpu.join()
|
||||
self.iter_feed_ec.join()
|
||||
return line
|
||||
|
||||
# Returns an iterator for getting the next line.
|
||||
def serial_queue_lines(self):
|
||||
return iter(self.get_serial_queue_line, self.sentinel)
|
||||
|
||||
def ec_write(self, s):
|
||||
print("W SERIAL-EC> %s" % s)
|
||||
@@ -62,36 +96,23 @@ class CrosServoRun:
|
||||
self.ec_write("\n")
|
||||
self.ec_write("reboot\n")
|
||||
|
||||
bootloader_done = False
|
||||
# This is emitted right when the bootloader pauses to check for input.
|
||||
# Emit a ^N character to request network boot, because we don't have a
|
||||
# direct-to-netboot firmware on cheza.
|
||||
for line in self.cpu_ser.lines(timeout=120, phase="bootloader"):
|
||||
for line in self.serial_queue_lines():
|
||||
if re.search("load_archive: loading locale_en.bin", line):
|
||||
self.cpu_write("\016")
|
||||
bootloader_done = True
|
||||
break
|
||||
|
||||
# If the board has a netboot firmware and we made it to booting the
|
||||
# kernel, proceed to processing of the test run.
|
||||
if re.search("Booting Linux", line):
|
||||
bootloader_done = True
|
||||
break
|
||||
|
||||
# The Cheza boards have issues with failing to bring up power to
|
||||
# the system sometimes, possibly dependent on ambient temperature
|
||||
# in the farm.
|
||||
if re.search("POWER_GOOD not seen in time", line):
|
||||
self.print_error(
|
||||
"Detected intermittent poweron failure, restarting run...")
|
||||
self.print_error("Detected intermittent poweron failure, restarting run...")
|
||||
return 2
|
||||
|
||||
if not bootloader_done:
|
||||
print("Failed to make it through bootloader, restarting run...")
|
||||
return 2
|
||||
|
||||
tftp_failures = 0
|
||||
for line in self.cpu_ser.lines(timeout=self.test_timeout, phase="test"):
|
||||
for line in self.serial_queue_lines():
|
||||
if re.search("---. end Kernel panic", line):
|
||||
return 1
|
||||
|
||||
@@ -102,15 +123,13 @@ class CrosServoRun:
|
||||
if re.search("R8152: Bulk read error 0xffffffbf", line):
|
||||
tftp_failures += 1
|
||||
if tftp_failures >= 100:
|
||||
self.print_error(
|
||||
"Detected intermittent tftp failure, restarting run...")
|
||||
self.print_error("Detected intermittent tftp failure, restarting run...")
|
||||
return 2
|
||||
|
||||
# There are very infrequent bus errors during power management transitions
|
||||
# on cheza, which we don't expect to be the case on future boards.
|
||||
if re.search("Kernel panic - not syncing: Asynchronous SError Interrupt", line):
|
||||
self.print_error(
|
||||
"Detected cheza power management bus error, restarting run...")
|
||||
self.print_error("Detected cheza power management bus error, restarting run...")
|
||||
return 2
|
||||
|
||||
# If the network device dies, it's probably not graphics's fault, just try again.
|
||||
@@ -129,8 +148,7 @@ class CrosServoRun:
|
||||
# Given that it seems to trigger randomly near a GPU fault and then
|
||||
# break many tests after that, just restart the whole run.
|
||||
if re.search("a6xx_hfi_send_msg.*Unexpected message id .* on the response queue", line):
|
||||
self.print_error(
|
||||
"Detected cheza power management bus error, restarting run...")
|
||||
self.print_error("Detected cheza power management bus error, restarting run...")
|
||||
return 2
|
||||
|
||||
if re.search("coreboot.*bootblock starting", line):
|
||||
@@ -149,9 +167,8 @@ class CrosServoRun:
|
||||
else:
|
||||
return 1
|
||||
|
||||
self.print_error(
|
||||
"Reached the end of the CPU serial log without finding a result")
|
||||
return 2
|
||||
self.print_error("Reached the end of the CPU serial log without finding a result")
|
||||
return 1
|
||||
|
||||
|
||||
def main():
|
||||
@@ -160,11 +177,9 @@ def main():
|
||||
help='CPU Serial device', required=True)
|
||||
parser.add_argument(
|
||||
'--ec', type=str, help='EC Serial device', required=True)
|
||||
parser.add_argument(
|
||||
'--test-timeout', type=int, help='Test phase timeout (minutes)', required=True)
|
||||
args = parser.parse_args()
|
||||
|
||||
servo = CrosServoRun(args.cpu, args.ec, args.test_timeout * 60)
|
||||
servo = CrosServoRun(args.cpu, args.ec)
|
||||
|
||||
while True:
|
||||
retval = servo.run()
|
||||
|
@@ -133,7 +133,6 @@ fi
|
||||
set +e
|
||||
$BM/fastboot_run.py \
|
||||
--dev="$BM_SERIAL" \
|
||||
--test-timeout ${TEST_PHASE_TIMEOUT:-20} \
|
||||
--fbserial="$BM_FASTBOOT_SERIAL" \
|
||||
--powerup="$BM_POWERUP" \
|
||||
--powerdown="$BM_POWERDOWN"
|
||||
|
@@ -22,21 +22,19 @@
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
import os
|
||||
import re
|
||||
from serial_buffer import SerialBuffer
|
||||
import sys
|
||||
import threading
|
||||
|
||||
|
||||
class FastbootRun:
|
||||
def __init__(self, args, test_timeout):
|
||||
def __init__(self, args):
|
||||
self.powerup = args.powerup
|
||||
self.ser = SerialBuffer(
|
||||
args.dev, "results/serial-output.txt", "R SERIAL> ")
|
||||
self.fastboot = "fastboot boot -s {ser} artifacts/fastboot.img".format(
|
||||
ser=args.fbserial)
|
||||
self.test_timeout = test_timeout
|
||||
# We would like something like a 1 minute timeout, but the piglit traces
|
||||
# jobs stall out for long periods of time.
|
||||
self.ser = SerialBuffer(args.dev, "results/serial-output.txt", "R SERIAL> ", timeout=600)
|
||||
self.fastboot="fastboot boot -s {ser} artifacts/fastboot.img".format(ser=args.fbserial)
|
||||
|
||||
def close(self):
|
||||
self.ser.close()
|
||||
@@ -46,40 +44,34 @@ class FastbootRun:
|
||||
NO_COLOR = '\033[0m'
|
||||
print(RED + message + NO_COLOR)
|
||||
|
||||
def logged_system(self, cmd, timeout=60):
|
||||
def logged_system(self, cmd):
|
||||
print("Running '{}'".format(cmd))
|
||||
try:
|
||||
return subprocess.call(cmd, shell=True, timeout=timeout)
|
||||
except subprocess.TimeoutExpired:
|
||||
self.print_error("timeout, restarting run...")
|
||||
return 2
|
||||
return os.system(cmd)
|
||||
|
||||
def run(self):
|
||||
if ret := self.logged_system(self.powerup):
|
||||
return ret
|
||||
if self.logged_system(self.powerup) != 0:
|
||||
return 1
|
||||
|
||||
fastboot_ready = False
|
||||
for line in self.ser.lines(timeout=2 * 60, phase="bootloader"):
|
||||
for line in self.ser.lines():
|
||||
if re.search("fastboot: processing commands", line) or \
|
||||
re.search("Listening for fastboot command on", line):
|
||||
re.search("Listening for fastboot command on", line):
|
||||
fastboot_ready = True
|
||||
break
|
||||
|
||||
if re.search("data abort", line):
|
||||
self.print_error(
|
||||
"Detected crash during boot, restarting run...")
|
||||
self.print_error("Detected crash during boot, restarting run...")
|
||||
return 2
|
||||
|
||||
if not fastboot_ready:
|
||||
self.print_error(
|
||||
"Failed to get to fastboot prompt, restarting run...")
|
||||
self.print_error("Failed to get to fastboot prompt, restarting run...")
|
||||
return 2
|
||||
|
||||
if ret := self.logged_system(self.fastboot):
|
||||
return ret
|
||||
if self.logged_system(self.fastboot) != 0:
|
||||
return 1
|
||||
|
||||
print_more_lines = -1
|
||||
for line in self.ser.lines(timeout=self.test_timeout, phase="test"):
|
||||
for line in self.ser.lines():
|
||||
if print_more_lines == 0:
|
||||
return 2
|
||||
if print_more_lines > 0:
|
||||
@@ -91,8 +83,7 @@ class FastbootRun:
|
||||
# The db820c boards intermittently reboot. Just restart the run
|
||||
# when if we see a reboot after we got past fastboot.
|
||||
if re.search("PON REASON", line):
|
||||
self.print_error(
|
||||
"Detected spontaneous reboot, restarting run...")
|
||||
self.print_error("Detected spontaneous reboot, restarting run...")
|
||||
return 2
|
||||
|
||||
# db820c sometimes wedges around iommu fault recovery
|
||||
@@ -126,26 +117,18 @@ class FastbootRun:
|
||||
else:
|
||||
return 1
|
||||
|
||||
self.print_error(
|
||||
"Reached the end of the CPU serial log without finding a result, restarting run...")
|
||||
self.print_error("Reached the end of the CPU serial log without finding a result, restarting run...")
|
||||
return 2
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'--dev', type=str, help='Serial device (otherwise reading from serial-output.txt)')
|
||||
parser.add_argument('--powerup', type=str,
|
||||
help='shell command for rebooting', required=True)
|
||||
parser.add_argument('--powerdown', type=str,
|
||||
help='shell command for powering off', required=True)
|
||||
parser.add_argument('--fbserial', type=str,
|
||||
help='fastboot serial number of the board', required=True)
|
||||
parser.add_argument('--test-timeout', type=int,
|
||||
help='Test phase timeout (minutes)', required=True)
|
||||
parser.add_argument('--dev', type=str, help='Serial device (otherwise reading from serial-output.txt)')
|
||||
parser.add_argument('--powerup', type=str, help='shell command for rebooting', required=True)
|
||||
parser.add_argument('--powerdown', type=str, help='shell command for powering off', required=True)
|
||||
parser.add_argument('--fbserial', type=str, help='fastboot serial number of the board', required=True)
|
||||
args = parser.parse_args()
|
||||
|
||||
fastboot = FastbootRun(args, args.test_timeout * 60)
|
||||
fastboot = FastbootRun(args)
|
||||
|
||||
while True:
|
||||
retval = fastboot.run()
|
||||
@@ -153,12 +136,11 @@ def main():
|
||||
if retval != 2:
|
||||
break
|
||||
|
||||
fastboot = FastbootRun(args, args.test_timeout * 60)
|
||||
fastboot = FastbootRun(args)
|
||||
|
||||
fastboot.logged_system(args.powerdown)
|
||||
|
||||
sys.exit(retval)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@@ -8,8 +8,8 @@ relay = sys.argv[2]
|
||||
|
||||
# our relays are "off" means "board is powered".
|
||||
mode_swap = {
|
||||
"on": "off",
|
||||
"off": "on",
|
||||
"on" : "off",
|
||||
"off" : "on",
|
||||
}
|
||||
mode = mode_swap[mode]
|
||||
|
||||
|
@@ -131,7 +131,7 @@ while [ $((ATTEMPTS--)) -gt 0 ]; do
|
||||
--dev="$BM_SERIAL" \
|
||||
--powerup="$BM_POWERUP" \
|
||||
--powerdown="$BM_POWERDOWN" \
|
||||
--test-timeout ${TEST_PHASE_TIMEOUT:-20}
|
||||
--timeout="${BM_POE_TIMEOUT:-60}"
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 2 ]; then
|
||||
|
@@ -28,14 +28,11 @@ from serial_buffer import SerialBuffer
|
||||
import sys
|
||||
import threading
|
||||
|
||||
|
||||
class PoERun:
|
||||
def __init__(self, args, test_timeout):
|
||||
def __init__(self, args):
|
||||
self.powerup = args.powerup
|
||||
self.powerdown = args.powerdown
|
||||
self.ser = SerialBuffer(
|
||||
args.dev, "results/serial-output.txt", "")
|
||||
self.test_timeout = test_timeout
|
||||
self.ser = SerialBuffer(args.dev, "results/serial-output.txt", "", args.timeout)
|
||||
|
||||
def print_error(self, message):
|
||||
RED = '\033[0;31m'
|
||||
@@ -51,17 +48,16 @@ class PoERun:
|
||||
return 1
|
||||
|
||||
boot_detected = False
|
||||
for line in self.ser.lines(timeout=5 * 60, phase="bootloader"):
|
||||
for line in self.ser.lines():
|
||||
if re.search("Booting Linux", line):
|
||||
boot_detected = True
|
||||
break
|
||||
|
||||
if not boot_detected:
|
||||
self.print_error(
|
||||
"Something wrong; couldn't detect the boot start up sequence")
|
||||
self.print_error("Something wrong; couldn't detect the boot start up sequence")
|
||||
return 2
|
||||
|
||||
for line in self.ser.lines(timeout=self.test_timeout, phase="test"):
|
||||
for line in self.ser.lines():
|
||||
if re.search("---. end Kernel panic", line):
|
||||
return 1
|
||||
|
||||
@@ -81,30 +77,24 @@ class PoERun:
|
||||
else:
|
||||
return 1
|
||||
|
||||
self.print_error(
|
||||
"Reached the end of the CPU serial log without finding a result")
|
||||
self.print_error("Reached the end of the CPU serial log without finding a result")
|
||||
return 2
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--dev', type=str,
|
||||
help='Serial device to monitor', required=True)
|
||||
parser.add_argument('--powerup', type=str,
|
||||
help='shell command for rebooting', required=True)
|
||||
parser.add_argument('--powerdown', type=str,
|
||||
help='shell command for powering off', required=True)
|
||||
parser.add_argument(
|
||||
'--test-timeout', type=int, help='Test phase timeout (minutes)', required=True)
|
||||
parser.add_argument('--dev', type=str, help='Serial device to monitor', required=True)
|
||||
parser.add_argument('--powerup', type=str, help='shell command for rebooting', required=True)
|
||||
parser.add_argument('--powerdown', type=str, help='shell command for powering off', required=True)
|
||||
parser.add_argument('--timeout', type=int, default=60,
|
||||
help='time in seconds to wait for activity', required=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
poe = PoERun(args, args.test_timeout * 60)
|
||||
poe = PoERun(args)
|
||||
retval = poe.run()
|
||||
|
||||
poe.logged_system(args.powerdown)
|
||||
|
||||
sys.exit(retval)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@@ -28,9 +28,8 @@ import serial
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
class SerialBuffer:
|
||||
def __init__(self, dev, filename, prefix, timeout=None, line_queue=None):
|
||||
def __init__(self, dev, filename, prefix, timeout = None):
|
||||
self.filename = filename
|
||||
self.dev = dev
|
||||
|
||||
@@ -42,13 +41,7 @@ class SerialBuffer:
|
||||
self.serial = None
|
||||
|
||||
self.byte_queue = queue.Queue()
|
||||
# allow multiple SerialBuffers to share a line queue so you can merge
|
||||
# servo's CPU and EC streams into one thing to watch the boot/test
|
||||
# progress on.
|
||||
if line_queue:
|
||||
self.line_queue = line_queue
|
||||
else:
|
||||
self.line_queue = queue.Queue()
|
||||
self.line_queue = queue.Queue()
|
||||
self.prefix = prefix
|
||||
self.timeout = timeout
|
||||
self.sentinel = object()
|
||||
@@ -137,30 +130,14 @@ class SerialBuffer:
|
||||
self.line_queue.put(line)
|
||||
line = bytearray()
|
||||
|
||||
def lines(self, timeout=None, phase=None):
|
||||
start_time = time.monotonic()
|
||||
while True:
|
||||
read_timeout = None
|
||||
if timeout:
|
||||
read_timeout = timeout - (time.monotonic() - start_time)
|
||||
if read_timeout <= 0:
|
||||
print("read timeout waiting for serial during {}".format(phase))
|
||||
self.close()
|
||||
break
|
||||
def get_line(self):
|
||||
line = self.line_queue.get()
|
||||
if line == self.sentinel:
|
||||
self.lines_thread.join()
|
||||
return line
|
||||
|
||||
try:
|
||||
line = self.line_queue.get(timeout=read_timeout)
|
||||
except queue.Empty:
|
||||
print("read timeout waiting for serial during {}".format(phase))
|
||||
self.close()
|
||||
break
|
||||
|
||||
if line == self.sentinel:
|
||||
print("End of serial output")
|
||||
self.lines_thread.join()
|
||||
break
|
||||
|
||||
yield line
|
||||
def lines(self):
|
||||
return iter(self.get_line, self.sentinel)
|
||||
|
||||
|
||||
def main():
|
||||
|
@@ -28,8 +28,8 @@
|
||||
import sys
|
||||
import telnetlib
|
||||
|
||||
host = sys.argv[1]
|
||||
port = sys.argv[2]
|
||||
host=sys.argv[1]
|
||||
port=sys.argv[2]
|
||||
|
||||
tn = telnetlib.Telnet(host, port, 1000000)
|
||||
|
||||
|
@@ -1,303 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright © 2020 - 2022 Collabora Ltd.
|
||||
# Authors:
|
||||
# Tomeu Vizoso <tomeu.vizoso@collabora.com>
|
||||
# David Heidelberg <david.heidelberg@collabora.com>
|
||||
#
|
||||
# TODO GraphQL for dependencies
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
Helper script to restrict running only required CI jobs
|
||||
and show the job(s) logs.
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
from functools import partial
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
import argparse
|
||||
import sys
|
||||
import gitlab
|
||||
|
||||
from colorama import Fore, Style
|
||||
|
||||
REFRESH_WAIT_LOG = 10
|
||||
REFRESH_WAIT_JOBS = 6
|
||||
|
||||
URL_START = "\033]8;;"
|
||||
URL_END = "\033]8;;\a"
|
||||
|
||||
STATUS_COLORS = {
|
||||
"created": "",
|
||||
"running": Fore.BLUE,
|
||||
"success": Fore.GREEN,
|
||||
"failed": Fore.RED,
|
||||
"canceled": Fore.MAGENTA,
|
||||
"manual": "",
|
||||
"pending": "",
|
||||
"skipped": "",
|
||||
}
|
||||
|
||||
# TODO: This hardcoded list should be replaced by querying the pipeline's
|
||||
# dependency graph to see which jobs the target jobs need
|
||||
DEPENDENCIES = [
|
||||
"debian/x86_build-base",
|
||||
"debian/x86_build",
|
||||
"debian/x86_test-base",
|
||||
"debian/x86_test-gl",
|
||||
"debian/arm_build",
|
||||
"debian/arm_test",
|
||||
"kernel+rootfs_amd64",
|
||||
"kernel+rootfs_arm64",
|
||||
"kernel+rootfs_armhf",
|
||||
"debian-testing",
|
||||
"debian-arm64",
|
||||
]
|
||||
|
||||
COMPLETED_STATUSES = ["success", "failed"]
|
||||
|
||||
|
||||
def get_gitlab_project(glab, name: str):
|
||||
"""Finds a specified gitlab project for given user"""
|
||||
glab.auth()
|
||||
username = glab.user.username
|
||||
return glab.projects.get(f"{username}/mesa")
|
||||
|
||||
|
||||
def wait_for_pipeline(project, sha: str):
|
||||
"""await until pipeline appears in Gitlab"""
|
||||
print("⏲ for the pipeline to appear..", end="")
|
||||
while True:
|
||||
pipelines = project.pipelines.list(sha=sha)
|
||||
if pipelines:
|
||||
print("", flush=True)
|
||||
return pipelines[0]
|
||||
print("", end=".", flush=True)
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def print_job_status(job) -> None:
|
||||
"""It prints a nice, colored job status with a link to the job."""
|
||||
if job.status == "canceled":
|
||||
return
|
||||
|
||||
print(
|
||||
STATUS_COLORS[job.status]
|
||||
+ "🞋 job "
|
||||
+ URL_START
|
||||
+ f"{job.web_url}\a{job.name}"
|
||||
+ URL_END
|
||||
+ f" :: {job.status}"
|
||||
+ Style.RESET_ALL
|
||||
)
|
||||
|
||||
|
||||
def print_job_status_change(job) -> None:
|
||||
"""It reports job status changes."""
|
||||
if job.status == "canceled":
|
||||
return
|
||||
|
||||
print(
|
||||
STATUS_COLORS[job.status]
|
||||
+ "🗘 job "
|
||||
+ URL_START
|
||||
+ f"{job.web_url}\a{job.name}"
|
||||
+ URL_END
|
||||
+ f" has new status: {job.status}"
|
||||
+ Style.RESET_ALL
|
||||
)
|
||||
|
||||
|
||||
def pretty_wait(sec: int) -> None:
|
||||
"""shows progressbar in dots"""
|
||||
for val in range(sec, 0, -1):
|
||||
print(f"⏲ {val} seconds", end="\r")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def monitor_pipeline(
|
||||
project, pipeline, target_job: Optional[str], dependencies, force_manual: bool
|
||||
) -> tuple[Optional[int], Optional[int]]:
|
||||
"""Monitors pipeline and delegate canceling jobs"""
|
||||
statuses = {}
|
||||
target_statuses = {}
|
||||
|
||||
if not dependencies:
|
||||
dependencies = []
|
||||
dependencies.extend(DEPENDENCIES)
|
||||
|
||||
if target_job:
|
||||
target_jobs_regex = re.compile(target_job.strip())
|
||||
|
||||
while True:
|
||||
to_cancel = []
|
||||
for job in pipeline.jobs.list(all=True, sort="desc"):
|
||||
# target jobs
|
||||
if target_job and target_jobs_regex.match(job.name):
|
||||
if force_manual and job.status == "manual":
|
||||
enable_job(project, job, True)
|
||||
|
||||
if (job.id not in target_statuses) or (
|
||||
job.status not in target_statuses[job.id]
|
||||
):
|
||||
print_job_status_change(job)
|
||||
target_statuses[job.id] = job.status
|
||||
else:
|
||||
print_job_status(job)
|
||||
|
||||
continue
|
||||
|
||||
# all jobs
|
||||
if (job.id not in statuses) or (job.status not in statuses[job.id]):
|
||||
print_job_status_change(job)
|
||||
statuses[job.id] = job.status
|
||||
|
||||
# dependencies and cancelling the rest
|
||||
if job.name in dependencies:
|
||||
if job.status == "manual":
|
||||
enable_job(project, job, False)
|
||||
|
||||
elif target_job and job.status not in [
|
||||
"canceled",
|
||||
"success",
|
||||
"failed",
|
||||
"skipped",
|
||||
]:
|
||||
to_cancel.append(job)
|
||||
|
||||
if target_job:
|
||||
cancel_jobs(project, to_cancel)
|
||||
|
||||
print("---------------------------------", flush=False)
|
||||
|
||||
if len(target_statuses) == 1 and {"running"}.intersection(
|
||||
target_statuses.values()
|
||||
):
|
||||
return next(iter(target_statuses)), None
|
||||
|
||||
if {"failed", "canceled"}.intersection(target_statuses.values()):
|
||||
return None, 1
|
||||
|
||||
if {"success", "manual"}.issuperset(target_statuses.values()):
|
||||
return None, 0
|
||||
|
||||
pretty_wait(REFRESH_WAIT_JOBS)
|
||||
|
||||
|
||||
def enable_job(project, job, target: bool) -> None:
|
||||
"""enable manual job"""
|
||||
pjob = project.jobs.get(job.id, lazy=True)
|
||||
pjob.play()
|
||||
if target:
|
||||
jtype = "🞋 "
|
||||
else:
|
||||
jtype = "(dependency)"
|
||||
print(Fore.MAGENTA + f"{jtype} job {job.name} manually enabled" + Style.RESET_ALL)
|
||||
|
||||
|
||||
def cancel_job(project, job) -> None:
|
||||
"""Cancel GitLab job"""
|
||||
pjob = project.jobs.get(job.id, lazy=True)
|
||||
pjob.cancel()
|
||||
print(f"♲ {job.name}")
|
||||
|
||||
|
||||
def cancel_jobs(project, to_cancel) -> None:
|
||||
"""Cancel unwanted GitLab jobs"""
|
||||
if not to_cancel:
|
||||
return
|
||||
|
||||
with ThreadPoolExecutor(max_workers=6) as exe:
|
||||
part = partial(cancel_job, project)
|
||||
exe.map(part, to_cancel)
|
||||
|
||||
|
||||
def print_log(project, job_id) -> None:
|
||||
"""Print job log into output"""
|
||||
printed_lines = 0
|
||||
while True:
|
||||
job = project.jobs.get(job_id)
|
||||
|
||||
# GitLab's REST API doesn't offer pagination for logs, so we have to refetch it all
|
||||
lines = job.trace().decode("unicode_escape").splitlines()
|
||||
for line in lines[printed_lines:]:
|
||||
print(line)
|
||||
printed_lines = len(lines)
|
||||
|
||||
if job.status in COMPLETED_STATUSES:
|
||||
print(Fore.GREEN + f"Job finished: {job.web_url}" + Style.RESET_ALL)
|
||||
return
|
||||
pretty_wait(REFRESH_WAIT_LOG)
|
||||
|
||||
|
||||
def parse_args() -> None:
|
||||
"""Parse args"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Tool to trigger a subset of container jobs "
|
||||
+ "and monitor the progress of a test job",
|
||||
epilog="Example: mesa-monitor.py --rev $(git rev-parse HEAD) "
|
||||
+ '--target ".*traces" ',
|
||||
)
|
||||
parser.add_argument("--target", metavar="target-job", help="Target job")
|
||||
parser.add_argument("--deps", nargs="+", help="Job dependencies")
|
||||
parser.add_argument(
|
||||
"--rev", metavar="revision", help="repository git revision", required=True
|
||||
)
|
||||
parser.add_argument(
|
||||
"--token",
|
||||
metavar="token",
|
||||
help="force GitLab token, otherwise it's read from ~/.config/gitlab-token",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--force-manual", action="store_true", help="Force jobs marked as manual"
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def read_token(token_arg: Optional[str]) -> str:
|
||||
"""pick token from args or file"""
|
||||
if token_arg:
|
||||
return token_arg
|
||||
return (
|
||||
open(os.path.expanduser("~/.config/gitlab-token"), encoding="utf-8")
|
||||
.readline()
|
||||
.rstrip()
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
t_start = time.perf_counter()
|
||||
|
||||
args = parse_args()
|
||||
|
||||
token = read_token(args.token)
|
||||
|
||||
gl = gitlab.Gitlab(url="https://gitlab.freedesktop.org", private_token=token)
|
||||
|
||||
cur_project = get_gitlab_project(gl, "mesa")
|
||||
|
||||
print(f"Revision: {args.rev}")
|
||||
pipe = wait_for_pipeline(cur_project, args.rev)
|
||||
print(f"Pipeline: {pipe.web_url}")
|
||||
if args.target:
|
||||
print("🞋 job: " + Fore.BLUE + args.target + Style.RESET_ALL)
|
||||
print(f"Extra dependencies: {args.deps}")
|
||||
target_job_id, ret = monitor_pipeline(
|
||||
cur_project, pipe, args.target, args.deps, args.force_manual
|
||||
)
|
||||
|
||||
if target_job_id:
|
||||
print_log(cur_project, target_job_id)
|
||||
|
||||
t_end = time.perf_counter()
|
||||
spend_minutes = (t_end - t_start) / 60
|
||||
print(f"⏲ Duration of script execution: {spend_minutes:0.1f} minutes")
|
||||
|
||||
sys.exit(ret)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
@@ -1,2 +0,0 @@
|
||||
colorama==0.4.5
|
||||
python-gitlab==3.5.0
|
@@ -1,6 +1,6 @@
|
||||
# Shared between windows and Linux
|
||||
.build-common:
|
||||
extends: .build-rules
|
||||
extends: .ci-run-policy
|
||||
# Cancel job if a newer commit is pushed to the same branch
|
||||
interruptible: true
|
||||
artifacts:
|
||||
@@ -37,7 +37,7 @@
|
||||
tags:
|
||||
- windows
|
||||
- docker
|
||||
- "2022"
|
||||
- "1809"
|
||||
- mesa
|
||||
cache:
|
||||
key: ${CI_JOB_NAME}
|
||||
@@ -54,15 +54,6 @@
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
|
||||
.meson-build_mingw:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .use-debian/x86_build_mingw
|
||||
- .use-wine
|
||||
stage: build-x86_64
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
|
||||
debian-testing:
|
||||
extends:
|
||||
- .meson-build
|
||||
@@ -81,10 +72,8 @@ debian-testing:
|
||||
VULKAN_DRIVERS: "swrast,amd,intel"
|
||||
BUILDTYPE: "debugoptimized"
|
||||
EXTRA_OPTION: >
|
||||
-D spirv-to-dxil=true
|
||||
-D valgrind=false
|
||||
MINIO_ARTIFACT_NAME: mesa-amd64
|
||||
LLVM_VERSION: "13"
|
||||
script:
|
||||
- .gitlab-ci/lava/lava-pytest.sh
|
||||
- .gitlab-ci/meson/build.sh
|
||||
@@ -167,7 +156,6 @@ debian-gallium:
|
||||
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,asahi,crocus"
|
||||
VULKAN_DRIVERS: swrast
|
||||
EXTRA_OPTION: >
|
||||
-D spirv-to-dxil=true
|
||||
-D osmesa=true
|
||||
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,xvmc,lima,panfrost,asahi
|
||||
script:
|
||||
@@ -196,10 +184,9 @@ debian-release:
|
||||
-D gallium-opencl=disabled
|
||||
-D llvm=enabled
|
||||
GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,crocus"
|
||||
VULKAN_DRIVERS: "amd,imagination-experimental,microsoft-experimental"
|
||||
VULKAN_DRIVERS: "amd,imagination-experimental"
|
||||
BUILDTYPE: "release"
|
||||
EXTRA_OPTION: >
|
||||
-D spirv-to-dxil=true
|
||||
-D osmesa=true
|
||||
-D tools=all
|
||||
-D intel-clc=enabled
|
||||
@@ -215,6 +202,7 @@ fedora-release:
|
||||
BUILDTYPE: "release"
|
||||
C_ARGS: >
|
||||
-Wno-error=array-bounds
|
||||
-Wno-error=maybe-uninitialized
|
||||
-Wno-error=stringop-overread
|
||||
-Wno-error=uninitialized
|
||||
CPP_ARGS: >
|
||||
@@ -329,7 +317,7 @@ debian-android:
|
||||
- debian/arm_build
|
||||
variables:
|
||||
VULKAN_DRIVERS: freedreno,broadcom
|
||||
GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4,zink"
|
||||
GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4"
|
||||
BUILDTYPE: "debugoptimized"
|
||||
tags:
|
||||
- aarch64
|
||||
@@ -412,9 +400,8 @@ debian-clang:
|
||||
DRI_LOADERS: >
|
||||
-D glvnd=true
|
||||
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus,i915,asahi"
|
||||
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,swrast,panfrost,imagination-experimental,microsoft-experimental
|
||||
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,swrast,panfrost,imagination-experimental
|
||||
EXTRA_OPTIONS:
|
||||
-D spirv-to-dxil=true
|
||||
-D imagination-srv=true
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
@@ -426,7 +413,7 @@ windows-vs2019:
|
||||
- .windows-build-rules
|
||||
stage: build-misc
|
||||
script:
|
||||
- pwsh -ExecutionPolicy RemoteSigned .\.gitlab-ci\windows\mesa_build.ps1
|
||||
- . .\.gitlab-ci\windows\mesa_build.ps1
|
||||
artifacts:
|
||||
paths:
|
||||
- _build/meson-logs/*.txt
|
||||
@@ -479,7 +466,7 @@ debian-vulkan:
|
||||
-D c_args=-fno-sanitize-recover=all
|
||||
-D cpp_args=-fno-sanitize-recover=all
|
||||
UBSAN_OPTIONS: "print_stacktrace=1"
|
||||
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,imagination-experimental,microsoft-experimental
|
||||
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,imagination-experimental
|
||||
EXTRA_OPTION: >
|
||||
-D vulkan-layers=device-select,overlay
|
||||
-D build-aco-tests=true
|
||||
@@ -522,40 +509,17 @@ debian-ppc64el:
|
||||
VULKAN_DRIVERS: "amd,swrast"
|
||||
|
||||
debian-mingw32-x86_64:
|
||||
extends: .meson-build_mingw
|
||||
extends: .meson-build
|
||||
stage: build-misc
|
||||
variables:
|
||||
UNWIND: "disabled"
|
||||
C_ARGS: >
|
||||
-Wno-error=format
|
||||
-Wno-error=format-extra-args
|
||||
-Wno-error=deprecated-declarations
|
||||
-Wno-error=unused-function
|
||||
-Wno-error=unused-variable
|
||||
-Wno-error=unused-but-set-variable
|
||||
-Wno-error=unused-value
|
||||
-Wno-error=switch
|
||||
-Wno-error=parentheses
|
||||
-Wno-error=missing-prototypes
|
||||
-Wno-error=sign-compare
|
||||
-Wno-error=narrowing
|
||||
-Wno-error=overflow
|
||||
CPP_ARGS: $C_ARGS
|
||||
GALLIUM_DRIVERS: "swrast,d3d12,zink"
|
||||
VULKAN_DRIVERS: "swrast,amd,microsoft-experimental"
|
||||
GALLIUM_ST: >
|
||||
-D gallium-opencl=icd
|
||||
-D opencl-native=false
|
||||
-D opencl-spirv=true
|
||||
-D microsoft-clc=enabled
|
||||
-D static-libclc=all
|
||||
-D llvm=enabled
|
||||
GALLIUM_DRIVERS: "swrast"
|
||||
EXTRA_OPTION: >
|
||||
-D spirv-to-dxil=true
|
||||
-D gles1=enabled
|
||||
-D gles2=enabled
|
||||
-D osmesa=true
|
||||
-D cpp_rtti=true
|
||||
-D shared-glapi=enabled
|
||||
-D zlib=enabled
|
||||
-Dllvm=disabled
|
||||
-Dzlib=disabled
|
||||
-Dosmesa=true
|
||||
--cross-file=.gitlab-ci/x86_64-w64-mingw32
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
for var in \
|
||||
ACO_DEBUG \
|
||||
ASAN_OPTIONS \
|
||||
BASE_SYSTEM_FORK_HOST_PREFIX \
|
||||
BASE_SYSTEM_MAINLINE_HOST_PREFIX \
|
||||
@@ -81,7 +80,6 @@ for var in \
|
||||
MESA_IMAGE \
|
||||
MESA_IMAGE_PATH \
|
||||
MESA_IMAGE_TAG \
|
||||
MESA_LOADER_DRIVER_OVERRIDE \
|
||||
MESA_TEMPLATES_COMMIT \
|
||||
MESA_VK_IGNORE_CONFORMANCE_WARNING \
|
||||
MESA_SPIRV_LOG_LEVEL \
|
||||
@@ -105,8 +103,6 @@ for var in \
|
||||
PIGLIT_RESULTS \
|
||||
PIGLIT_TESTS \
|
||||
PIPELINE_ARTIFACTS_BASE \
|
||||
RADV_DEBUG \
|
||||
RADV_PERFTEST \
|
||||
SKQP_ASSETS_DIR \
|
||||
SKQP_BACKENDS \
|
||||
TU_DEBUG \
|
||||
@@ -114,7 +110,6 @@ for var in \
|
||||
VK_CPU \
|
||||
VK_DRIVER \
|
||||
VK_ICD_FILENAMES \
|
||||
VKD3D_PROTON_RESULTS \
|
||||
; do
|
||||
if [ -n "${!var+x}" ]; then
|
||||
echo "export $var=${!var@Q}"
|
||||
|
@@ -1,38 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Make sure to kill itself and all the children process from this script on
|
||||
# exiting, since any console output may interfere with LAVA signals handling,
|
||||
# which based on the log console.
|
||||
cleanup() {
|
||||
if [ "$BACKGROUND_PIDS" = "" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
set +x
|
||||
echo "Killing all child processes"
|
||||
for pid in $BACKGROUND_PIDS
|
||||
do
|
||||
kill "$pid" 2>/dev/null || true
|
||||
done
|
||||
|
||||
# Sleep just a little to give enough time for subprocesses to be gracefully
|
||||
# killed. Then apply a SIGKILL if necessary.
|
||||
sleep 5
|
||||
for pid in $BACKGROUND_PIDS
|
||||
do
|
||||
kill -9 "$pid" 2>/dev/null || true
|
||||
done
|
||||
|
||||
BACKGROUND_PIDS=
|
||||
set -x
|
||||
}
|
||||
trap cleanup INT TERM EXIT
|
||||
|
||||
# Space separated values with the PIDS of the processes started in the
|
||||
# background by this script
|
||||
BACKGROUND_PIDS=
|
||||
|
||||
|
||||
# Second-stage init, used to set up devices and our job environment before
|
||||
# running tests.
|
||||
|
||||
@@ -93,11 +60,10 @@ if [ "$HWCI_FREQ_MAX" = "true" ]; then
|
||||
# Disable GPU runtime power management
|
||||
GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1`
|
||||
test -z "$GPU_AUTOSUSPEND" || echo -1 > $GPU_AUTOSUSPEND || true
|
||||
|
||||
# Lock Intel GPU frequency to 70% of the maximum allowed by hardware
|
||||
# and enable throttling detection & reporting.
|
||||
# Additionally, set the upper limit for CPU scaling frequency to 65% of the
|
||||
# maximum permitted, as an additional measure to mitigate thermal throttling.
|
||||
./intel-gpu-freq.sh -s 70% --cpu-set-max 65% -g all -d
|
||||
./intel-gpu-freq.sh -s 70% -g all -d
|
||||
fi
|
||||
|
||||
# Increase freedreno hangcheck timer because it's right at the edge of the
|
||||
@@ -108,8 +74,7 @@ fi
|
||||
|
||||
# Start a little daemon to capture the first devcoredump we encounter. (They
|
||||
# expire after 5 minutes, so we poll for them).
|
||||
/capture-devcoredump.sh &
|
||||
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
|
||||
./capture-devcoredump.sh &
|
||||
|
||||
# If we want Xorg to be running for the test, then we start it up before the
|
||||
# HWCI_TEST_SCRIPT because we need to use xinit to start X (otherwise
|
||||
@@ -119,7 +84,6 @@ if [ -n "$HWCI_START_XORG" ]; then
|
||||
echo "touch /xorg-started; sleep 100000" > /xorg-script
|
||||
env \
|
||||
xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log &
|
||||
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
|
||||
|
||||
# Wait for xorg to be ready for connections.
|
||||
for i in 1 2 3 4 5; do
|
||||
@@ -131,21 +95,12 @@ if [ -n "$HWCI_START_XORG" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
|
||||
RESULT=fail
|
||||
set +e
|
||||
sh -c "$HWCI_TEST_SCRIPT"
|
||||
EXIT_CODE=$?
|
||||
set -e
|
||||
sh -c "$HWCI_TEST_SCRIPT" && RESULT=pass || RESULT=fail
|
||||
|
||||
# Let's make sure the results are always stored in current working directory
|
||||
mv -f ${CI_PROJECT_DIR}/results ./ 2>/dev/null || true
|
||||
|
||||
[ ${EXIT_CODE} -ne 0 ] || rm -rf results/trace/"$PIGLIT_REPLAY_DEVICE_NAME"
|
||||
|
||||
# Make sure that capture-devcoredump is done before we start trying to tar up
|
||||
# artifacts -- if it's writing while tar is reading, tar will throw an error and
|
||||
# kill the job.
|
||||
cleanup
|
||||
[ "${RESULT}" = "fail" ] || rm -rf results/trace/$PIGLIT_REPLAY_DEVICE_NAME
|
||||
|
||||
# upload artifacts
|
||||
if [ -n "$MINIO_RESULTS_UPLOAD" ]; then
|
||||
@@ -154,12 +109,4 @@ if [ -n "$MINIO_RESULTS_UPLOAD" ]; then
|
||||
ci-fairy minio cp results.tar.gz minio://"$MINIO_RESULTS_UPLOAD"/results.tar.gz;
|
||||
fi
|
||||
|
||||
# We still need to echo the hwci: mesa message, as some scripts rely on it, such
|
||||
# as the python ones inside the bare-metal folder
|
||||
[ ${EXIT_CODE} -eq 0 ] && RESULT=pass
|
||||
|
||||
set +x
|
||||
echo "hwci: mesa: $RESULT"
|
||||
# Sleep a bit to avoid kernel dump message interleave from LAVA ENDTC signal
|
||||
sleep 1
|
||||
exit $EXIT_CODE
|
||||
|
@@ -1,15 +1,8 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This is an utility script to manage Intel GPU frequencies.
|
||||
# It can be used for debugging performance problems or trying to obtain a stable
|
||||
# frequency while benchmarking.
|
||||
#
|
||||
# Note the Intel i915 GPU driver allows to change the minimum, maximum and boost
|
||||
# frequencies in steps of 50 MHz via:
|
||||
#
|
||||
# /sys/class/drm/card<n>/<freq_info>
|
||||
#
|
||||
# Where <n> is the DRM card index and <freq_info> one of the following:
|
||||
# The Intel i915 GPU driver allows to change the minimum, maximum and boost
|
||||
# frequencies in steps of 50 MHz via /sys/class/drm/card<n>/<freq_info>,
|
||||
# where <n> is the DRM card index and <freq_info> one of the following:
|
||||
#
|
||||
# - gt_max_freq_mhz (enforced maximum freq)
|
||||
# - gt_min_freq_mhz (enforced minimum freq)
|
||||
@@ -25,11 +18,6 @@
|
||||
# - gt_act_freq_mhz (the actual GPU freq)
|
||||
# - gt_cur_freq_mhz (the last requested freq)
|
||||
#
|
||||
# Also note that in addition to GPU management, the script offers the
|
||||
# possibility to adjust CPU operating frequencies. However, this is currently
|
||||
# limited to just setting the maximum scaling frequency as percentage of the
|
||||
# maximum frequency allowed by the hardware.
|
||||
#
|
||||
# Copyright (C) 2022 Collabora Ltd.
|
||||
# Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
#
|
||||
@@ -39,8 +27,6 @@
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
|
||||
# GPU
|
||||
DRM_FREQ_SYSFS_PATTERN="/sys/class/drm/card%d/gt_%s_freq_mhz"
|
||||
ENF_FREQ_INFO="max min boost"
|
||||
CAP_FREQ_INFO="RP0 RPn RP1"
|
||||
@@ -48,14 +34,6 @@ ACT_FREQ_INFO="act cur"
|
||||
THROTT_DETECT_SLEEP_SEC=2
|
||||
THROTT_DETECT_PID_FILE_PATH=/tmp/thrott-detect.pid
|
||||
|
||||
# CPU
|
||||
CPU_SYSFS_PREFIX=/sys/devices/system/cpu
|
||||
CPU_PSTATE_SYSFS_PATTERN="${CPU_SYSFS_PREFIX}/intel_pstate/%s"
|
||||
CPU_FREQ_SYSFS_PATTERN="${CPU_SYSFS_PREFIX}/cpu%s/cpufreq/%s_freq"
|
||||
CAP_CPU_FREQ_INFO="cpuinfo_max cpuinfo_min"
|
||||
ENF_CPU_FREQ_INFO="scaling_max scaling_min"
|
||||
ACT_CPU_FREQ_INFO="scaling_cur"
|
||||
|
||||
#
|
||||
# Global variables.
|
||||
#
|
||||
@@ -63,7 +41,6 @@ unset INTEL_DRM_CARD_INDEX
|
||||
unset GET_ACT_FREQ GET_ENF_FREQ GET_CAP_FREQ
|
||||
unset SET_MIN_FREQ SET_MAX_FREQ
|
||||
unset MONITOR_FREQ
|
||||
unset CPU_SET_MAX_FREQ
|
||||
unset DETECT_THROTT
|
||||
unset DRY_RUN
|
||||
|
||||
@@ -121,16 +98,14 @@ identify_intel_gpu() {
|
||||
# return: Global variable(s) FREQ_${arg} containing the requested information
|
||||
#
|
||||
read_freq_info() {
|
||||
local var val info path print=0 ret=0
|
||||
local var val path print=0 ret=0
|
||||
|
||||
[ "$1" = "y" ] && print=1
|
||||
shift
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
info=$1
|
||||
shift
|
||||
var=FREQ_${info}
|
||||
path=$(print_freq_sysfs_path "${info}")
|
||||
var=FREQ_$1
|
||||
path=$(print_freq_sysfs_path "$1")
|
||||
|
||||
[ -r ${path} ] && read ${var} < ${path} || {
|
||||
log ERROR "Failed to read freq info from: %s" "${path}"
|
||||
@@ -146,8 +121,10 @@ read_freq_info() {
|
||||
|
||||
[ ${print} -eq 1 ] && {
|
||||
eval val=\$${var}
|
||||
printf "%6s: %4s MHz\n" "${info}" "${val}"
|
||||
printf "%6s: %4s MHz\n" "$1" "${val}"
|
||||
}
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
return ${ret}
|
||||
@@ -415,156 +392,6 @@ detect_throttling() {
|
||||
esac
|
||||
}
|
||||
|
||||
#
|
||||
# Retrieve the list of online CPUs.
|
||||
#
|
||||
get_online_cpus() {
|
||||
local path cpu_index
|
||||
|
||||
printf "0"
|
||||
for path in $(grep 1 ${CPU_SYSFS_PREFIX}/cpu*/online); do
|
||||
cpu_index=${path##*/cpu}
|
||||
printf " %s" ${cpu_index%%/*}
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# Helper to print sysfs path for the given CPU index and freq info.
|
||||
#
|
||||
# arg1: Frequency info sysfs name, one of *_CPU_FREQ_INFO constants above
|
||||
# arg2: CPU index
|
||||
#
|
||||
print_cpu_freq_sysfs_path() {
|
||||
printf ${CPU_FREQ_SYSFS_PATTERN} "$2" "$1"
|
||||
}
|
||||
|
||||
#
|
||||
# Read the specified CPU freq info from sysfs.
|
||||
#
|
||||
# arg1: CPU index
|
||||
# arg2: Flag (y/n) to also enable printing the freq info.
|
||||
# arg3...: Frequency info sysfs name(s), see *_CPU_FREQ_INFO constants above
|
||||
# return: Global variable(s) CPU_FREQ_${arg} containing the requested information
|
||||
#
|
||||
read_cpu_freq_info() {
|
||||
local var val info path cpu_index print=0 ret=0
|
||||
|
||||
cpu_index=$1
|
||||
[ "$2" = "y" ] && print=1
|
||||
shift 2
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
info=$1
|
||||
shift
|
||||
var=CPU_FREQ_${info}
|
||||
path=$(print_cpu_freq_sysfs_path "${info}" ${cpu_index})
|
||||
|
||||
[ -r ${path} ] && read ${var} < ${path} || {
|
||||
log ERROR "Failed to read CPU freq info from: %s" "${path}"
|
||||
ret=1
|
||||
continue
|
||||
}
|
||||
|
||||
[ -n "${var}" ] || {
|
||||
log ERROR "Got empty CPU freq info from: %s" "${path}"
|
||||
ret=1
|
||||
continue
|
||||
}
|
||||
|
||||
[ ${print} -eq 1 ] && {
|
||||
eval val=\$${var}
|
||||
printf "%6s: %4s Hz\n" "${info}" "${val}"
|
||||
}
|
||||
done
|
||||
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
#
|
||||
# Helper to print freq. value as requested by user via '--cpu-set-max' option.
|
||||
# arg1: user requested freq value
|
||||
#
|
||||
compute_cpu_freq_set() {
|
||||
local val
|
||||
|
||||
case "$1" in
|
||||
+)
|
||||
val=${CPU_FREQ_cpuinfo_max}
|
||||
;;
|
||||
-)
|
||||
val=${CPU_FREQ_cpuinfo_min}
|
||||
;;
|
||||
*%)
|
||||
val=$((${1%?} * ${CPU_FREQ_cpuinfo_max} / 100))
|
||||
;;
|
||||
*[!0-9]*)
|
||||
log ERROR "Cannot set CPU freq to invalid value: %s" "$1"
|
||||
return 1
|
||||
;;
|
||||
"")
|
||||
log ERROR "Cannot set CPU freq to unspecified value"
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
log ERROR "Cannot set CPU freq to custom value; use +, -, or % instead"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
printf "%s" "${val}"
|
||||
}
|
||||
|
||||
#
|
||||
# Adjust CPU max scaling frequency.
|
||||
#
|
||||
set_cpu_freq_max() {
|
||||
local target_freq res=0
|
||||
case "${CPU_SET_MAX_FREQ}" in
|
||||
+)
|
||||
target_freq=100
|
||||
;;
|
||||
-)
|
||||
target_freq=1
|
||||
;;
|
||||
*%)
|
||||
target_freq=${CPU_SET_MAX_FREQ%?}
|
||||
;;
|
||||
*)
|
||||
log ERROR "Invalid CPU freq"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local pstate_info=$(printf "${CPU_PSTATE_SYSFS_PATTERN}" max_perf_pct)
|
||||
[ -e "${pstate_info}" ] && {
|
||||
log INFO "Setting intel_pstate max perf to %s" "${target_freq}%"
|
||||
printf "%s" "${target_freq}" > "${pstate_info}"
|
||||
[ $? -eq 0 ] || {
|
||||
log ERROR "Failed to set intel_pstate max perf"
|
||||
res=1
|
||||
}
|
||||
}
|
||||
|
||||
local cpu_index
|
||||
for cpu_index in $(get_online_cpus); do
|
||||
read_cpu_freq_info ${cpu_index} n ${CAP_CPU_FREQ_INFO} || { res=$?; continue; }
|
||||
|
||||
target_freq=$(compute_cpu_freq_set "${CPU_SET_MAX_FREQ}")
|
||||
[ -z "${target_freq}" ] && { res=$?; continue; }
|
||||
|
||||
log INFO "Setting CPU%s max scaling freq to %s Hz" ${cpu_index} "${target_freq}"
|
||||
[ -n "${DRY_RUN}" ] && continue
|
||||
|
||||
printf "%s" ${target_freq} > $(print_cpu_freq_sysfs_path scaling_max ${cpu_index})
|
||||
[ $? -eq 0 ] || {
|
||||
res=1
|
||||
log ERROR "Failed to set CPU%s max scaling frequency" ${cpu_index}
|
||||
}
|
||||
done
|
||||
|
||||
return ${res}
|
||||
}
|
||||
|
||||
#
|
||||
# Show help message.
|
||||
#
|
||||
@@ -599,12 +426,6 @@ Options:
|
||||
as a background process. Use 'stop' or 'status' to
|
||||
terminate the detector process or verify its status.
|
||||
|
||||
--cpu-set-max [FREQUENCY%|+|-}
|
||||
Set CPU max scaling frequency as % of hw max.
|
||||
Use '+' or '-' to set frequency to hardware max or min.
|
||||
|
||||
-r, --reset Reset frequencies to hardware defaults.
|
||||
|
||||
--dry-run See what the script will do without applying any
|
||||
frequency changes.
|
||||
|
||||
@@ -640,8 +461,6 @@ parse_option_get() {
|
||||
|
||||
#
|
||||
# Validate user input for '-s, --set' option.
|
||||
# arg1: input value to be validated
|
||||
# arg2: optional flag indicating input is restricted to %
|
||||
#
|
||||
validate_option_set() {
|
||||
case "$1" in
|
||||
@@ -653,8 +472,6 @@ validate_option_set() {
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -z "$2" ] || { print_usage; exit 1; }
|
||||
}
|
||||
|
||||
#
|
||||
@@ -708,12 +525,6 @@ while [ $# -gt 0 ]; do
|
||||
esac
|
||||
;;
|
||||
|
||||
--cpu-set-max)
|
||||
shift
|
||||
CPU_SET_MAX_FREQ=$1
|
||||
validate_option_set "${CPU_SET_MAX_FREQ}" restricted
|
||||
;;
|
||||
|
||||
--dry-run)
|
||||
DRY_RUN=1
|
||||
;;
|
||||
@@ -747,8 +558,6 @@ print_freq_info
|
||||
|
||||
[ -n "${DETECT_THROTT}" ] && detect_throttling ${DETECT_THROTT}
|
||||
|
||||
[ -n "${CPU_SET_MAX_FREQ}" ] && { set_cpu_freq_max || RET=$?; }
|
||||
|
||||
[ -n "${MONITOR_FREQ}" ] && {
|
||||
log INFO "Entering frequency monitoring mode"
|
||||
sleep 2
|
||||
|
@@ -2,14 +2,14 @@
|
||||
|
||||
set -ex
|
||||
|
||||
APITRACE_VERSION="790380e05854d5c9d315555444ffcc7acb8f4037"
|
||||
APITRACE_VERSION="170424754bb46002ba706e16ee5404b61988d74a"
|
||||
|
||||
git clone https://github.com/apitrace/apitrace.git --single-branch --no-checkout /apitrace
|
||||
pushd /apitrace
|
||||
git checkout "$APITRACE_VERSION"
|
||||
git submodule update --init --depth 1 --recursive
|
||||
cmake -S . -B _build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_GUI=False -DENABLE_WAFFLE=on $EXTRA_CMAKE_ARGS
|
||||
cmake --build _build --parallel --target apitrace eglretrace
|
||||
ninja -C _build
|
||||
mkdir build
|
||||
cp _build/apitrace build
|
||||
cp _build/eglretrace build
|
||||
|
@@ -13,7 +13,7 @@ git submodule update --init
|
||||
cat "$SCRIPT_DIR"/.gitlab-ci/container/build-crosvm_*.patch |
|
||||
patch -p1
|
||||
|
||||
VIRGLRENDERER_VERSION=dd301caf7e05ec9c09634fb7872067542aad89b7
|
||||
VIRGLRENDERER_VERSION=0564c9a0c2f584e004a7d4864aee3b8ec9692105
|
||||
rm -rf third_party/virglrenderer
|
||||
git clone --single-branch -b master --no-checkout https://gitlab.freedesktop.org/virgl/virglrenderer.git third_party/virglrenderer
|
||||
pushd third_party/virglrenderer
|
||||
|
@@ -6,11 +6,15 @@ git config --global user.email "mesa@example.com"
|
||||
git config --global user.name "Mesa CI"
|
||||
git clone \
|
||||
https://github.com/KhronosGroup/VK-GL-CTS.git \
|
||||
-b vulkan-cts-1.3.3.0 \
|
||||
-b vulkan-cts-1.3.1.1 \
|
||||
--depth 1 \
|
||||
/VK-GL-CTS
|
||||
pushd /VK-GL-CTS
|
||||
|
||||
# Cherry-pick fix for zlib dependency
|
||||
git fetch origin main
|
||||
git cherry-pick -x ec1804831b654ac55bd2a7a5dd27a556afe05030
|
||||
|
||||
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
|
||||
# libpng (sigh). The archives get their checksums checked anyway, and git
|
||||
# always goes through ssh or https.
|
||||
@@ -43,8 +47,8 @@ mv /deqp/modules/egl/deqp-egl-x11 /deqp/modules/egl/deqp-egl
|
||||
|
||||
# Copy out the mustpass lists we want.
|
||||
mkdir /deqp/mustpass
|
||||
for mustpass in $(< /VK-GL-CTS/external/vulkancts/mustpass/main/vk-default.txt) ; do
|
||||
cat /VK-GL-CTS/external/vulkancts/mustpass/main/$mustpass \
|
||||
for mustpass in $(< /VK-GL-CTS/external/vulkancts/mustpass/master/vk-default.txt) ; do
|
||||
cat /VK-GL-CTS/external/vulkancts/mustpass/master/$mustpass \
|
||||
>> /deqp/mustpass/vk-master.txt
|
||||
done
|
||||
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
set -ex
|
||||
|
||||
GFXRECONSTRUCT_VERSION=5ed3caeecc46e976c4df31e263df8451ae176c26
|
||||
GFXRECONSTRUCT_VERSION=3738decc2f4f9ff183818e5ab213a75a79fb7ab1
|
||||
|
||||
git clone https://github.com/LunarG/gfxreconstruct.git \
|
||||
--single-branch \
|
||||
-b master \
|
||||
--no-checkout \
|
||||
/gfxreconstruct
|
||||
git clone https://github.com/LunarG/gfxreconstruct.git --single-branch -b master --no-checkout /gfxreconstruct
|
||||
pushd /gfxreconstruct
|
||||
git checkout "$GFXRECONSTRUCT_VERSION"
|
||||
git submodule update --init
|
||||
git submodule update
|
||||
cmake -S . -B _build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/gfxreconstruct/build -DBUILD_WERROR=OFF
|
||||
cmake --build _build --parallel --target tools/{replay,info}/install/strip
|
||||
cmake -S . -B _build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
ninja -C _build gfxrecon-replay gfxrecon-info
|
||||
mkdir -p build/bin
|
||||
install _build/tools/replay/gfxrecon-replay build/bin
|
||||
install _build/tools/info/gfxrecon-info build/bin
|
||||
strip build/bin/*
|
||||
find . -not -path './build' -not -path './build/*' -delete
|
||||
popd
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
PARALLEL_DEQP_RUNNER_VERSION=fe557794b5dadd8dbf0eae403296625e03bda18a
|
||||
PARALLEL_DEQP_RUNNER_VERSION=6596b71cf37a7efb4d54acd48c770ed2d4ad6b7e
|
||||
|
||||
git clone https://gitlab.freedesktop.org/mesa/parallel-deqp-runner --single-branch -b master --no-checkout /parallel-deqp-runner
|
||||
pushd /parallel-deqp-runner
|
||||
|
@@ -4,7 +4,7 @@ set -ex
|
||||
|
||||
git clone https://gitlab.freedesktop.org/mesa/piglit.git --single-branch --no-checkout /piglit
|
||||
pushd /piglit
|
||||
git checkout b2c9d8f56b45d79f804f4cb5ac62520f0edd8988
|
||||
git checkout 445711587d461539a4d8f9d35a7fe996a86d3c8d
|
||||
patch -p1 <$OLDPWD/.gitlab-ci/piglit/disable-vs_in.diff
|
||||
cmake -S . -B . -G Ninja -DCMAKE_BUILD_TYPE=Release $PIGLIT_OPTS $EXTRA_CMAKE_ARGS
|
||||
ninja $PIGLIT_BUILD_TARGETS
|
||||
|
@@ -41,7 +41,7 @@ download_skia_source() {
|
||||
# Skia cloned from https://android.googlesource.com/platform/external/skqp
|
||||
# has all needed assets tracked on git-fs
|
||||
SKQP_REPO=https://android.googlesource.com/platform/external/skqp
|
||||
SKQP_BRANCH=android-cts-11.0_r7
|
||||
SKQP_BRANCH=android-cts-10.0_r11
|
||||
|
||||
git clone --branch "${SKQP_BRANCH}" --depth 1 "${SKQP_REPO}" "${SKIA_DIR}"
|
||||
}
|
||||
|
@@ -1,41 +0,0 @@
|
||||
diff --git a/tools/skqp/src/skqp.cpp b/tools/skqp/src/skqp.cpp
|
||||
index 50ed9db01d..938217000d 100644
|
||||
--- a/tools/skqp/src/skqp.cpp
|
||||
+++ b/tools/skqp/src/skqp.cpp
|
||||
@@ -448,7 +448,7 @@ inline void write(SkWStream* wStream, const T& text) {
|
||||
|
||||
void SkQP::makeReport() {
|
||||
SkASSERT_RELEASE(fAssetManager);
|
||||
- int glesErrorCount = 0, vkErrorCount = 0, gles = 0, vk = 0;
|
||||
+ int glErrorCount = 0, glesErrorCount = 0, vkErrorCount = 0, gl = 0, gles = 0, vk = 0;
|
||||
|
||||
if (!sk_isdir(fReportDirectory.c_str())) {
|
||||
SkDebugf("Report destination does not exist: '%s'\n", fReportDirectory.c_str());
|
||||
@@ -460,6 +460,7 @@ void SkQP::makeReport() {
|
||||
htmOut.writeText(kDocHead);
|
||||
for (const SkQP::RenderResult& run : fRenderResults) {
|
||||
switch (run.fBackend) {
|
||||
+ case SkQP::SkiaBackend::kGL: ++gl; break;
|
||||
case SkQP::SkiaBackend::kGLES: ++gles; break;
|
||||
case SkQP::SkiaBackend::kVulkan: ++vk; break;
|
||||
default: break;
|
||||
@@ -477,15 +478,17 @@ void SkQP::makeReport() {
|
||||
}
|
||||
write(&htmOut, SkStringPrintf(" f(%s);\n", str.c_str()));
|
||||
switch (run.fBackend) {
|
||||
+ case SkQP::SkiaBackend::kGL: ++glErrorCount; break;
|
||||
case SkQP::SkiaBackend::kGLES: ++glesErrorCount; break;
|
||||
case SkQP::SkiaBackend::kVulkan: ++vkErrorCount; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
htmOut.writeText(kDocMiddle);
|
||||
- write(&htmOut, SkStringPrintf("<p>gles errors: %d (of %d)</br>\n"
|
||||
+ write(&htmOut, SkStringPrintf("<p>gl errors: %d (of %d)</br>\n"
|
||||
+ "gles errors: %d (of %d)</br>\n"
|
||||
"vk errors: %d (of %d)</p>\n",
|
||||
- glesErrorCount, gles, vkErrorCount, vk));
|
||||
+ glErrorCount, gl, glesErrorCount, gles, vkErrorCount, vk));
|
||||
htmOut.writeText(kDocTail);
|
||||
SkFILEWStream unitOut(SkOSPath::Join(fReportDirectory.c_str(), kUnitTestReportPath).c_str());
|
||||
SkASSERT_RELEASE(unitOut.isValid());
|
@@ -2,7 +2,8 @@
|
||||
|
||||
set -ex
|
||||
|
||||
VKD3D_PROTON_COMMIT="5b73139f182d86cd58a757e4b5f0d4cfad96d319"
|
||||
VKD3D_PROTON_VERSION="2.6"
|
||||
VKD3D_PROTON_COMMIT="3e5aab6fb3e18f81a71b339be4cb5cdf55140980"
|
||||
|
||||
VKD3D_PROTON_DST_DIR="/vkd3d-proton-tests"
|
||||
VKD3D_PROTON_SRC_DIR="/vkd3d-proton-src"
|
||||
@@ -15,7 +16,7 @@ function build_arch {
|
||||
meson "$@" \
|
||||
-Denable_tests=true \
|
||||
--buildtype release \
|
||||
--prefix "$VKD3D_PROTON_DST_DIR" \
|
||||
--prefix "$VKD3D_PROTON_BUILD_DIR" \
|
||||
--strip \
|
||||
--bindir "x${arch}" \
|
||||
--libdir "x${arch}" \
|
||||
@@ -23,17 +24,20 @@ function build_arch {
|
||||
|
||||
ninja -C "$VKD3D_PROTON_BUILD_DIR/build.${arch}" install
|
||||
|
||||
install -D -m755 -t "${VKD3D_PROTON_DST_DIR}/x${arch}/bin" "$VKD3D_PROTON_BUILD_DIR/build.${arch}/tests/d3d12"
|
||||
install -D -m755 -t "${VKD3D_PROTON_DST_DIR}/x${arch}/bin" "$VKD3D_PROTON_BUILD_DIR/build.${arch}/tests/"*.exe
|
||||
}
|
||||
|
||||
git clone https://github.com/HansKristian-Work/vkd3d-proton.git --single-branch -b master --no-checkout "$VKD3D_PROTON_SRC_DIR"
|
||||
git clone https://github.com/HansKristian-Work/vkd3d-proton.git --single-branch -b "v$VKD3D_PROTON_VERSION" --no-checkout "$VKD3D_PROTON_SRC_DIR"
|
||||
pushd "$VKD3D_PROTON_SRC_DIR"
|
||||
git checkout "$VKD3D_PROTON_COMMIT"
|
||||
git submodule update --init --recursive
|
||||
git submodule update --recursive
|
||||
build_arch 64
|
||||
build_arch 86
|
||||
build_arch 64 --cross-file build-win64.txt
|
||||
build_arch 86 --cross-file build-win32.txt
|
||||
cp "setup_vkd3d_proton.sh" "$VKD3D_PROTON_BUILD_DIR/setup_vkd3d_proton.sh"
|
||||
chmod +x "$VKD3D_PROTON_BUILD_DIR/setup_vkd3d_proton.sh"
|
||||
popd
|
||||
|
||||
"$VKD3D_PROTON_BUILD_DIR"/setup_vkd3d_proton.sh install
|
||||
rm -rf "$VKD3D_PROTON_BUILD_DIR"
|
||||
rm -rf "$VKD3D_PROTON_SRC_DIR"
|
||||
|
@@ -34,9 +34,3 @@ chmod +x /usr/local/bin/ninja
|
||||
# Set MAKEFLAGS so that all make invocations in container builds include the
|
||||
# flags (doesn't apply to non-container builds, but we don't run make there)
|
||||
export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
|
||||
|
||||
# make wget to try more than once, when download fails or timeout
|
||||
echo -e "retry_connrefused = on\n" \
|
||||
"read_timeout = 300\n" \
|
||||
"tries = 4\n" \
|
||||
"wait_retry = 32" >> /etc/wgetrc
|
||||
|
@@ -11,25 +11,15 @@ if [ $DEBIAN_ARCH = arm64 ]; then
|
||||
libvulkan-dev
|
||||
"
|
||||
elif [ $DEBIAN_ARCH = amd64 ]; then
|
||||
# Add llvm 13 to the build image
|
||||
apt-get -y install --no-install-recommends wget gnupg2 software-properties-common
|
||||
apt-key add /llvm-snapshot.gpg.key
|
||||
add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main"
|
||||
|
||||
ARCH_PACKAGES="firmware-amd-graphics
|
||||
inetutils-syslogd
|
||||
iptables
|
||||
libcap2
|
||||
libfontconfig1
|
||||
libelf1
|
||||
libfdt1
|
||||
libgl1
|
||||
libglu1-mesa
|
||||
libllvm13
|
||||
libllvm11
|
||||
libva2
|
||||
libva-drm2
|
||||
libvulkan-dev
|
||||
socat
|
||||
spirv-tools
|
||||
sysvinit-core
|
||||
@@ -43,7 +33,6 @@ INSTALL_CI_FAIRY_PACKAGES="git
|
||||
python3-wheel
|
||||
"
|
||||
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends \
|
||||
$ARCH_PACKAGES \
|
||||
$INSTALL_CI_FAIRY_PACKAGES \
|
||||
@@ -199,8 +188,6 @@ UNNEEDED_PACKAGES="apt libapt-pkg6.0 "\
|
||||
"libgles2-mesa-dev "\
|
||||
"libglx-mesa0 "\
|
||||
"mesa-common-dev "\
|
||||
"gnupg2 "\
|
||||
"software-properties-common " \
|
||||
|
||||
# Removing unneeded packages
|
||||
for PACKAGE in ${UNNEEDED_PACKAGES}
|
||||
|
@@ -22,13 +22,11 @@ apt-get -y install \
|
||||
flex \
|
||||
g++ \
|
||||
git \
|
||||
glslang-tools \
|
||||
kmod \
|
||||
libasan6 \
|
||||
libdrm-dev \
|
||||
libelf-dev \
|
||||
libexpat1-dev \
|
||||
libvulkan-dev \
|
||||
libx11-dev \
|
||||
libx11-xcb-dev \
|
||||
libxcb-dri2-0-dev \
|
||||
|
@@ -1,52 +0,0 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.12 (GNU/Linux)
|
||||
|
||||
mQINBFE9lCwBEADi0WUAApM/mgHJRU8lVkkw0CHsZNpqaQDNaHefD6Rw3S4LxNmM
|
||||
EZaOTkhP200XZM8lVdbfUW9xSjA3oPldc1HG26NjbqqCmWpdo2fb+r7VmU2dq3NM
|
||||
R18ZlKixiLDE6OUfaXWKamZsXb6ITTYmgTO6orQWYrnW6ckYHSeaAkW0wkDAryl2
|
||||
B5v8aoFnQ1rFiVEMo4NGzw4UX+MelF7rxaaregmKVTPiqCOSPJ1McC1dHFN533FY
|
||||
Wh/RVLKWo6npu+owtwYFQW+zyQhKzSIMvNujFRzhIxzxR9Gn87MoLAyfgKEzrbbT
|
||||
DhqqNXTxS4UMUKCQaO93TzetX/EBrRpJj+vP640yio80h4Dr5pAd7+LnKwgpTDk1
|
||||
G88bBXJAcPZnTSKu9I2c6KY4iRNbvRz4i+ZdwwZtdW4nSdl2792L7Sl7Nc44uLL/
|
||||
ZqkKDXEBF6lsX5XpABwyK89S/SbHOytXv9o4puv+65Ac5/UShspQTMSKGZgvDauU
|
||||
cs8kE1U9dPOqVNCYq9Nfwinkf6RxV1k1+gwtclxQuY7UpKXP0hNAXjAiA5KS5Crq
|
||||
7aaJg9q2F4bub0mNU6n7UI6vXguF2n4SEtzPRk6RP+4TiT3bZUsmr+1ktogyOJCc
|
||||
Ha8G5VdL+NBIYQthOcieYCBnTeIH7D3Sp6FYQTYtVbKFzmMK+36ERreL/wARAQAB
|
||||
tD1TeWx2ZXN0cmUgTGVkcnUgLSBEZWJpYW4gTExWTSBwYWNrYWdlcyA8c3lsdmVz
|
||||
dHJlQGRlYmlhbi5vcmc+iQI4BBMBAgAiBQJRPZQsAhsDBgsJCAcDAgYVCAIJCgsE
|
||||
FgIDAQIeAQIXgAAKCRAVz00Yr090Ibx+EADArS/hvkDF8juWMXxh17CgR0WZlHCC
|
||||
9CTBWkg5a0bNN/3bb97cPQt/vIKWjQtkQpav6/5JTVCSx2riL4FHYhH0iuo4iAPR
|
||||
udC7Cvg8g7bSPrKO6tenQZNvQm+tUmBHgFiMBJi92AjZ/Qn1Shg7p9ITivFxpLyX
|
||||
wpmnF1OKyI2Kof2rm4BFwfSWuf8Fvh7kDMRLHv+MlnK/7j/BNpKdozXxLcwoFBmn
|
||||
l0WjpAH3OFF7Pvm1LJdf1DjWKH0Dc3sc6zxtmBR/KHHg6kK4BGQNnFKujcP7TVdv
|
||||
gMYv84kun14pnwjZcqOtN3UJtcx22880DOQzinoMs3Q4w4o05oIF+sSgHViFpc3W
|
||||
R0v+RllnH05vKZo+LDzc83DQVrdwliV12eHxrMQ8UYg88zCbF/cHHnlzZWAJgftg
|
||||
hB08v1BKPgYRUzwJ6VdVqXYcZWEaUJmQAPuAALyZESw94hSo28FAn0/gzEc5uOYx
|
||||
K+xG/lFwgAGYNb3uGM5m0P6LVTfdg6vDwwOeTNIExVk3KVFXeSQef2ZMkhwA7wya
|
||||
KJptkb62wBHFE+o9TUdtMCY6qONxMMdwioRE5BYNwAsS1PnRD2+jtlI0DzvKHt7B
|
||||
MWd8hnoUKhMeZ9TNmo+8CpsAtXZcBho0zPGz/R8NlJhAWpdAZ1CmcPo83EW86Yq7
|
||||
BxQUKnNHcwj2ebkCDQRRPZQsARAA4jxYmbTHwmMjqSizlMJYNuGOpIidEdx9zQ5g
|
||||
zOr431/VfWq4S+VhMDhs15j9lyml0y4ok215VRFwrAREDg6UPMr7ajLmBQGau0Fc
|
||||
bvZJ90l4NjXp5p0NEE/qOb9UEHT7EGkEhaZ1ekkWFTWCgsy7rRXfZLxB6sk7pzLC
|
||||
DshyW3zjIakWAnpQ5j5obiDy708pReAuGB94NSyb1HoW/xGsGgvvCw4r0w3xPStw
|
||||
F1PhmScE6NTBIfLliea3pl8vhKPlCh54Hk7I8QGjo1ETlRP4Qll1ZxHJ8u25f/ta
|
||||
RES2Aw8Hi7j0EVcZ6MT9JWTI83yUcnUlZPZS2HyeWcUj+8nUC8W4N8An+aNps9l/
|
||||
21inIl2TbGo3Yn1JQLnA1YCoGwC34g8QZTJhElEQBN0X29ayWW6OdFx8MDvllbBV
|
||||
ymmKq2lK1U55mQTfDli7S3vfGz9Gp/oQwZ8bQpOeUkc5hbZszYwP4RX+68xDPfn+
|
||||
M9udl+qW9wu+LyePbW6HX90LmkhNkkY2ZzUPRPDHZANU5btaPXc2H7edX4y4maQa
|
||||
xenqD0lGh9LGz/mps4HEZtCI5CY8o0uCMF3lT0XfXhuLksr7Pxv57yue8LLTItOJ
|
||||
d9Hmzp9G97SRYYeqU+8lyNXtU2PdrLLq7QHkzrsloG78lCpQcalHGACJzrlUWVP/
|
||||
fN3Ht3kAEQEAAYkCHwQYAQIACQUCUT2ULAIbDAAKCRAVz00Yr090IbhWEADbr50X
|
||||
OEXMIMGRLe+YMjeMX9NG4jxs0jZaWHc/WrGR+CCSUb9r6aPXeLo+45949uEfdSsB
|
||||
pbaEdNWxF5Vr1CSjuO5siIlgDjmT655voXo67xVpEN4HhMrxugDJfCa6z97P0+ML
|
||||
PdDxim57uNqkam9XIq9hKQaurxMAECDPmlEXI4QT3eu5qw5/knMzDMZj4Vi6hovL
|
||||
wvvAeLHO/jsyfIdNmhBGU2RWCEZ9uo/MeerPHtRPfg74g+9PPfP6nyHD2Wes6yGd
|
||||
oVQwtPNAQD6Cj7EaA2xdZYLJ7/jW6yiPu98FFWP74FN2dlyEA2uVziLsfBrgpS4l
|
||||
tVOlrO2YzkkqUGrybzbLpj6eeHx+Cd7wcjI8CalsqtL6cG8cUEjtWQUHyTbQWAgG
|
||||
5VPEgIAVhJ6RTZ26i/G+4J8neKyRs4vz+57UGwY6zI4AB1ZcWGEE3Bf+CDEDgmnP
|
||||
LSwbnHefK9IljT9XU98PelSryUO/5UPw7leE0akXKB4DtekToO226px1VnGp3Bov
|
||||
1GBGvpHvL2WizEwdk+nfk8LtrLzej+9FtIcq3uIrYnsac47Pf7p0otcFeTJTjSq3
|
||||
krCaoG4Hx0zGQG2ZFpHrSrZTVy6lxvIdfi0beMgY6h78p6M9eYZHQHc02DjFkQXN
|
||||
bXb5c6gCHESH5PXwPU4jQEE7Ib9J6sbk7ZT2Mw==
|
||||
=j+4q
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@@ -1,53 +0,0 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQGNBFwOmrgBDAC9FZW3dFpew1hwDaqRfdQQ1ABcmOYu1NKZHwYjd+bGvcR2LRGe
|
||||
R5dfRqG1Uc/5r6CPCMvnWxFprymkqKEADn8eFn+aCnPx03HrhA+lNEbciPfTHylt
|
||||
NTTuRua7YpJIgEOjhXUbxXxnvF8fhUf5NJpJg6H6fPQARUW+5M//BlVgwn2jhzlW
|
||||
U+uwgeJthhiuTXkls9Yo3EoJzmkUih+ABZgvaiBpr7GZRw9GO1aucITct0YDNTVX
|
||||
KA6el78/udi5GZSCKT94yY9ArN4W6NiOFCLV7MU5d6qMjwGFhfg46NBv9nqpGinK
|
||||
3NDjqCevKouhtKl2J+nr3Ju3Spzuv6Iex7tsOqt+XdZCoY+8+dy3G5zbJwBYsMiS
|
||||
rTNF55PHtBH1S0QK5OoN2UR1ie/aURAyAFEMhTzvFB2B2v7C0IKIOmYMEG+DPMs9
|
||||
FQs/vZ1UnAQgWk02ZiPryoHfjFO80+XYMrdWN+RSo5q9ODClloaKXjqI/aWLGirm
|
||||
KXw2R8tz31go3NMAEQEAAbQnV2luZUhRIHBhY2thZ2VzIDx3aW5lLWRldmVsQHdp
|
||||
bmVocS5vcmc+iQHOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE
|
||||
1D9kAUU2nFHXht3qdvGiD/mHZy8FAlwOmyUACgkQdvGiD/mHZy/zkwv7B+nKFlDY
|
||||
Bzz/7j0gqIODbs5FRZRtuf/IuPP3vZdWlNfAW/VyaLtVLJCM/mmaf/O6/gJ+D+E9
|
||||
BBoSmHdHzBBOQHIj5IbRedynNcHT5qXsdBeU2ZPR50sdE+jmukvw3Wa5JijoDgUu
|
||||
LGLGtU48Z3JsBXQ54OlnTZXQ2SMFhRUa10JANXSJQ+QY2Wo2Pi2+MEAHcrd71A2S
|
||||
0mT2DQSSBQ92c6WPfUpOSBawd8P0ipT7rVFNLJh8HVQGyEWxPl8ecDEHoVfG2rdV
|
||||
D0ADbNLx9031UUwpUicO6vW/2Ec7c3VNG1cpOtyNTw/lEgvsXOh3GQs/DvFvMy/h
|
||||
QzaeF3Qq6cAPlKuxieJe4lLYFBTmCAT4iB1J8oeFs4G7ScfZH4+4NBe3VGoeCD/M
|
||||
Wl+qxntAroblxiFuqtPJg+NKZYWBzkptJNhnrBxcBnRinGZLw2k/GR/qPMgsR2L4
|
||||
cP+OUuka+R2gp9oDVTZTyMowz+ROIxnEijF50pkj2VBFRB02rfiMp7q6iQIzBBAB
|
||||
CgAdFiEE2iNXmnTUrZr50/lFzvrI6q8XUZ0FAlwOm3AACgkQzvrI6q8XUZ3KKg/+
|
||||
MD8CgvLiHEX90fXQ23RZQRm2J21w3gxdIen/N8yJVIbK7NIgYhgWfGWsGQedtM7D
|
||||
hMwUlDSRb4rWy9vrXBaiZoF3+nK9AcLvPChkZz28U59Jft6/l0gVrykey/ERU7EV
|
||||
w1Ie1eRu0tRSXsKvMZyQH8897iHZ7uqoJgyk8U8CvSW+V80yqLB2M8Tk8ECZq34f
|
||||
HqUIGs4Wo0UZh0vV4+dEQHBh1BYpmmWl+UPf7nzNwFWXu/EpjVhkExRqTnkEJ+Ai
|
||||
OxbtrRn6ETKzpV4DjyifqQF639bMIem7DRRf+mkcrAXetvWkUkE76e3E9KLvETCZ
|
||||
l4SBfgqSZs2vNngmpX6Qnoh883aFo5ZgVN3v6uTS+LgTwMt/XlnDQ7+Zw+ehCZ2R
|
||||
CO21Y9Kbw6ZEWls/8srZdCQ2LxnyeyQeIzsLnqT/waGjQj35i4exzYeWpojVDb3r
|
||||
tvvOALYGVlSYqZXIALTx2/tHXKLHyrn1C0VgHRnl+hwv7U49f7RvfQXpx47YQN/C
|
||||
PWrpbG69wlKuJptr+olbyoKAWfl+UzoO8vLMo5njWQNAoAwh1H8aFUVNyhtbkRuq
|
||||
l0kpy1Cmcq8uo6taK9lvYp8jak7eV8lHSSiGUKTAovNTwfZG2JboGV4/qLDUKvpa
|
||||
lPp2xVpF9MzA8VlXTOzLpSyIVxZnPTpL+xR5P9WQjMS5AY0EXA6auAEMAMReKL89
|
||||
0z0SL+/i/geB/agfG/k6AXiG2a9kVWeIjAqFwHKl9W/DTNvOqCDgAt51oiHGRRjt
|
||||
1Xm3XZD4p+GM1uZWn9qIFL49Gt5x94TqdrsKTVCJr0Kazn2mKQc7aja0zac+WtZG
|
||||
OFn7KbniuAcwtC780cyikfmmExLI1/Vjg+NiMlMtZfpK6FIW+ulPiDQPdzIhVppx
|
||||
w9/KlR2Fvh4TbzDsUqkFQSSAFdQ65BWgvzLpZHdKO/ILpDkThLbipjtvbBv/pHKM
|
||||
O/NFTNoYkJ3cNW/kfcynwV+4AcKwdRz2A3Mez+g5TKFYPZROIbayOo01yTMLfz2p
|
||||
jcqki/t4PACtwFOhkAs+MYPPyZDUkTFcEJQCPDstkAgmJWI3K2qELtDOLQyps3WY
|
||||
Mfp+mntOdc8bKjFTMcCEk1zcm14K4Oms+w6dw2UnYsX1FAYYhPm8HUYwE4kP8M+D
|
||||
9HGLMjLqqF/kanlCFZs5Avx3mDSAx6zS8vtNdGh+64oDNk4x4A2j8GTUuQARAQAB
|
||||
iQG8BBgBCgAmFiEE1D9kAUU2nFHXht3qdvGiD/mHZy8FAlwOmrgCGwwFCQPCZwAA
|
||||
CgkQdvGiD/mHZy9FnAwAgfUkxsO53Pm2iaHhtF4+BUc8MNJj64Jvm1tghr6PBRtM
|
||||
hpbvvN8SSOFwYIsS+2BMsJ2ldox4zMYhuvBcgNUlix0G0Z7h1MjftDdsLFi1DNv2
|
||||
J9dJ9LdpWdiZbyg4Sy7WakIZ/VvH1Znd89Imo7kCScRdXTjIw2yCkotE5lK7A6Ns
|
||||
NbVuoYEN+dbGioF4csYehnjTdojwF/19mHFxrXkdDZ/V6ZYFIFxEsxL8FEuyI4+o
|
||||
LC3DFSA4+QAFdkjGFXqFPlaEJxWt5d7wk0y+tt68v+ulkJ900BvR+OOMqQURwrAi
|
||||
iP3I28aRrMjZYwyqHl8i/qyIv+WRakoDKV+wWteR5DmRAPHmX2vnlPlCmY8ysR6J
|
||||
2jUAfuDFVu4/qzJe6vw5tmPJMdfvy0W5oogX6sEdin5M5w2b3WrN8nXZcjbWymqP
|
||||
6jCdl6eoCCkKNOIbr/MMSkd2KqAqDVM5cnnlQ7q+AXzwNpj3RGJVoBxbS0nn9JWY
|
||||
QNQrWh9rAcMIGT+b1le0
|
||||
=4lsa
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
# Installing wine, need this for testing mingw or nine
|
||||
|
||||
# We need multiarch for Wine
|
||||
dpkg --add-architecture i386
|
||||
apt-get update
|
||||
apt-get install -y --no-remove \
|
||||
wine \
|
||||
wine32 \
|
||||
wine64 \
|
||||
xvfb
|
||||
|
||||
# Used to initialize the Wine environment to reduce build time
|
||||
wine64 whoami.exe
|
||||
|
@@ -5,11 +5,7 @@ set -o xtrace
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get install -y ca-certificates gnupg2 software-properties-common
|
||||
|
||||
# Add llvm 13 to the build image
|
||||
apt-key add .gitlab-ci/container/debian/llvm-snapshot.gpg.key
|
||||
add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main"
|
||||
apt-get install -y ca-certificates
|
||||
|
||||
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
|
||||
|
||||
@@ -29,12 +25,11 @@ apt-get install -y --no-remove \
|
||||
dpkg-cross \
|
||||
flex \
|
||||
g++ \
|
||||
cmake \
|
||||
g++-mingw-w64-x86-64 \
|
||||
gcc \
|
||||
git \
|
||||
glslang-tools \
|
||||
kmod \
|
||||
libclang-13-dev \
|
||||
libclang-11-dev \
|
||||
libclang-9-dev \
|
||||
libclc-dev \
|
||||
@@ -42,7 +37,6 @@ apt-get install -y --no-remove \
|
||||
libepoxy-dev \
|
||||
libexpat1-dev \
|
||||
libgtk-3-dev \
|
||||
libllvm13 \
|
||||
libllvm11 \
|
||||
libllvm9 \
|
||||
libomxil-bellagio-dev \
|
||||
@@ -60,6 +54,7 @@ apt-get install -y --no-remove \
|
||||
libxshmfence-dev \
|
||||
libxvmc-dev \
|
||||
libxxf86vm-dev \
|
||||
libz-mingw-w64-dev \
|
||||
make \
|
||||
meson \
|
||||
pkg-config \
|
||||
@@ -69,6 +64,7 @@ apt-get install -y --no-remove \
|
||||
qemu-user \
|
||||
valgrind \
|
||||
wget \
|
||||
wine64 \
|
||||
x11proto-dri2-dev \
|
||||
x11proto-gl-dev \
|
||||
x11proto-randr-dev \
|
||||
@@ -78,8 +74,6 @@ apt-get install -y --no-remove \
|
||||
# Needed for ci-fairy, this revision is able to upload files to MinIO
|
||||
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@34f4ade99434043f88e164933f570301fd18b125
|
||||
|
||||
. .gitlab-ci/container/debian/x86_build-base-wine.sh
|
||||
|
||||
############### Uninstall ephemeral packages
|
||||
|
||||
apt-get purge -y $STABLE_EPHEMERAL
|
||||
|
@@ -1,74 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Pull packages from msys2 repository that can be directly used.
|
||||
# We can use https://packages.msys2.org/ to retrieve the newest package
|
||||
mkdir ~/tmp
|
||||
pushd ~/tmp
|
||||
MINGW_PACKET_LIST="
|
||||
mingw-w64-x86_64-headers-git-10.0.0.r14.ga08c638f8-1-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-vulkan-loader-1.3.211-1-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-libelf-0.8.13-6-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-zlib-1.2.12-1-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-zstd-1.5.2-2-any.pkg.tar.zst
|
||||
"
|
||||
|
||||
for i in $MINGW_PACKET_LIST
|
||||
do
|
||||
wget -q https://mirror.msys2.org/mingw/mingw64/$i
|
||||
tar xf $i --strip-components=1 -C /usr/x86_64-w64-mingw32/
|
||||
done
|
||||
popd
|
||||
rm -rf ~/tmp
|
||||
|
||||
mkdir -p /usr/x86_64-w64-mingw32/bin
|
||||
|
||||
# The output of `wine64 llvm-config --system-libs --cxxflags mcdisassembler`
|
||||
# containes absolute path like '-IZ:'
|
||||
# The sed is used to replace `-IZ:/usr/x86_64-w64-mingw32/include`
|
||||
# to `-I/usr/x86_64-w64-mingw32/include`
|
||||
|
||||
# Debian's pkg-config wrapers for mingw are broken, and there's no sign that
|
||||
# they're going to be fixed, so we'll just have to fix it ourselves
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
|
||||
cat >/usr/x86_64-w64-mingw32/bin/pkg-config <<EOF
|
||||
#!/bin/sh
|
||||
|
||||
PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig:/usr/x86_64-w64-mingw32/share/pkgconfig pkg-config \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/pkg-config
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-config <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-config \$@ | sed -e "s,Z:/,/,gi"
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-config
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/clang <<EOF
|
||||
#!/bin/sh
|
||||
wine64 clang \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/clang
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-as <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-as \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-as
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-link <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-link \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-link
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/opt <<EOF
|
||||
#!/bin/sh
|
||||
wine64 opt \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/opt
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-spirv <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-spirv \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-spirv
|
@@ -1,100 +0,0 @@
|
||||
#!/bin/bash
|
||||
wd=$PWD
|
||||
CMAKE_TOOLCHAIN_MINGW_PATH=$wd/.gitlab-ci/container/debian/x86_mingw-toolchain.cmake
|
||||
mkdir -p ~/tmp
|
||||
pushd ~/tmp
|
||||
|
||||
# Building DirectX-Headers
|
||||
git clone https://github.com/microsoft/DirectX-Headers -b v1.606.3 --depth 1
|
||||
mkdir -p DirectX-Headers/build
|
||||
pushd DirectX-Headers/build
|
||||
meson .. \
|
||||
--backend=ninja \
|
||||
--buildtype=release -Dbuild-test=false \
|
||||
-Dprefix=/usr/x86_64-w64-mingw32/ \
|
||||
--cross-file=$wd/.gitlab-ci/x86_64-w64-mingw32
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
export VULKAN_SDK_VERSION=1.3.211.0
|
||||
|
||||
# Building SPIRV Tools
|
||||
git clone -b sdk-$VULKAN_SDK_VERSION --depth=1 \
|
||||
https://github.com/KhronosGroup/SPIRV-Tools SPIRV-Tools
|
||||
|
||||
git clone -b sdk-$VULKAN_SDK_VERSION --depth=1 \
|
||||
https://github.com/KhronosGroup/SPIRV-Headers SPIRV-Tools/external/SPIRV-Headers
|
||||
|
||||
mkdir -p SPIRV-Tools/build
|
||||
pushd SPIRV-Tools/build
|
||||
cmake .. \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
|
||||
-GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
# Building LLVM
|
||||
git clone -b release/14.x --depth=1 \
|
||||
https://github.com/llvm/llvm-project llvm-project
|
||||
|
||||
git clone -b v14.0.0 --depth=1 \
|
||||
https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/SPIRV-LLVM-Translator
|
||||
|
||||
mkdir llvm-project/build
|
||||
pushd llvm-project/build
|
||||
cmake ../llvm \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
|
||||
-GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DLLVM_ENABLE_RTTI=ON \
|
||||
-DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$PWD/../../SPIRV-Tools/external/SPIRV-Headers \
|
||||
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$PWD/../../SPIRV-Tools/external/SPIRV-Headers \
|
||||
-DLLVM_ENABLE_PROJECTS="clang" \
|
||||
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=TRUE \
|
||||
-DLLVM_ENABLE_ASSERTIONS=TRUE \
|
||||
-DLLVM_INCLUDE_UTILS=OFF \
|
||||
-DLLVM_INCLUDE_RUNTIMES=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
-DLLVM_INCLUDE_GO_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
||||
-DLLVM_BUILD_LLVM_C_DYLIB=OFF \
|
||||
-DLLVM_ENABLE_DIA_SDK=OFF \
|
||||
-DCLANG_BUILD_TOOLS=ON \
|
||||
-DLLVM_SPIRV_INCLUDE_TESTS=OFF
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
# Building libclc
|
||||
mkdir llvm-project/build-libclc
|
||||
pushd llvm-project/build-libclc
|
||||
cmake ../libclc \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
|
||||
-GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
|
||||
-DCMAKE_CXX_FLAGS="-m64" \
|
||||
-DLLVM_CONFIG="/usr/x86_64-w64-mingw32/bin/llvm-config" \
|
||||
-DLLVM_CLANG="/usr/x86_64-w64-mingw32/bin/clang" \
|
||||
-DLLVM_AS="/usr/x86_64-w64-mingw32/bin/llvm-as" \
|
||||
-DLLVM_LINK="/usr/x86_64-w64-mingw32/bin/llvm-link" \
|
||||
-DLLVM_OPT="/usr/x86_64-w64-mingw32/bin/opt" \
|
||||
-DLLVM_SPIRV="/usr/x86_64-w64-mingw32/bin/llvm-spirv" \
|
||||
-DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-"
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
popd # ~/tmp
|
||||
|
||||
# Cleanup ~/tmp
|
||||
rm -rf ~/tmp
|
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-remove \
|
||||
zstd \
|
||||
g++-mingw-w64-i686 \
|
||||
g++-mingw-w64-x86-64
|
||||
|
||||
. .gitlab-ci/container/debian/x86_build-mingw-patch.sh
|
||||
. .gitlab-ci/container/debian/x86_build-mingw-source-deps.sh
|
@@ -15,15 +15,17 @@ STABLE_EPHEMERAL=" \
|
||||
python3-pip \
|
||||
"
|
||||
|
||||
# We need multiarch for Wine
|
||||
dpkg --add-architecture i386
|
||||
apt-get update
|
||||
|
||||
apt-get install -y --no-remove \
|
||||
$STABLE_EPHEMERAL \
|
||||
check \
|
||||
clang \
|
||||
cmake \
|
||||
libasan6 \
|
||||
libarchive-dev \
|
||||
libclang-cpp13-dev \
|
||||
libclang-cpp11-dev \
|
||||
libgbm-dev \
|
||||
libglvnd-dev \
|
||||
@@ -39,7 +41,6 @@ apt-get install -y --no-remove \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb1-dev \
|
||||
libxml2-dev \
|
||||
llvm-13-dev \
|
||||
llvm-11-dev \
|
||||
llvm-9-dev \
|
||||
ocl-icd-opencl-dev \
|
||||
@@ -48,11 +49,25 @@ apt-get install -y --no-remove \
|
||||
procps \
|
||||
spirv-tools \
|
||||
strace \
|
||||
time
|
||||
time \
|
||||
wine \
|
||||
wine32
|
||||
|
||||
|
||||
. .gitlab-ci/container/container_pre_build.sh
|
||||
|
||||
|
||||
# Debian's pkg-config wrapers for mingw are broken, and there's no sign that
|
||||
# they're going to be fixed, so we'll just have to fix it ourselves
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
|
||||
cat >/usr/local/bin/x86_64-w64-mingw32-pkg-config <<EOF
|
||||
#!/bin/sh
|
||||
|
||||
PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig pkg-config \$@
|
||||
EOF
|
||||
chmod +x /usr/local/bin/x86_64-w64-mingw32-pkg-config
|
||||
|
||||
|
||||
# dependencies where we want a specific version
|
||||
export XORG_RELEASES=https://xorg.freedesktop.org/releases/individual
|
||||
|
||||
@@ -74,9 +89,10 @@ cd shader-db
|
||||
make
|
||||
popd
|
||||
|
||||
git clone https://github.com/microsoft/DirectX-Headers -b v1.606.3 --depth 1
|
||||
mkdir -p DirectX-Headers/build
|
||||
pushd DirectX-Headers/build
|
||||
git clone https://github.com/microsoft/DirectX-Headers -b v1.0.1 --depth 1
|
||||
pushd DirectX-Headers
|
||||
mkdir build
|
||||
cd build
|
||||
meson .. --backend=ninja --buildtype=release -Dbuild-test=false
|
||||
ninja
|
||||
ninja install
|
||||
|
@@ -1,8 +0,0 @@
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(CMAKE_SYSROOT /usr/x86_64-w64-mingw32/)
|
||||
set(ENV{PKG_CONFIG} /usr/x86_64-w64-mingw32/bin/pkg-config)
|
||||
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
|
@@ -5,7 +5,7 @@ set -o xtrace
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get install -y ca-certificates gnupg2 software-properties-common
|
||||
apt-get install -y ca-certificates
|
||||
|
||||
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
|
||||
|
||||
@@ -19,10 +19,6 @@ STABLE_EPHEMERAL=" \
|
||||
python3-wheel \
|
||||
"
|
||||
|
||||
# Add llvm 13 to the build image
|
||||
apt-key add .gitlab-ci/container/debian/llvm-snapshot.gpg.key
|
||||
add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main"
|
||||
|
||||
apt-get update
|
||||
apt-get dist-upgrade -y
|
||||
|
||||
@@ -31,7 +27,6 @@ apt-get install -y --no-remove \
|
||||
git-lfs \
|
||||
libasan6 \
|
||||
libexpat1 \
|
||||
libllvm13 \
|
||||
libllvm11 \
|
||||
libllvm9 \
|
||||
liblz4-1 \
|
||||
|
@@ -13,7 +13,6 @@ STABLE_EPHEMERAL=" \
|
||||
bison \
|
||||
bzip2 \
|
||||
ccache \
|
||||
clang-13 \
|
||||
clang-11 \
|
||||
cmake \
|
||||
flex \
|
||||
@@ -21,7 +20,6 @@ STABLE_EPHEMERAL=" \
|
||||
glslang-tools \
|
||||
libasound2-dev \
|
||||
libcap-dev \
|
||||
libclang-cpp13-dev \
|
||||
libclang-cpp11-dev \
|
||||
libelf-dev \
|
||||
libexpat1-dev \
|
||||
@@ -39,7 +37,6 @@ STABLE_EPHEMERAL=" \
|
||||
libxext-dev \
|
||||
libxkbcommon-dev \
|
||||
libxrender-dev \
|
||||
llvm-13-dev \
|
||||
llvm-11-dev \
|
||||
llvm-spirv \
|
||||
make \
|
||||
@@ -51,15 +48,11 @@ STABLE_EPHEMERAL=" \
|
||||
xz-utils \
|
||||
"
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install -y --no-remove \
|
||||
$STABLE_EPHEMERAL \
|
||||
clinfo \
|
||||
iptables \
|
||||
libclang-common-13-dev \
|
||||
libclang-common-11-dev \
|
||||
libclang-cpp13 \
|
||||
libclang-cpp11 \
|
||||
libcap2 \
|
||||
libegl1 \
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# The relative paths in this file only become valid at runtime.
|
||||
# shellcheck disable=SC1091
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
@@ -16,7 +14,6 @@ STABLE_EPHEMERAL=" \
|
||||
g++-mingw-w64-x86-64-posix \
|
||||
glslang-tools \
|
||||
libexpat1-dev \
|
||||
gnupg2 \
|
||||
libgbm-dev \
|
||||
libgles2-mesa-dev \
|
||||
liblz4-dev \
|
||||
@@ -38,21 +35,14 @@ STABLE_EPHEMERAL=" \
|
||||
p7zip \
|
||||
patch \
|
||||
pkg-config \
|
||||
python3-dev \
|
||||
python3-distutils \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
software-properties-common \
|
||||
wget \
|
||||
wine64-tools \
|
||||
xz-utils \
|
||||
"
|
||||
|
||||
apt-get install -y --no-remove \
|
||||
$STABLE_EPHEMERAL \
|
||||
libxcb-shm0 \
|
||||
pciutils \
|
||||
python3-lxml \
|
||||
python3-simplejson \
|
||||
xinit \
|
||||
@@ -62,16 +52,12 @@ apt-get install -y --no-remove \
|
||||
# We need multiarch for Wine
|
||||
dpkg --add-architecture i386
|
||||
|
||||
# Install a more recent version of Wine than exists in Debian.
|
||||
apt-key add .gitlab-ci/container/debian/winehq.gpg.key
|
||||
apt-add-repository https://dl.winehq.org/wine-builds/debian/
|
||||
apt update -qyy
|
||||
apt-get update
|
||||
|
||||
# Needed for Valve's tracing jobs to collect information about the graphics
|
||||
# hardware on the test devices.
|
||||
pip3 install gfxinfo-mupuf==0.0.9
|
||||
|
||||
apt install -y --no-remove --install-recommends winehq-stable
|
||||
apt-get install -y --no-remove \
|
||||
wine \
|
||||
wine32 \
|
||||
wine64
|
||||
|
||||
function setup_wine() {
|
||||
export WINEDEBUG="-all"
|
||||
@@ -100,44 +86,28 @@ EOF
|
||||
|
||||
############### Install DXVK
|
||||
|
||||
dxvk_install_release() {
|
||||
local DXVK_VERSION=${1:-"1.10.1"}
|
||||
DXVK_VERSION="1.8.1"
|
||||
|
||||
wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
|
||||
tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
|
||||
"dxvk-${DXVK_VERSION}"/setup_dxvk.sh install
|
||||
rm -rf "dxvk-${DXVK_VERSION}"
|
||||
rm dxvk-"${DXVK_VERSION}".tar.gz
|
||||
}
|
||||
|
||||
# Install from a Github PR number
|
||||
dxvk_install_pr() {
|
||||
local __prnum=$1
|
||||
|
||||
# NOTE: Clone all the ensite history of the repo so as not to think
|
||||
# harder about cloning just enough for 'git describe' to work. 'git
|
||||
# describe' is used by the dxvk build system to generate a
|
||||
# dxvk_version Meson variable, which is nice-to-have.
|
||||
git clone https://github.com/doitsujin/dxvk
|
||||
pushd dxvk
|
||||
git fetch origin pull/"$__prnum"/head:pr
|
||||
git checkout pr
|
||||
./package-release.sh pr ../dxvk-build --no-package
|
||||
popd
|
||||
pushd ./dxvk-build/dxvk-pr
|
||||
./setup_dxvk.sh install
|
||||
popd
|
||||
rm -rf ./dxvk-build ./dxvk
|
||||
}
|
||||
|
||||
# Sets up the WINEPREFIX for the DXVK installation commands below.
|
||||
setup_wine "/dxvk-wine64"
|
||||
dxvk_install_release "1.10.1"
|
||||
#dxvk_install_pr 2359
|
||||
|
||||
############### Install apitrace binaries for wine
|
||||
wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
|
||||
tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
|
||||
dxvk-"${DXVK_VERSION}"/setup_dxvk.sh install
|
||||
rm -rf dxvk-"${DXVK_VERSION}"
|
||||
rm dxvk-"${DXVK_VERSION}".tar.gz
|
||||
|
||||
############### Install Windows' apitrace binaries
|
||||
|
||||
APITRACE_VERSION="10.0"
|
||||
APITRACE_VERSION_DATE=""
|
||||
|
||||
wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
|
||||
7zr x "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z" \
|
||||
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
|
||||
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"
|
||||
mv "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64" /apitrace-msvc-win64
|
||||
rm "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
|
||||
|
||||
. .gitlab-ci/container/install-wine-apitrace.sh
|
||||
# Add the apitrace path to the registry
|
||||
wine \
|
||||
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" \
|
||||
@@ -174,10 +144,6 @@ PIGLIT_BUILD_TARGETS="piglit_replayer" . .gitlab-ci/container/build-piglit.sh
|
||||
|
||||
. .gitlab-ci/container/build-deqp.sh
|
||||
|
||||
############### Build apitrace
|
||||
|
||||
. .gitlab-ci/container/build-apitrace.sh
|
||||
|
||||
############### Build gfxreconstruct
|
||||
|
||||
. .gitlab-ci/container/build-gfxreconstruct.sh
|
||||
|
@@ -25,7 +25,6 @@ dnf install -y --setopt=install_weak_deps=False \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
gettext \
|
||||
glslang \
|
||||
kernel-headers \
|
||||
llvm-devel \
|
||||
clang-devel \
|
||||
|
@@ -23,9 +23,6 @@
|
||||
variables:
|
||||
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${FDO_DISTRIBUTION_TAG}"
|
||||
|
||||
.use-wine:
|
||||
variables:
|
||||
WINEPATH: "/usr/x86_64-w64-mingw32/bin;/usr/x86_64-w64-mingw32/lib;/usr/lib/gcc/x86_64-w64-mingw32/10-posix;c:/windows;c:/windows/system32"
|
||||
|
||||
# Build the CI docker images.
|
||||
#
|
||||
@@ -49,11 +46,10 @@
|
||||
extends:
|
||||
- .container-rules
|
||||
- .incorporate-templates-commit
|
||||
- .use-wine
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: bullseye-slim
|
||||
FDO_REPO_SUFFIX: $CI_JOB_NAME
|
||||
FDO_DISTRIBUTION_EXEC: 'env "WINEPATH=${WINEPATH}" FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
|
||||
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
|
||||
# no need to pull the whole repo to build the container image
|
||||
GIT_STRATEGY: none
|
||||
|
||||
@@ -62,7 +58,7 @@
|
||||
- .container
|
||||
- .incorporate-base-tag+templates-commit
|
||||
# Don't want the .container rules
|
||||
- .build-rules
|
||||
- .ci-run-policy
|
||||
|
||||
# Debian 11 based x86 build image base
|
||||
debian/x86_build-base:
|
||||
@@ -117,23 +113,6 @@ debian/i386_build:
|
||||
needs:
|
||||
- debian/i386_build
|
||||
|
||||
# Debian 11 based x86-mingw cross main build image
|
||||
debian/x86_build-mingw:
|
||||
extends:
|
||||
- .use-debian/x86_build-base
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-x86_build_mingw ${DEBIAN_BUILD_MINGW_TAG}
|
||||
|
||||
.use-debian/x86_build_mingw:
|
||||
extends:
|
||||
- .set-image-base-tag
|
||||
variables:
|
||||
MESA_BASE_TAG: *debian-x86_build-base
|
||||
MESA_IMAGE_PATH: ${DEBIAN_X86_BUILD_MINGW_IMAGE_PATH}
|
||||
MESA_IMAGE_TAG: *debian-x86_build_mingw
|
||||
needs:
|
||||
- debian/x86_build-mingw
|
||||
|
||||
# Debian 11 based ppc64el cross-build image
|
||||
debian/ppc64el_build:
|
||||
extends:
|
||||
@@ -206,7 +185,7 @@ debian/x86_test-gl:
|
||||
extends: .use-debian/x86_test-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_EXEC: 'env KERNEL_URL=${KERNEL_URL} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
|
||||
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.17-for-mesa-ci-b78f7870d97b/linux-v5.17-for-mesa-ci-b78f7870d97b.tar.bz2"
|
||||
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.16-for-mesa-ci-991fec6622591/linux-v5.16-for-mesa-ci-991fec6622591.tar.bz2"
|
||||
MESA_IMAGE_TAG: &debian-x86_test-gl ${DEBIAN_X86_TEST_GL_TAG}
|
||||
|
||||
.use-debian/x86_test-gl:
|
||||
@@ -277,7 +256,7 @@ fedora/x86_build:
|
||||
|
||||
.kernel+rootfs:
|
||||
extends:
|
||||
- .build-rules
|
||||
- .ci-run-policy
|
||||
stage: container
|
||||
variables:
|
||||
GIT_STRATEGY: fetch
|
||||
@@ -328,7 +307,7 @@ debian/arm_test:
|
||||
- .fdo.container-build@debian
|
||||
- .container
|
||||
# Don't want the .container rules
|
||||
- .build-rules
|
||||
- .ci-run-policy
|
||||
needs:
|
||||
- kernel+rootfs_arm64
|
||||
- kernel+rootfs_armhf
|
||||
@@ -368,7 +347,7 @@ debian/arm_test:
|
||||
|
||||
.windows_container_build:
|
||||
inherit:
|
||||
default: [retry]
|
||||
default: false
|
||||
extends:
|
||||
- .container
|
||||
- .windows-docker-vs2019
|
||||
@@ -382,64 +361,47 @@ debian/arm_test:
|
||||
tags:
|
||||
- windows
|
||||
- shell
|
||||
- "2022"
|
||||
- "1809"
|
||||
- mesa
|
||||
script:
|
||||
- .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE ${DOCKERFILE} ${MESA_BASE_IMAGE}
|
||||
|
||||
windows_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
extends:
|
||||
- .windows_container_build
|
||||
variables:
|
||||
MESA_IMAGE_PATH: &windows_vs_image_path ${WINDOWS_X64_VS_PATH}
|
||||
MESA_IMAGE_TAG: &windows_vs_image_tag ${WINDOWS_X64_VS_TAG}
|
||||
DOCKERFILE: Dockerfile_vs
|
||||
MESA_BASE_IMAGE: "mcr.microsoft.com/windows/server:ltsc2022"
|
||||
|
||||
windows_build_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
default: false
|
||||
extends:
|
||||
- .windows_container_build
|
||||
rules:
|
||||
- if: '$MICROSOFT_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.build-rules, rules]
|
||||
variables:
|
||||
MESA_IMAGE_PATH: &windows_build_image_path ${WINDOWS_X64_BUILD_PATH}
|
||||
MESA_IMAGE_TAG: &windows_build_image_tag ${WINDOWS_X64_BUILD_TAG}
|
||||
DOCKERFILE: Dockerfile_build
|
||||
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
|
||||
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
|
||||
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
|
||||
timeout: 2h 30m # LLVM takes ages
|
||||
needs:
|
||||
- windows_vs2019
|
||||
|
||||
windows_test_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
default: false
|
||||
extends:
|
||||
- .windows_container_build
|
||||
rules:
|
||||
- if: '$MICROSOFT_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.build-rules, rules]
|
||||
- !reference [.ci-run-policy, rules]
|
||||
variables:
|
||||
MESA_IMAGE_PATH: &windows_test_image_path ${WINDOWS_X64_TEST_PATH}
|
||||
MESA_IMAGE_TAG: &windows_test_image_tag ${WINDOWS_X64_BUILD_TAG}--${WINDOWS_X64_TEST_TAG}
|
||||
DOCKERFILE: Dockerfile_test
|
||||
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
|
||||
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
|
||||
# Right now this only needs the VS install to get DXIL.dll. Maybe see about decoupling this at some point
|
||||
MESA_BASE_IMAGE_PATH: *windows_build_image_path
|
||||
MESA_BASE_IMAGE_TAG: *windows_build_image_tag
|
||||
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
|
||||
script:
|
||||
- .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE Dockerfile_test ${MESA_BASE_IMAGE}
|
||||
needs:
|
||||
- windows_vs2019
|
||||
- windows_build_vs2019
|
||||
|
||||
.use-windows_build_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
default: false
|
||||
extends: .windows-docker-vs2019
|
||||
image: "$MESA_IMAGE"
|
||||
variables:
|
||||
@@ -450,7 +412,7 @@ windows_test_vs2019:
|
||||
|
||||
.use-windows_test_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
default: false
|
||||
extends: .windows-docker-vs2019
|
||||
image: "$MESA_IMAGE"
|
||||
variables:
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
APITRACE_VERSION="11.1"
|
||||
APITRACE_VERSION_DATE=""
|
||||
|
||||
wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
|
||||
7zr x "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z" \
|
||||
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
|
||||
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"
|
||||
mv "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64" /apitrace-msvc-win64
|
||||
rm "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
|
||||
|
||||
|
@@ -25,7 +25,6 @@ check_minio "${CI_PROJECT_PATH}"
|
||||
if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
|
||||
GCC_ARCH="aarch64-linux-gnu"
|
||||
KERNEL_ARCH="arm64"
|
||||
SKQP_ARCH="arm64"
|
||||
DEFCONFIG="arch/arm64/configs/defconfig"
|
||||
DEVICE_TREES="arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb"
|
||||
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dtb"
|
||||
@@ -36,13 +35,11 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
|
||||
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dtb"
|
||||
DEVICE_TREES+=" arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dtb"
|
||||
DEVICE_TREES+=" arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dtb"
|
||||
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r5.dtb"
|
||||
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots.dtb"
|
||||
KERNEL_IMAGE_NAME="Image"
|
||||
|
||||
elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
|
||||
GCC_ARCH="arm-linux-gnueabihf"
|
||||
KERNEL_ARCH="arm"
|
||||
SKQP_ARCH="arm"
|
||||
DEFCONFIG="arch/arm/configs/multi_v7_defconfig"
|
||||
DEVICE_TREES="arch/arm/boot/dts/rk3288-veyron-jaq.dtb"
|
||||
DEVICE_TREES+=" arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dtb"
|
||||
@@ -52,7 +49,6 @@ elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
|
||||
else
|
||||
GCC_ARCH="x86_64-linux-gnu"
|
||||
KERNEL_ARCH="x86_64"
|
||||
SKQP_ARCH="x64"
|
||||
DEFCONFIG="arch/x86/configs/x86_64_defconfig"
|
||||
DEVICE_TREES=""
|
||||
KERNEL_IMAGE_NAME="bzImage"
|
||||
@@ -156,12 +152,12 @@ mv /deqp /lava-files/rootfs-${DEBIAN_ARCH}/.
|
||||
|
||||
|
||||
############### Build SKQP
|
||||
if [[ "$DEBIAN_ARCH" = "arm64" ]] \
|
||||
|| [[ "$DEBIAN_ARCH" = "amd64" ]]; then
|
||||
. .gitlab-ci/container/build-skqp.sh
|
||||
if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
|
||||
SKQP_ARCH="arm64" . .gitlab-ci/container/build-skqp.sh
|
||||
mv /skqp /lava-files/rootfs-${DEBIAN_ARCH}/.
|
||||
fi
|
||||
|
||||
|
||||
############### Build piglit
|
||||
PIGLIT_OPTS="-DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
|
||||
mv /piglit /lava-files/rootfs-${DEBIAN_ARCH}/.
|
||||
@@ -214,9 +210,7 @@ fi
|
||||
set -e
|
||||
|
||||
cp .gitlab-ci/container/create-rootfs.sh /lava-files/rootfs-${DEBIAN_ARCH}/.
|
||||
cp .gitlab-ci/container/debian/llvm-snapshot.gpg.key /lava-files/rootfs-${DEBIAN_ARCH}/.
|
||||
chroot /lava-files/rootfs-${DEBIAN_ARCH} sh /create-rootfs.sh
|
||||
rm /lava-files/rootfs-${DEBIAN_ARCH}/llvm-snapshot.gpg.key
|
||||
rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh
|
||||
|
||||
|
||||
|
@@ -4,7 +4,7 @@ set -e
|
||||
|
||||
VSOCK_STDOUT=$1
|
||||
VSOCK_STDERR=$2
|
||||
VM_TEMP_DIR=$3
|
||||
VSOCK_TEMP_DIR=$3
|
||||
|
||||
mount -t proc none /proc
|
||||
mount -t sysfs none /sys
|
||||
@@ -12,7 +12,7 @@ mkdir -p /dev/pts
|
||||
mount -t devpts devpts /dev/pts
|
||||
mount -t tmpfs tmpfs /tmp
|
||||
|
||||
. ${VM_TEMP_DIR}/crosvm-env.sh
|
||||
. ${VSOCK_TEMP_DIR}/crosvm-env.sh
|
||||
|
||||
# .gitlab-ci.yml script variable is using relative paths to install directory,
|
||||
# so change to that dir before running `crosvm-script`
|
||||
@@ -31,7 +31,7 @@ DMESG_PID=$!
|
||||
# Transfer the errors and crosvm-script output via a pair of virtio-vsocks
|
||||
socat -d -u pipe:${STDERR_FIFO} vsock-listen:${VSOCK_STDERR} &
|
||||
socat -d -U vsock-listen:${VSOCK_STDOUT} \
|
||||
system:"stdbuf -eL sh ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork
|
||||
system:"stdbuf -eL sh ${VSOCK_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VSOCK_TEMP_DIR}/exit_code",nofork
|
||||
|
||||
kill ${DMESG_PID}
|
||||
wait
|
||||
|
@@ -2,10 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
# If run outside of a deqp-runner invoction (e.g. piglit trace replay), then act
|
||||
# the same as the first thread in its threadpool.
|
||||
THREAD=${DEQP_RUNNER_THREAD:-0}
|
||||
|
||||
#
|
||||
# Helper to generate CIDs for virtio-vsock based communication with processes
|
||||
# running inside crosvm guests.
|
||||
@@ -21,7 +17,7 @@ THREAD=${DEQP_RUNNER_THREAD:-0}
|
||||
# - VSOCK_STDOUT, VSOCK_STDERR: the port numbers the guest should accept
|
||||
# vsock connections on in order to transfer output messages
|
||||
#
|
||||
# - VM_TEMP_DIR: the temporary directory path used to pass additional
|
||||
# - VSOCK_TEMP_DIR: the temporary directory path used to pass additional
|
||||
# context data towards the guest
|
||||
#
|
||||
set_vsock_context() {
|
||||
@@ -30,12 +26,19 @@ set_vsock_context() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
VM_TEMP_DIR="/tmp-vm.${THREAD}"
|
||||
# Clear out any leftover files from a previous run.
|
||||
rm -rf $VM_TEMP_DIR
|
||||
mkdir $VM_TEMP_DIR || return 1
|
||||
local dir_prefix="/tmp-vsock."
|
||||
local cid_prefix=0
|
||||
unset VSOCK_TEMP_DIR
|
||||
|
||||
VSOCK_CID=$(((CI_JOB_ID & 0x1ffffff) | ((${THREAD} & 0x7f) << 25)))
|
||||
while [ ${cid_prefix} -lt 128 ]; do
|
||||
VSOCK_TEMP_DIR=${dir_prefix}${cid_prefix}
|
||||
mkdir "${VSOCK_TEMP_DIR}" >/dev/null 2>&1 && break || unset VSOCK_TEMP_DIR
|
||||
cid_prefix=$((cid_prefix + 1))
|
||||
done
|
||||
|
||||
[ -n "${VSOCK_TEMP_DIR}" ] || return 1
|
||||
|
||||
VSOCK_CID=$(((CI_JOB_ID & 0x1ffffff) | ((cid_prefix & 0x7f) << 25)))
|
||||
VSOCK_STDOUT=5001
|
||||
VSOCK_STDERR=5002
|
||||
|
||||
@@ -48,26 +51,19 @@ if [ -n "${1##*.sh}" ] && [ -z "${1##*"deqp"*}" ]; then
|
||||
export DEQP_BIN_DIR
|
||||
fi
|
||||
|
||||
VM_SOCKET=crosvm-${THREAD}.sock
|
||||
|
||||
# Terminate any existing crosvm, if a previous invocation of this shell script
|
||||
# was terminated due to timeouts. This "vm stop" may fail if the crosvm died
|
||||
# without cleaning itself up.
|
||||
if [ -e $VM_SOCKET ]; then
|
||||
crosvm stop $VM_SOCKET || rm -rf $VM_SOCKET
|
||||
# Wait for socats from that invocation to drain
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; }
|
||||
|
||||
# Ensure cleanup on script exit
|
||||
trap 'exit ${exit_code}' INT TERM
|
||||
trap 'exit_code=$?; [ -z "${CROSVM_PID}${SOCAT_PIDS}" ] || kill ${CROSVM_PID} ${SOCAT_PIDS} >/dev/null 2>&1 || true; rm -rf ${VSOCK_TEMP_DIR}' EXIT
|
||||
|
||||
# Securely pass the current variables to the crosvm environment
|
||||
echo "Variables passed through:"
|
||||
SCRIPT_DIR=$(readlink -en "${0%/*}")
|
||||
${SCRIPT_DIR}/common/generate-env.sh | tee ${VM_TEMP_DIR}/crosvm-env.sh
|
||||
${SCRIPT_DIR}/common/generate-env.sh | tee ${VSOCK_TEMP_DIR}/crosvm-env.sh
|
||||
|
||||
# Set the crosvm-script as the arguments of the current script
|
||||
echo "$@" > ${VM_TEMP_DIR}/crosvm-script.sh
|
||||
echo "$@" > ${VSOCK_TEMP_DIR}/crosvm-script.sh
|
||||
|
||||
# Setup networking
|
||||
/usr/sbin/iptables-legacy -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
||||
@@ -75,14 +71,16 @@ echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
|
||||
# Start background processes to receive output from guest
|
||||
socat -u vsock-connect:${VSOCK_CID}:${VSOCK_STDERR},retry=200,interval=0.1 stderr &
|
||||
SOCAT_PIDS=$!
|
||||
socat -u vsock-connect:${VSOCK_CID}:${VSOCK_STDOUT},retry=200,interval=0.1 stdout &
|
||||
SOCAT_PIDS="${SOCAT_PIDS} $!"
|
||||
|
||||
# Prepare to start crosvm
|
||||
unset DISPLAY
|
||||
unset XDG_RUNTIME_DIR
|
||||
|
||||
CROSVM_KERN_ARGS="quiet console=null root=my_root rw rootfstype=virtiofs ip=192.168.30.2::192.168.30.1:255.255.255.0:crosvm:eth0"
|
||||
CROSVM_KERN_ARGS="${CROSVM_KERN_ARGS} init=${SCRIPT_DIR}/crosvm-init.sh -- ${VSOCK_STDOUT} ${VSOCK_STDERR} ${VM_TEMP_DIR}"
|
||||
CROSVM_KERN_ARGS="${CROSVM_KERN_ARGS} init=${SCRIPT_DIR}/crosvm-init.sh -- ${VSOCK_STDOUT} ${VSOCK_STDERR} ${VSOCK_TEMP_DIR}"
|
||||
|
||||
[ "${CROSVM_GALLIUM_DRIVER}" = "llvmpipe" ] && \
|
||||
CROSVM_LIBGL_ALWAYS_SOFTWARE=true || CROSVM_LIBGL_ALWAYS_SOFTWARE=false
|
||||
@@ -97,15 +95,21 @@ crosvm run \
|
||||
--gpu "${CROSVM_GPU_ARGS}" -m 4096 -c 2 --disable-sandbox \
|
||||
--shared-dir /:my_root:type=fs:writeback=true:timeout=60:cache=always \
|
||||
--host_ip "192.168.30.1" --netmask "255.255.255.0" --mac "AA:BB:CC:00:00:12" \
|
||||
-s $VM_SOCKET \
|
||||
--cid ${VSOCK_CID} -p "${CROSVM_KERN_ARGS}" \
|
||||
/lava-files/${KERNEL_IMAGE_NAME:-bzImage} > ${VM_TEMP_DIR}/crosvm 2>&1
|
||||
/lava-files/${KERNEL_IMAGE_NAME:-bzImage} > ${VSOCK_TEMP_DIR}/crosvm 2>&1 &
|
||||
|
||||
# Wait for crosvm process to terminate
|
||||
CROSVM_PID=$!
|
||||
wait ${CROSVM_PID}
|
||||
CROSVM_RET=$?
|
||||
unset CROSVM_PID
|
||||
|
||||
[ ${CROSVM_RET} -eq 0 ] && {
|
||||
# socat background processes terminate gracefully on remote peers exit
|
||||
wait
|
||||
unset SOCAT_PIDS
|
||||
# The actual return code is the crosvm guest script's exit code
|
||||
CROSVM_RET=$(cat ${VM_TEMP_DIR}/exit_code 2>/dev/null)
|
||||
CROSVM_RET=$(cat ${VSOCK_TEMP_DIR}/exit_code 2>/dev/null)
|
||||
# Force error when the guest script's exit code is not available
|
||||
CROSVM_RET=${CROSVM_RET:-1}
|
||||
}
|
||||
@@ -114,7 +118,7 @@ CROSVM_RET=$?
|
||||
[ ${CROSVM_RET} -eq 0 ] || {
|
||||
set +x
|
||||
echo "Dumping crosvm output.." >&2
|
||||
cat ${VM_TEMP_DIR}/crosvm >&2
|
||||
cat ${VSOCK_TEMP_DIR}/crosvm >&2
|
||||
set -x
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
echo -e "\e[0Ksection_start:$(date +%s):test_setup[collapsed=true]\r\e[0Kpreparing test setup"
|
||||
|
||||
|
@@ -1,27 +1,21 @@
|
||||
variables:
|
||||
DEBIAN_X86_BUILD_BASE_IMAGE: "debian/x86_build-base"
|
||||
DEBIAN_BASE_TAG: "2022-07-01-bb-llvm13"
|
||||
DEBIAN_BASE_TAG: "2022-02-21-libdrm"
|
||||
|
||||
DEBIAN_X86_BUILD_IMAGE_PATH: "debian/x86_build"
|
||||
DEBIAN_BUILD_TAG: "2022-07-14-directx-headers"
|
||||
|
||||
DEBIAN_X86_BUILD_MINGW_IMAGE_PATH: "debian/x86_build-mingw"
|
||||
DEBIAN_BUILD_MINGW_TAG: "2022-07-14-directx-headers"
|
||||
DEBIAN_BUILD_TAG: "2022-02-21-libdrm"
|
||||
|
||||
DEBIAN_X86_TEST_BASE_IMAGE: "debian/x86_test-base"
|
||||
|
||||
DEBIAN_X86_TEST_IMAGE_PATH: "debian/x86_test-gl"
|
||||
DEBIAN_X86_TEST_GL_TAG: "2022-07-06-virgl-update"
|
||||
DEBIAN_X86_TEST_VK_TAG: "2022-07-18-apitrace-11-1"
|
||||
DEBIAN_X86_TEST_GL_TAG: "2022-04-07-virgl-crosvm"
|
||||
DEBIAN_X86_TEST_VK_TAG: "2022-04-05-deqp-runner"
|
||||
|
||||
FEDORA_X86_BUILD_TAG: "2022-04-24-spirv-tools-5"
|
||||
KERNEL_ROOTFS_TAG: "2022-07-06-virgl-update"
|
||||
|
||||
WINDOWS_X64_VS_PATH: "windows/x64_vs"
|
||||
WINDOWS_X64_VS_TAG: "2022-06-15-vs-winsdk"
|
||||
FEDORA_X86_BUILD_TAG: "2022-03-18-spirv-tools-5"
|
||||
KERNEL_ROOTFS_TAG: "2022-04-07-prefix-skqp"
|
||||
|
||||
WINDOWS_X64_BUILD_PATH: "windows/x64_build"
|
||||
WINDOWS_X64_BUILD_TAG: "2022-06-15-vs-winsdk"
|
||||
WINDOWS_X64_BUILD_TAG: "2022-20-02-base_split"
|
||||
|
||||
WINDOWS_X64_TEST_PATH: "windows/x64_test"
|
||||
WINDOWS_X64_TEST_TAG: "2022-06-15-vs-winsdk"
|
||||
WINDOWS_X64_TEST_TAG: "2022-04-13-dozen_ci"
|
||||
|
@@ -1,28 +0,0 @@
|
||||
from datetime import timedelta
|
||||
|
||||
|
||||
class MesaCIException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class MesaCITimeoutError(MesaCIException):
|
||||
def __init__(self, *args, timeout_duration: timedelta) -> None:
|
||||
super().__init__(*args)
|
||||
self.timeout_duration = timeout_duration
|
||||
|
||||
|
||||
class MesaCIRetryError(MesaCIException):
|
||||
def __init__(self, *args, retry_count: int) -> None:
|
||||
super().__init__(*args)
|
||||
self.retry_count = retry_count
|
||||
|
||||
|
||||
class MesaCIParseException(MesaCIException):
|
||||
pass
|
||||
|
||||
|
||||
class MesaCIKnownIssueException(MesaCIException):
|
||||
"""Exception raised when the Mesa CI script finds something in the logs that
|
||||
is known to cause the LAVA job to eventually fail"""
|
||||
|
||||
pass
|
@@ -1,4 +1,6 @@
|
||||
.lava-test:
|
||||
extends:
|
||||
- .ci-run-policy
|
||||
# Cancel job if a newer commit is pushed to the same branch
|
||||
interruptible: true
|
||||
variables:
|
||||
|
@@ -31,5 +31,4 @@ TEST_DIR=${CI_PROJECT_DIR}/.gitlab-ci/tests
|
||||
PYTHONPATH="${TEST_DIR}:${PYTHONPATH}" python3 -m \
|
||||
pytest "${TEST_DIR}" \
|
||||
-W ignore::DeprecationWarning \
|
||||
--junitxml=artifacts/ci_scripts_report.xml \
|
||||
-m 'not slow'
|
||||
--junitxml=artifacts/ci_scripts_report.xml
|
||||
|
@@ -28,7 +28,7 @@ ci-fairy minio cp job-rootfs-overlay.tar.gz "minio://${JOB_ROOTFS_OVERLAY_PATH}"
|
||||
|
||||
touch results/lava.log
|
||||
tail -f results/lava.log &
|
||||
PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
|
||||
artifacts/lava/lava_job_submitter.py \
|
||||
--dump-yaml \
|
||||
--pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
|
||||
--rootfs-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
|
||||
@@ -45,6 +45,4 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
|
||||
--kernel-image-type "${KERNEL_IMAGE_TYPE}" \
|
||||
--boot-method ${BOOT_METHOD} \
|
||||
--visibility-group ${VISIBILITY_GROUP} \
|
||||
--lava-tags "${LAVA_TAGS}" \
|
||||
--mesa-job-name "$CI_JOB_NAME" \
|
||||
>> results/lava.log
|
||||
--lava-tags "${LAVA_TAGS}" >> results/lava.log
|
||||
|
@@ -1,46 +1,42 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (C) 2020 - 2022 Collabora Limited
|
||||
# Authors:
|
||||
# Gustavo Padovan <gustavo.padovan@collabora.com>
|
||||
# Guilherme Gallo <guilherme.gallo@collabora.com>
|
||||
# Copyright (C) 2020, 2021 Collabora Limited
|
||||
# Author: Gustavo Padovan <gustavo.padovan@collabora.com>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
"""Send a job to LAVA, track it and collect log back"""
|
||||
|
||||
|
||||
import argparse
|
||||
import contextlib
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
import urllib.parse
|
||||
import xmlrpc.client
|
||||
import xmlrpc
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from os import getenv
|
||||
from typing import Any, Optional
|
||||
|
||||
import lavacli
|
||||
import yaml
|
||||
from lava.exceptions import (
|
||||
MesaCIException,
|
||||
MesaCIKnownIssueException,
|
||||
MesaCIParseException,
|
||||
MesaCIRetryError,
|
||||
MesaCITimeoutError,
|
||||
)
|
||||
from lava.utils import (
|
||||
CONSOLE_LOG,
|
||||
GitlabSection,
|
||||
LogFollower,
|
||||
LogSectionType,
|
||||
fatal_err,
|
||||
hide_sensitive_data,
|
||||
print_log,
|
||||
)
|
||||
from lavacli.utils import loader
|
||||
|
||||
# Timeout in seconds to decide if the device from the dispatched LAVA job has
|
||||
@@ -57,8 +53,17 @@ LOG_POLLING_TIME_SEC = int(getenv("LAVA_LOG_POLLING_TIME_SEC", 5))
|
||||
# How many retries should be made when a timeout happen.
|
||||
NUMBER_OF_RETRIES_TIMEOUT_DETECTION = int(getenv("LAVA_NUMBER_OF_RETRIES_TIMEOUT_DETECTION", 2))
|
||||
|
||||
# How many attempts should be made when a timeout happen during LAVA device boot.
|
||||
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
|
||||
|
||||
def print_log(msg):
|
||||
print("{}: {}".format(datetime.now(), msg))
|
||||
|
||||
def fatal_err(msg):
|
||||
print_log(msg)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def hide_sensitive_data(yaml_data, hide_tag="HIDEME"):
|
||||
return "".join(line for line in yaml_data.splitlines(True) if hide_tag not in line)
|
||||
|
||||
|
||||
def generate_lava_yaml(args):
|
||||
@@ -71,13 +76,9 @@ def generate_lava_yaml(args):
|
||||
'context': {
|
||||
'extra_nfsroot_args': ' init=/init rootwait usbcore.quirks=0bda:8153:k'
|
||||
},
|
||||
"timeouts": {
|
||||
"job": {"minutes": args.job_timeout},
|
||||
"action": {"minutes": 3},
|
||||
"actions": {
|
||||
"depthcharge-action": {
|
||||
"minutes": 3 * NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
}
|
||||
'timeouts': {
|
||||
'job': {
|
||||
'minutes': args.job_timeout
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -108,22 +109,20 @@ def generate_lava_yaml(args):
|
||||
|
||||
# always boot over NFS
|
||||
boot = {
|
||||
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
"method": args.boot_method,
|
||||
"commands": "nfs",
|
||||
"prompts": ["lava-shell:"],
|
||||
'timeout': { 'minutes': 25 },
|
||||
'method': args.boot_method,
|
||||
'commands': 'nfs',
|
||||
'prompts': ['lava-shell:'],
|
||||
}
|
||||
|
||||
# skeleton test definition: only declaring each job as a single 'test'
|
||||
# since LAVA's test parsing is not useful to us
|
||||
run_steps = []
|
||||
test = {
|
||||
'timeout': { 'minutes': args.job_timeout },
|
||||
'failure_retry': 1,
|
||||
'definitions': [ {
|
||||
'name': 'mesa',
|
||||
'from': 'inline',
|
||||
'lava-signal': 'kmsg',
|
||||
'path': 'inline/mesa.yaml',
|
||||
'repository': {
|
||||
'metadata': {
|
||||
@@ -133,8 +132,10 @@ def generate_lava_yaml(args):
|
||||
'scope': [ 'functional' ],
|
||||
'format': 'Lava-Test Test Definition 1.0',
|
||||
},
|
||||
'parse': {
|
||||
'pattern': r'hwci: (?P<test_case_id>\S*):\s+(?P<result>(pass|fail))'
|
||||
},
|
||||
'run': {
|
||||
"steps": run_steps
|
||||
},
|
||||
},
|
||||
} ],
|
||||
@@ -144,39 +145,27 @@ def generate_lava_yaml(args):
|
||||
# - inline .gitlab-ci/common/init-stage1.sh
|
||||
# - fetch and unpack per-pipeline build artifacts from build job
|
||||
# - fetch and unpack per-job environment from lava-submit.sh
|
||||
# - exec .gitlab-ci/common/init-stage2.sh
|
||||
# - exec .gitlab-ci/common/init-stage2.sh
|
||||
init_lines = []
|
||||
|
||||
with open(args.first_stage_init, 'r') as init_sh:
|
||||
run_steps += [ x.rstrip() for x in init_sh if not x.startswith('#') and x.rstrip() ]
|
||||
init_lines += [ x.rstrip() for x in init_sh if not x.startswith('#') and x.rstrip() ]
|
||||
|
||||
if args.jwt_file:
|
||||
with open(args.jwt_file) as jwt_file:
|
||||
run_steps += [
|
||||
"set +x",
|
||||
f'echo -n "{jwt_file.read()}" > "{args.jwt_file}" # HIDEME',
|
||||
"set -x",
|
||||
f'echo "export CI_JOB_JWT_FILE={args.jwt_file}" >> /set-job-env-vars.sh',
|
||||
]
|
||||
else:
|
||||
run_steps += [
|
||||
"echo Could not find jwt file, disabling MINIO requests...",
|
||||
"sed -i '/MINIO_RESULTS_UPLOAD/d' /set-job-env-vars.sh",
|
||||
with open(args.jwt_file) as jwt_file:
|
||||
init_lines += [
|
||||
"set +x",
|
||||
f'echo -n "{jwt_file.read()}" > "{args.jwt_file}" # HIDEME',
|
||||
"set -x",
|
||||
]
|
||||
|
||||
run_steps += [
|
||||
init_lines += [
|
||||
'mkdir -p {}'.format(args.ci_project_dir),
|
||||
'wget -S --progress=dot:giga -O- {} | tar -xz -C {}'.format(args.build_url, args.ci_project_dir),
|
||||
'wget -S --progress=dot:giga -O- {} | tar -xz -C /'.format(args.job_rootfs_overlay_url),
|
||||
|
||||
# Sleep a bit to give time for bash to dump shell xtrace messages into
|
||||
# console which may cause interleaving with LAVA_SIGNAL_STARTTC in some
|
||||
# devices like a618.
|
||||
'sleep 1',
|
||||
|
||||
# Putting CI_JOB name as the testcase name, it may help LAVA farm
|
||||
# maintainers with monitoring
|
||||
f"lava-test-case 'mesa-ci_{args.mesa_job_name}' --shell /init-stage2.sh",
|
||||
f'echo "export CI_JOB_JWT_FILE={args.jwt_file}" >> /set-job-env-vars.sh',
|
||||
'exec /init-stage2.sh',
|
||||
]
|
||||
test['definitions'][0]['repository']['run']['steps'] = init_lines
|
||||
|
||||
values['actions'] = [
|
||||
{ 'deploy': deploy },
|
||||
@@ -222,303 +211,135 @@ def _call_proxy(fn, *args):
|
||||
fatal_err("FATAL: Fault: {} (code: {})".format(err.faultString, err.faultCode))
|
||||
|
||||
|
||||
class LAVAJob:
|
||||
COLOR_STATUS_MAP = {
|
||||
"pass": CONSOLE_LOG["FG_GREEN"],
|
||||
"hung": CONSOLE_LOG["FG_YELLOW"],
|
||||
"fail": CONSOLE_LOG["FG_RED"],
|
||||
"canceled": CONSOLE_LOG["FG_MAGENTA"],
|
||||
}
|
||||
|
||||
def __init__(self, proxy, definition):
|
||||
self.job_id = None
|
||||
self.proxy = proxy
|
||||
self.definition = definition
|
||||
self.last_log_line = 0
|
||||
self.last_log_time = None
|
||||
self.is_finished = False
|
||||
self.status = "created"
|
||||
|
||||
def heartbeat(self):
|
||||
self.last_log_time = datetime.now()
|
||||
self.status = "running"
|
||||
|
||||
def validate(self) -> Optional[dict]:
|
||||
"""Returns a dict with errors, if the validation fails.
|
||||
|
||||
Returns:
|
||||
Optional[dict]: a dict with the validation errors, if any
|
||||
"""
|
||||
return _call_proxy(self.proxy.scheduler.jobs.validate, self.definition, True)
|
||||
|
||||
def submit(self):
|
||||
try:
|
||||
self.job_id = _call_proxy(self.proxy.scheduler.jobs.submit, self.definition)
|
||||
except MesaCIException:
|
||||
return False
|
||||
return True
|
||||
|
||||
def cancel(self):
|
||||
if self.job_id:
|
||||
self.proxy.scheduler.jobs.cancel(self.job_id)
|
||||
|
||||
def is_started(self) -> bool:
|
||||
waiting_states = ["Submitted", "Scheduling", "Scheduled"]
|
||||
job_state: dict[str, str] = _call_proxy(
|
||||
self.proxy.scheduler.job_state, self.job_id
|
||||
)
|
||||
return job_state["job_state"] not in waiting_states
|
||||
|
||||
def _load_log_from_data(self, data) -> list[str]:
|
||||
lines = []
|
||||
# When there is no new log data, the YAML is empty
|
||||
if loaded_lines := yaml.load(str(data), Loader=loader(False)):
|
||||
lines = loaded_lines
|
||||
self.last_log_line += len(lines)
|
||||
return lines
|
||||
|
||||
def get_logs(self) -> list[str]:
|
||||
try:
|
||||
(finished, data) = _call_proxy(
|
||||
self.proxy.scheduler.jobs.logs, self.job_id, self.last_log_line
|
||||
)
|
||||
self.is_finished = finished
|
||||
return self._load_log_from_data(data)
|
||||
|
||||
except Exception as mesa_ci_err:
|
||||
raise MesaCIParseException(
|
||||
f"Could not get LAVA job logs. Reason: {mesa_ci_err}"
|
||||
) from mesa_ci_err
|
||||
|
||||
def parse_job_result_from_log(
|
||||
self, lava_lines: list[dict[str, str]]
|
||||
) -> list[dict[str, str]]:
|
||||
"""Use the console log to catch if the job has completed successfully or
|
||||
not. Returns the list of log lines until the result line."""
|
||||
|
||||
last_line = None # Print all lines. lines[:None] == lines[:]
|
||||
|
||||
for idx, line in enumerate(lava_lines):
|
||||
if result := re.search(r"hwci: mesa: (pass|fail)", line):
|
||||
self.is_finished = True
|
||||
self.status = result.group(1)
|
||||
|
||||
last_line = idx + 1
|
||||
# We reached the log end here. hwci script has finished.
|
||||
break
|
||||
return lava_lines[:last_line]
|
||||
|
||||
|
||||
def find_exception_from_metadata(metadata, job_id):
|
||||
if "result" not in metadata or metadata["result"] != "fail":
|
||||
return
|
||||
if "error_type" in metadata:
|
||||
error_type = metadata["error_type"]
|
||||
if error_type == "Infrastructure":
|
||||
raise MesaCIException(
|
||||
f"LAVA job {job_id} failed with Infrastructure Error. Retry."
|
||||
)
|
||||
if error_type == "Job":
|
||||
# This happens when LAVA assumes that the job cannot terminate or
|
||||
# with mal-formed job definitions. As we are always validating the
|
||||
# jobs, only the former is probable to happen. E.g.: When some LAVA
|
||||
# action timed out more times than expected in job definition.
|
||||
raise MesaCIException(
|
||||
f"LAVA job {job_id} failed with JobError "
|
||||
"(possible LAVA timeout misconfiguration/bug). Retry."
|
||||
)
|
||||
if "case" in metadata and metadata["case"] == "validate":
|
||||
raise MesaCIException(
|
||||
f"LAVA job {job_id} failed validation (possible download error). Retry."
|
||||
)
|
||||
return metadata
|
||||
|
||||
|
||||
def find_lava_error(job) -> None:
|
||||
def get_job_results(proxy, job_id, test_suite, test_case):
|
||||
# Look for infrastructure errors and retry if we see them.
|
||||
results_yaml = _call_proxy(job.proxy.results.get_testjob_results_yaml, job.job_id)
|
||||
results_yaml = _call_proxy(proxy.results.get_testjob_results_yaml, job_id)
|
||||
results = yaml.load(results_yaml, Loader=loader(False))
|
||||
for res in results:
|
||||
metadata = res["metadata"]
|
||||
find_exception_from_metadata(metadata, job.job_id)
|
||||
if "result" not in metadata or metadata["result"] != "fail":
|
||||
continue
|
||||
if 'error_type' in metadata and metadata['error_type'] == "Infrastructure":
|
||||
print_log("LAVA job {} failed with Infrastructure Error. Retry.".format(job_id))
|
||||
return False
|
||||
if 'case' in metadata and metadata['case'] == "validate":
|
||||
print_log("LAVA job {} failed validation (possible download error). Retry.".format(job_id))
|
||||
return False
|
||||
|
||||
# If we reach this far, it means that the job ended without hwci script
|
||||
# result and no LAVA infrastructure problem was found
|
||||
job.status = "fail"
|
||||
results_yaml = _call_proxy(proxy.results.get_testcase_results_yaml, job_id, test_suite, test_case)
|
||||
results = yaml.load(results_yaml, Loader=loader(False))
|
||||
if not results:
|
||||
fatal_err("LAVA: no result for test_suite '{}', test_case '{}'".format(test_suite, test_case))
|
||||
|
||||
print_log("LAVA: result for test_suite '{}', test_case '{}': {}".format(test_suite, test_case, results[0]['result']))
|
||||
if results[0]['result'] != 'pass':
|
||||
fatal_err("FAIL")
|
||||
|
||||
def show_job_data(job):
|
||||
with GitlabSection(
|
||||
"job_data",
|
||||
"LAVA job info",
|
||||
type=LogSectionType.LAVA_POST_PROCESSING,
|
||||
start_collapsed=True,
|
||||
):
|
||||
show = _call_proxy(job.proxy.scheduler.jobs.show, job.job_id)
|
||||
for field, value in show.items():
|
||||
print("{}\t: {}".format(field, value))
|
||||
return True
|
||||
|
||||
def wait_until_job_is_started(proxy, job_id):
|
||||
print_log(f"Waiting for job {job_id} to start.")
|
||||
current_state = "Submitted"
|
||||
waiting_states = ["Submitted", "Scheduling", "Scheduled"]
|
||||
while current_state in waiting_states:
|
||||
job_state = _call_proxy(proxy.scheduler.job_state, job_id)
|
||||
current_state = job_state["job_state"]
|
||||
|
||||
def fetch_logs(job, max_idle_time, log_follower) -> None:
|
||||
# Poll to check for new logs, assuming that a prolonged period of
|
||||
# silence means that the device has died and we should try it again
|
||||
if datetime.now() - job.last_log_time > max_idle_time:
|
||||
max_idle_time_min = max_idle_time.total_seconds() / 60
|
||||
|
||||
raise MesaCITimeoutError(
|
||||
f"{CONSOLE_LOG['BOLD']}"
|
||||
f"{CONSOLE_LOG['FG_YELLOW']}"
|
||||
f"LAVA job {job.job_id} does not respond for {max_idle_time_min} "
|
||||
"minutes. Retry."
|
||||
f"{CONSOLE_LOG['RESET']}",
|
||||
timeout_duration=max_idle_time,
|
||||
)
|
||||
|
||||
time.sleep(LOG_POLLING_TIME_SEC)
|
||||
|
||||
# The XMLRPC binary packet may be corrupted, causing a YAML scanner error.
|
||||
# Retry the log fetching several times before exposing the error.
|
||||
for _ in range(5):
|
||||
with contextlib.suppress(MesaCIParseException):
|
||||
new_log_lines = job.get_logs()
|
||||
break
|
||||
else:
|
||||
raise MesaCIParseException
|
||||
|
||||
if log_follower.feed(new_log_lines):
|
||||
# If we had non-empty log data, we can assure that the device is alive.
|
||||
job.heartbeat()
|
||||
parsed_lines = log_follower.flush()
|
||||
|
||||
# Only parse job results when the script reaches the end of the logs.
|
||||
# Depending on how much payload the RPC scheduler.jobs.logs get, it may
|
||||
# reach the LAVA_POST_PROCESSING phase.
|
||||
if log_follower.current_section.type in (
|
||||
LogSectionType.TEST_CASE,
|
||||
LogSectionType.LAVA_POST_PROCESSING,
|
||||
):
|
||||
parsed_lines = job.parse_job_result_from_log(parsed_lines)
|
||||
|
||||
for line in parsed_lines:
|
||||
print_log(line)
|
||||
|
||||
|
||||
def follow_job_execution(job):
|
||||
try:
|
||||
job.submit()
|
||||
except Exception as mesa_ci_err:
|
||||
raise MesaCIException(
|
||||
f"Could not submit LAVA job. Reason: {mesa_ci_err}"
|
||||
) from mesa_ci_err
|
||||
|
||||
print_log(f"Waiting for job {job.job_id} to start.")
|
||||
while not job.is_started():
|
||||
time.sleep(WAIT_FOR_DEVICE_POLLING_TIME_SEC)
|
||||
print_log(f"Job {job.job_id} started.")
|
||||
print_log(f"Job {job_id} started.")
|
||||
|
||||
gl = GitlabSection(
|
||||
id="lava_boot",
|
||||
header="LAVA boot",
|
||||
type=LogSectionType.LAVA_BOOT,
|
||||
start_collapsed=True,
|
||||
)
|
||||
print(gl.start())
|
||||
max_idle_time = timedelta(seconds=DEVICE_HANGING_TIMEOUT_SEC)
|
||||
with LogFollower(current_section=gl) as lf:
|
||||
def follow_job_execution(proxy, job_id):
|
||||
line_count = 0
|
||||
finished = False
|
||||
last_time_logs = datetime.now()
|
||||
while not finished:
|
||||
(finished, data) = _call_proxy(proxy.scheduler.jobs.logs, job_id, line_count)
|
||||
if logs := yaml.load(str(data), Loader=loader(False)):
|
||||
# Reset the timeout
|
||||
last_time_logs = datetime.now()
|
||||
for line in logs:
|
||||
print("{} {}".format(line["dt"], line["msg"]))
|
||||
|
||||
max_idle_time = timedelta(seconds=DEVICE_HANGING_TIMEOUT_SEC)
|
||||
# Start to check job's health
|
||||
job.heartbeat()
|
||||
while not job.is_finished:
|
||||
fetch_logs(job, max_idle_time, lf)
|
||||
line_count += len(logs)
|
||||
|
||||
show_job_data(job)
|
||||
else:
|
||||
time_limit = timedelta(seconds=DEVICE_HANGING_TIMEOUT_SEC)
|
||||
if datetime.now() - last_time_logs > time_limit:
|
||||
print_log("LAVA job {} doesn't advance (machine got hung?). Retry.".format(job_id))
|
||||
return False
|
||||
|
||||
# Mesa Developers expect to have a simple pass/fail job result.
|
||||
# If this does not happen, it probably means a LAVA infrastructure error
|
||||
# happened.
|
||||
if job.status not in ["pass", "fail"]:
|
||||
find_lava_error(job)
|
||||
# `proxy.scheduler.jobs.logs` does not block, even when there is no
|
||||
# new log to be fetched. To avoid dosing the LAVA dispatcher
|
||||
# machine, let's add a sleep to save them some stamina.
|
||||
time.sleep(LOG_POLLING_TIME_SEC)
|
||||
|
||||
return True
|
||||
|
||||
def show_job_data(proxy, job_id):
|
||||
show = _call_proxy(proxy.scheduler.jobs.show, job_id)
|
||||
for field, value in show.items():
|
||||
print("{}\t: {}".format(field, value))
|
||||
|
||||
|
||||
def print_job_final_status(job):
|
||||
if job.status == "running":
|
||||
job.status = "hung"
|
||||
def validate_job(proxy, job_file):
|
||||
try:
|
||||
return _call_proxy(proxy.scheduler.jobs.validate, job_file, True)
|
||||
except:
|
||||
return False
|
||||
|
||||
color = LAVAJob.COLOR_STATUS_MAP.get(job.status, CONSOLE_LOG["FG_RED"])
|
||||
print_log(
|
||||
f"{color}"
|
||||
f"LAVA Job finished with status: {job.status}"
|
||||
f"{CONSOLE_LOG['RESET']}"
|
||||
)
|
||||
def submit_job(proxy, job_file):
|
||||
return _call_proxy(proxy.scheduler.jobs.submit, job_file)
|
||||
|
||||
|
||||
def retriable_follow_job(proxy, job_definition) -> LAVAJob:
|
||||
def retriable_follow_job(proxy, yaml_file):
|
||||
retry_count = NUMBER_OF_RETRIES_TIMEOUT_DETECTION
|
||||
|
||||
for attempt_no in range(1, retry_count + 2):
|
||||
job = LAVAJob(proxy, job_definition)
|
||||
try:
|
||||
follow_job_execution(job)
|
||||
return job
|
||||
except MesaCIKnownIssueException as found_issue:
|
||||
print_log(found_issue)
|
||||
job.status = "canceled"
|
||||
except MesaCIException as mesa_exception:
|
||||
print_log(mesa_exception)
|
||||
job.cancel()
|
||||
except KeyboardInterrupt as e:
|
||||
print_log("LAVA job submitter was interrupted. Cancelling the job.")
|
||||
job.cancel()
|
||||
raise e
|
||||
finally:
|
||||
print_log(
|
||||
f"{CONSOLE_LOG['BOLD']}"
|
||||
f"Finished executing LAVA job in the attempt #{attempt_no}"
|
||||
f"{CONSOLE_LOG['RESET']}"
|
||||
)
|
||||
print_job_final_status(job)
|
||||
while retry_count >= 0:
|
||||
job_id = submit_job(proxy, yaml_file)
|
||||
|
||||
raise MesaCIRetryError(
|
||||
f"{CONSOLE_LOG['BOLD']}"
|
||||
f"{CONSOLE_LOG['FG_RED']}"
|
||||
"Job failed after it exceeded the number of "
|
||||
f"{retry_count} retries."
|
||||
f"{CONSOLE_LOG['RESET']}",
|
||||
retry_count=retry_count,
|
||||
)
|
||||
print_log("LAVA job id: {}".format(job_id))
|
||||
|
||||
wait_until_job_is_started(proxy, job_id)
|
||||
|
||||
def treat_mesa_job_name(args):
|
||||
# Remove mesa job names with spaces, which breaks the lava-test-case command
|
||||
args.mesa_job_name = args.mesa_job_name.split(" ")[0]
|
||||
if not follow_job_execution(proxy, job_id):
|
||||
print_log(f"Job {job_id} has timed out. Cancelling it.")
|
||||
# Cancel the job as it is considered unreachable by Mesa CI.
|
||||
proxy.scheduler.jobs.cancel(job_id)
|
||||
|
||||
retry_count -= 1
|
||||
continue
|
||||
|
||||
show_job_data(proxy, job_id)
|
||||
|
||||
if get_job_results(proxy, job_id, "0_mesa", "mesa") == True:
|
||||
break
|
||||
else:
|
||||
# The script attempted all the retries. The job seemed to fail.
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def main(args):
|
||||
proxy = setup_lava_proxy()
|
||||
|
||||
job_definition = generate_lava_yaml(args)
|
||||
yaml_file = generate_lava_yaml(args)
|
||||
|
||||
if args.dump_yaml:
|
||||
with GitlabSection(
|
||||
"yaml_dump",
|
||||
"LAVA job definition (YAML)",
|
||||
type=LogSectionType.LAVA_BOOT,
|
||||
start_collapsed=True,
|
||||
):
|
||||
print(hide_sensitive_data(job_definition))
|
||||
job = LAVAJob(proxy, job_definition)
|
||||
|
||||
if errors := job.validate():
|
||||
fatal_err(f"Error in LAVA job definition: {errors}")
|
||||
print_log("LAVA job definition validated successfully")
|
||||
print(hide_sensitive_data(generate_lava_yaml(args)))
|
||||
|
||||
if args.validate_only:
|
||||
ret = validate_job(proxy, yaml_file)
|
||||
if not ret:
|
||||
fatal_err("Error in LAVA job definition")
|
||||
print("LAVA job definition validated successfully")
|
||||
return
|
||||
|
||||
finished_job = retriable_follow_job(proxy, job_definition)
|
||||
exit_code = 0 if finished_job.status == "pass" else 1
|
||||
sys.exit(exit_code)
|
||||
if not retriable_follow_job(proxy, yaml_file):
|
||||
fatal_err(
|
||||
"Job failed after it exceeded the number of"
|
||||
f"{NUMBER_OF_RETRIES_TIMEOUT_DETECTION} retries."
|
||||
)
|
||||
|
||||
|
||||
def create_parser():
|
||||
@@ -542,11 +363,9 @@ def create_parser():
|
||||
parser.add_argument("--validate-only", action='store_true')
|
||||
parser.add_argument("--dump-yaml", action='store_true')
|
||||
parser.add_argument("--visibility-group")
|
||||
parser.add_argument("--mesa-job-name")
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# given that we proxy from DUT -> LAVA dispatcher -> LAVA primary -> us ->
|
||||
# GitLab runner -> GitLab primary -> user, safe to say we don't need any
|
||||
@@ -558,5 +377,4 @@ if __name__ == "__main__":
|
||||
|
||||
parser.set_defaults(func=main)
|
||||
args = parser.parse_args()
|
||||
treat_mesa_job_name(args)
|
||||
args.func(args)
|
||||
|
@@ -1,11 +0,0 @@
|
||||
from .console_format import CONSOLE_LOG
|
||||
from .gitlab_section import GitlabSection
|
||||
from .log_follower import (
|
||||
LogFollower,
|
||||
fatal_err,
|
||||
fix_lava_color_log,
|
||||
fix_lava_gitlab_section_log,
|
||||
hide_sensitive_data,
|
||||
print_log,
|
||||
)
|
||||
from .log_section import LogSection, LogSectionType
|
@@ -1,10 +0,0 @@
|
||||
CONSOLE_LOG = {
|
||||
"FG_GREEN": "\x1b[1;32;5;197m",
|
||||
"FG_RED": "\x1b[1;38;5;197m",
|
||||
"FG_YELLOW": "\x1b[1;33;5;197m",
|
||||
"FG_MAGENTA": "\x1b[1;35;5;197m",
|
||||
"RESET": "\x1b[0m",
|
||||
"UNDERLINED": "\x1b[3m",
|
||||
"BOLD": "\x1b[1m",
|
||||
"DIM": "\x1b[2m",
|
||||
}
|
@@ -1,84 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime, timedelta
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from lava.utils.console_format import CONSOLE_LOG
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from lava.utils.log_section import LogSectionType
|
||||
|
||||
|
||||
@dataclass
|
||||
class GitlabSection:
|
||||
id: str
|
||||
header: str
|
||||
type: LogSectionType
|
||||
start_collapsed: bool = False
|
||||
escape: str = "\x1b[0K"
|
||||
colour: str = f"{CONSOLE_LOG['BOLD']}{CONSOLE_LOG['FG_GREEN']}"
|
||||
__start_time: Optional[datetime] = field(default=None, init=False)
|
||||
__end_time: Optional[datetime] = field(default=None, init=False)
|
||||
|
||||
@classmethod
|
||||
def section_id_filter(cls, value) -> str:
|
||||
return str(re.sub(r"[^\w_-]+", "-", value))
|
||||
|
||||
def __post_init__(self):
|
||||
self.id = self.section_id_filter(self.id)
|
||||
|
||||
@property
|
||||
def has_started(self) -> bool:
|
||||
return self.__start_time is not None
|
||||
|
||||
@property
|
||||
def has_finished(self) -> bool:
|
||||
return self.__end_time is not None
|
||||
|
||||
def get_timestamp(self, time: datetime) -> str:
|
||||
unix_ts = datetime.timestamp(time)
|
||||
return str(int(unix_ts))
|
||||
|
||||
def section(self, marker: str, header: str, time: datetime) -> str:
|
||||
preamble = f"{self.escape}section_{marker}"
|
||||
collapse = marker == "start" and self.start_collapsed
|
||||
collapsed = "[collapsed=true]" if collapse else ""
|
||||
section_id = f"{self.id}{collapsed}"
|
||||
|
||||
timestamp = self.get_timestamp(time)
|
||||
before_header = ":".join([preamble, timestamp, section_id])
|
||||
colored_header = f"{self.colour}{header}\x1b[0m" if header else ""
|
||||
header_wrapper = "\r" + f"{self.escape}{colored_header}"
|
||||
|
||||
return f"{before_header}{header_wrapper}"
|
||||
|
||||
def __enter__(self):
|
||||
print(self.start())
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
print(self.end())
|
||||
|
||||
def start(self) -> str:
|
||||
assert not self.has_finished, "Starting an already finished section"
|
||||
self.__start_time = datetime.now()
|
||||
return self.section(marker="start", header=self.header, time=self.__start_time)
|
||||
|
||||
def end(self) -> str:
|
||||
assert self.has_started, "Ending an uninitialized section"
|
||||
self.__end_time = datetime.now()
|
||||
assert (
|
||||
self.__end_time >= self.__start_time
|
||||
), "Section execution time will be negative"
|
||||
return self.section(marker="end", header="", time=self.__end_time)
|
||||
|
||||
def delta_time(self) -> Optional[timedelta]:
|
||||
if self.__start_time and self.__end_time:
|
||||
return self.__end_time - self.__start_time
|
||||
|
||||
if self.has_started:
|
||||
return datetime.now() - self.__start_time
|
||||
|
||||
return None
|
@@ -1,43 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from dataclasses import dataclass, field
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from lava.utils import LogFollower
|
||||
|
||||
from lava.exceptions import MesaCIKnownIssueException
|
||||
from lava.utils.console_format import CONSOLE_LOG
|
||||
from lava.utils.log_section import LogSectionType
|
||||
|
||||
|
||||
@dataclass
|
||||
class LAVALogHints:
|
||||
log_follower: LogFollower
|
||||
has_r8152_issue_history: bool = field(default=False, init=False)
|
||||
|
||||
def detect_failure(self, new_lines: list[dict[str, Any]]):
|
||||
for line in new_lines:
|
||||
self.detect_r8152_issue(line)
|
||||
|
||||
def detect_r8152_issue(self, line):
|
||||
if (
|
||||
self.log_follower.phase == LogSectionType.TEST_CASE
|
||||
and line["lvl"] == "target"
|
||||
):
|
||||
if re.search(r"r8152 \S+ eth0: Tx status -71", line["msg"]):
|
||||
self.has_r8152_issue_history = True
|
||||
return
|
||||
|
||||
if self.has_r8152_issue_history and re.search(
|
||||
r"nfs: server \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} not responding, still trying",
|
||||
line["msg"],
|
||||
):
|
||||
raise MesaCIKnownIssueException(
|
||||
f"{CONSOLE_LOG['FG_MAGENTA']}"
|
||||
"Probable network issue failure encountered, retrying the job"
|
||||
f"{CONSOLE_LOG['RESET']}"
|
||||
)
|
||||
|
||||
self.has_r8152_issue_history = False
|
@@ -1,218 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (C) 2022 Collabora Limited
|
||||
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
Some utilities to analyse logs, create gitlab sections and other quality of life
|
||||
improvements
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
import sys
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Optional, Union
|
||||
|
||||
from lava.exceptions import MesaCITimeoutError
|
||||
from lava.utils.console_format import CONSOLE_LOG
|
||||
from lava.utils.gitlab_section import GitlabSection
|
||||
from lava.utils.lava_log_hints import LAVALogHints
|
||||
from lava.utils.log_section import (
|
||||
DEFAULT_GITLAB_SECTION_TIMEOUTS,
|
||||
FALLBACK_GITLAB_SECTION_TIMEOUT,
|
||||
LOG_SECTIONS,
|
||||
LogSectionType,
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class LogFollower:
|
||||
current_section: Optional[GitlabSection] = None
|
||||
timeout_durations: dict[LogSectionType, timedelta] = field(
|
||||
default_factory=lambda: DEFAULT_GITLAB_SECTION_TIMEOUTS,
|
||||
)
|
||||
fallback_timeout: timedelta = FALLBACK_GITLAB_SECTION_TIMEOUT
|
||||
_buffer: list[str] = field(default_factory=list, init=False)
|
||||
log_hints: LAVALogHints = field(init=False)
|
||||
|
||||
def __post_init__(self):
|
||||
section_is_created = bool(self.current_section)
|
||||
section_has_started = bool(
|
||||
self.current_section and self.current_section.has_started
|
||||
)
|
||||
self.log_hints = LAVALogHints(self)
|
||||
assert (
|
||||
section_is_created == section_has_started
|
||||
), "Can't follow logs beginning from uninitialized GitLab sections."
|
||||
|
||||
@property
|
||||
def phase(self) -> LogSectionType:
|
||||
return (
|
||||
self.current_section.type
|
||||
if self.current_section
|
||||
else LogSectionType.UNKNOWN
|
||||
)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
"""Cleanup existing buffer if this object gets out from the context"""
|
||||
self.clear_current_section()
|
||||
last_lines = self.flush()
|
||||
for line in last_lines:
|
||||
print(line)
|
||||
|
||||
def watchdog(self):
|
||||
if not self.current_section:
|
||||
return
|
||||
|
||||
timeout_duration = self.timeout_durations.get(
|
||||
self.current_section.type, self.fallback_timeout
|
||||
)
|
||||
|
||||
if self.current_section.delta_time() > timeout_duration:
|
||||
raise MesaCITimeoutError(
|
||||
f"Gitlab Section {self.current_section} has timed out",
|
||||
timeout_duration=timeout_duration,
|
||||
)
|
||||
|
||||
def clear_current_section(self):
|
||||
if self.current_section and not self.current_section.has_finished:
|
||||
self._buffer.append(self.current_section.end())
|
||||
self.current_section = None
|
||||
|
||||
def update_section(self, new_section: GitlabSection):
|
||||
# Sections can have redundant regex to find them to mitigate LAVA
|
||||
# interleaving kmsg and stderr/stdout issue.
|
||||
if self.current_section and self.current_section.id == new_section.id:
|
||||
return
|
||||
self.clear_current_section()
|
||||
self.current_section = new_section
|
||||
self._buffer.append(new_section.start())
|
||||
|
||||
def manage_gl_sections(self, line):
|
||||
if isinstance(line["msg"], list):
|
||||
logging.debug("Ignoring messages as list. Kernel dumps.")
|
||||
return
|
||||
|
||||
for log_section in LOG_SECTIONS:
|
||||
if new_section := log_section.from_log_line_to_section(line):
|
||||
self.update_section(new_section)
|
||||
|
||||
def detect_kernel_dump_line(self, line: dict[str, Union[str, list]]) -> bool:
|
||||
# line["msg"] can be a list[str] when there is a kernel dump
|
||||
if isinstance(line["msg"], list):
|
||||
return line["lvl"] == "debug"
|
||||
|
||||
# result level has dict line["msg"]
|
||||
if not isinstance(line["msg"], str):
|
||||
return False
|
||||
|
||||
# we have a line, check if it is a kernel message
|
||||
if re.search(r"\[[\d\s]{5}\.[\d\s]{6}\] +\S{2,}", line["msg"]):
|
||||
print_log(f"{CONSOLE_LOG['BOLD']}{line['msg']}{CONSOLE_LOG['RESET']}")
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def feed(self, new_lines: list[dict[str, str]]) -> bool:
|
||||
"""Input data to be processed by LogFollower instance
|
||||
Returns true if the DUT (device under test) seems to be alive.
|
||||
"""
|
||||
|
||||
self.watchdog()
|
||||
|
||||
# No signal of job health in the log
|
||||
is_job_healthy = False
|
||||
|
||||
for line in new_lines:
|
||||
if self.detect_kernel_dump_line(line):
|
||||
continue
|
||||
|
||||
# At least we are fed with a non-kernel dump log, it seems that the
|
||||
# job is progressing
|
||||
is_job_healthy = True
|
||||
self.manage_gl_sections(line)
|
||||
if parsed_line := parse_lava_line(line):
|
||||
self._buffer.append(parsed_line)
|
||||
|
||||
self.log_hints.detect_failure(new_lines)
|
||||
|
||||
return is_job_healthy
|
||||
|
||||
def flush(self) -> list[str]:
|
||||
buffer = self._buffer
|
||||
self._buffer = []
|
||||
return buffer
|
||||
|
||||
|
||||
def fix_lava_color_log(line):
|
||||
"""This function is a temporary solution for the color escape codes mangling
|
||||
problem. There is some problem in message passing between the LAVA
|
||||
dispatcher and the device under test (DUT). Here \x1b character is missing
|
||||
before `[:digit::digit:?:digit:?m` ANSI TTY color codes, or the more
|
||||
complicated ones with number values for text format before background and
|
||||
foreground colors.
|
||||
When this problem is fixed on the LAVA side, one should remove this function.
|
||||
"""
|
||||
line["msg"] = re.sub(r"(\[(\d+;){0,2}\d{1,3}m)", "\x1b" + r"\1", line["msg"])
|
||||
|
||||
|
||||
def fix_lava_gitlab_section_log(line):
|
||||
"""This function is a temporary solution for the Gitlab section markers
|
||||
mangling problem. Gitlab parses the following lines to define a collapsible
|
||||
gitlab section in their log:
|
||||
- \x1b[0Ksection_start:timestamp:section_id[collapsible=true/false]\r\x1b[0Ksection_header
|
||||
- \x1b[0Ksection_end:timestamp:section_id\r\x1b[0K
|
||||
There is some problem in message passing between the LAVA dispatcher and the
|
||||
device under test (DUT), that digests \x1b and \r control characters
|
||||
incorrectly. When this problem is fixed on the LAVA side, one should remove
|
||||
this function.
|
||||
"""
|
||||
if match := re.match(r"\[0K(section_\w+):(\d+):(\S+)\[0K([\S ]+)?", line["msg"]):
|
||||
marker, timestamp, id_collapsible, header = match.groups()
|
||||
# The above regex serves for both section start and end lines.
|
||||
# When the header is None, it means we are dealing with `section_end` line
|
||||
header = header or ""
|
||||
line["msg"] = f"\x1b[0K{marker}:{timestamp}:{id_collapsible}\r\x1b[0K{header}"
|
||||
|
||||
|
||||
def parse_lava_line(line) -> Optional[str]:
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
if line["lvl"] in ["results", "feedback", "debug"]:
|
||||
return
|
||||
elif line["lvl"] in ["warning", "error"]:
|
||||
prefix = CONSOLE_LOG["FG_RED"]
|
||||
suffix = CONSOLE_LOG["RESET"]
|
||||
elif line["lvl"] == "input":
|
||||
prefix = "$ "
|
||||
suffix = ""
|
||||
elif line["lvl"] == "target":
|
||||
fix_lava_color_log(line)
|
||||
fix_lava_gitlab_section_log(line)
|
||||
|
||||
return f'{prefix}{line["msg"]}{suffix}'
|
||||
|
||||
|
||||
def print_log(msg):
|
||||
# Reset color from timestamp, since `msg` can tint the terminal color
|
||||
print(f"{CONSOLE_LOG['RESET']}{datetime.now()}: {msg}")
|
||||
|
||||
|
||||
def fatal_err(msg):
|
||||
colored_msg = f"{CONSOLE_LOG['FG_RED']}"
|
||||
f"{msg}"
|
||||
f"{CONSOLE_LOG['RESET']}"
|
||||
print_log(colored_msg)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def hide_sensitive_data(yaml_data, hide_tag="HIDEME"):
|
||||
return "".join(line for line in yaml_data.splitlines(True) if hide_tag not in line)
|
@@ -1,88 +0,0 @@
|
||||
import re
|
||||
from dataclasses import dataclass
|
||||
from datetime import timedelta
|
||||
from enum import Enum, auto
|
||||
from typing import Optional, Pattern, Union
|
||||
|
||||
from lava.utils.gitlab_section import GitlabSection
|
||||
|
||||
|
||||
class LogSectionType(Enum):
|
||||
UNKNOWN = auto()
|
||||
LAVA_BOOT = auto()
|
||||
TEST_SUITE = auto()
|
||||
TEST_CASE = auto()
|
||||
LAVA_POST_PROCESSING = auto()
|
||||
|
||||
|
||||
FALLBACK_GITLAB_SECTION_TIMEOUT = timedelta(minutes=10)
|
||||
DEFAULT_GITLAB_SECTION_TIMEOUTS = {
|
||||
# Empirically, successful device boot in LAVA time takes less than 3
|
||||
# minutes.
|
||||
# LAVA itself is configured to attempt thrice to boot the device,
|
||||
# summing up to 9 minutes.
|
||||
# It is better to retry the boot than cancel the job and re-submit to avoid
|
||||
# the enqueue delay.
|
||||
LogSectionType.LAVA_BOOT: timedelta(minutes=9),
|
||||
# Test suite phase is where the initialization happens.
|
||||
LogSectionType.TEST_SUITE: timedelta(minutes=5),
|
||||
# Test cases may take a long time, this script has no right to interrupt
|
||||
# them. But if the test case takes almost 1h, it will never succeed due to
|
||||
# Gitlab job timeout.
|
||||
LogSectionType.TEST_CASE: timedelta(minutes=60),
|
||||
# LAVA post processing may refer to a test suite teardown, or the
|
||||
# adjustments to start the next test_case
|
||||
LogSectionType.LAVA_POST_PROCESSING: timedelta(minutes=5),
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class LogSection:
|
||||
regex: Union[Pattern, str]
|
||||
levels: tuple[str]
|
||||
section_id: str
|
||||
section_header: str
|
||||
section_type: LogSectionType
|
||||
collapsed: bool = False
|
||||
|
||||
def from_log_line_to_section(
|
||||
self, lava_log_line: dict[str, str]
|
||||
) -> Optional[GitlabSection]:
|
||||
if lava_log_line["lvl"] not in self.levels:
|
||||
return
|
||||
|
||||
if match := re.search(self.regex, lava_log_line["msg"]):
|
||||
section_id = self.section_id.format(*match.groups())
|
||||
section_header = self.section_header.format(*match.groups())
|
||||
return GitlabSection(
|
||||
id=section_id,
|
||||
header=section_header,
|
||||
type=self.section_type,
|
||||
start_collapsed=self.collapsed,
|
||||
)
|
||||
|
||||
|
||||
LOG_SECTIONS = (
|
||||
LogSection(
|
||||
regex=re.compile(r"<?STARTTC>? ([^>]*)"),
|
||||
levels=("target", "debug"),
|
||||
section_id="{}",
|
||||
section_header="test_case {}",
|
||||
section_type=LogSectionType.TEST_CASE,
|
||||
),
|
||||
LogSection(
|
||||
regex=re.compile(r"<?STARTRUN>? ([^>]*)"),
|
||||
levels=("target", "debug"),
|
||||
section_id="{}",
|
||||
section_header="test_suite {}",
|
||||
section_type=LogSectionType.TEST_SUITE,
|
||||
),
|
||||
LogSection(
|
||||
regex=re.compile(r"ENDTC>? ([^>]+)"),
|
||||
levels=("target", "debug"),
|
||||
section_id="post-{}",
|
||||
section_header="Post test_case {}",
|
||||
collapsed=True,
|
||||
section_type=LogSectionType.LAVA_POST_PROCESSING,
|
||||
),
|
||||
)
|
@@ -48,8 +48,6 @@ case $CI_JOB_NAME in
|
||||
if test -f /usr/bin/time; then
|
||||
MESON_TEST_ARGS+=--wrapper=$PWD/.gitlab-ci/meson/time.sh
|
||||
fi
|
||||
Xvfb :0 -screen 0 1024x768x16 &
|
||||
export DISPLAY=:0.0
|
||||
;;
|
||||
*)
|
||||
if test -f /usr/bin/time -a -f /usr/bin/strace; then
|
||||
@@ -65,7 +63,7 @@ meson _build --native-file=native.file \
|
||||
-D prefix=`pwd`/install \
|
||||
-D libdir=lib \
|
||||
-D buildtype=${BUILDTYPE:-debug} \
|
||||
-D build-tests=false \
|
||||
-D build-tests=true \
|
||||
-D c_args="$(echo -n $C_ARGS)" \
|
||||
-D cpp_args="$(echo -n $CPP_ARGS)" \
|
||||
-D libunwind=${UNWIND} \
|
||||
@@ -73,12 +71,11 @@ meson _build --native-file=native.file \
|
||||
${GALLIUM_ST} \
|
||||
-D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
|
||||
-D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
|
||||
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec \
|
||||
-D werror=true \
|
||||
${EXTRA_OPTION}
|
||||
cd _build
|
||||
meson configure
|
||||
ninja
|
||||
LC_ALL=C.UTF-8 meson test --num-processes ${FDO_CI_CONCURRENT:-4} --print-errorlogs ${MESON_TEST_ARGS}
|
||||
LC_ALL=C.UTF-8 meson test --num-processes ${FDO_CI_CONCURRENT:-4} ${MESON_TEST_ARGS}
|
||||
ninja install
|
||||
cd ..
|
||||
|
@@ -13,7 +13,6 @@ mkdir -p "$RESULTS"
|
||||
# using a command wrapper. Hence, we will just set it when running the
|
||||
# command.
|
||||
export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/"
|
||||
export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.${VK_CPU:-`uname -m`}.json"
|
||||
|
||||
# Sanity check to ensure that our environment is sufficient to make our tests
|
||||
# run against the Mesa built by CI, rather than any installed distro version.
|
||||
@@ -34,48 +33,96 @@ quiet() {
|
||||
set -x
|
||||
}
|
||||
|
||||
# Set environment for apitrace executable.
|
||||
export PATH="/apitrace/build:$PATH"
|
||||
if [ "$VK_DRIVER" ]; then
|
||||
|
||||
# Our rootfs may not have "less", which apitrace uses during
|
||||
# apitrace dump
|
||||
export PAGER=cat
|
||||
### VULKAN ###
|
||||
|
||||
SANITY_MESA_VERSION_CMD="wflinfo"
|
||||
# Set the Vulkan driver to use.
|
||||
export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json"
|
||||
|
||||
HANG_DETECTION_CMD=""
|
||||
# Set environment for Wine.
|
||||
export WINEDEBUG="-all"
|
||||
export WINEPREFIX="/dxvk-wine64"
|
||||
export WINEESYNC=1
|
||||
|
||||
# Set environment for DXVK.
|
||||
export DXVK_LOG_LEVEL="none"
|
||||
export DXVK_STATE_CACHE=0
|
||||
|
||||
# Set environment for gfxreconstruct executables.
|
||||
export PATH="/gfxreconstruct/build/bin:$PATH"
|
||||
|
||||
SANITY_MESA_VERSION_CMD="vulkaninfo"
|
||||
|
||||
HANG_DETECTION_CMD="/parallel-deqp-runner/build/bin/hang-detection"
|
||||
|
||||
|
||||
# Set up the platform windowing system.
|
||||
# Set up the Window System Interface (WSI)
|
||||
|
||||
if [ "x$EGL_PLATFORM" = "xsurfaceless" ]; then
|
||||
# Use the surfaceless EGL platform.
|
||||
export DISPLAY=
|
||||
export WAFFLE_PLATFORM="surfaceless_egl"
|
||||
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform surfaceless_egl --api gles2"
|
||||
|
||||
if [ "x$GALLIUM_DRIVER" = "xvirpipe" ]; then
|
||||
# piglit is to use virpipe, and virgl_test_server llvmpipe
|
||||
export GALLIUM_DRIVER="$GALLIUM_DRIVER"
|
||||
|
||||
LD_LIBRARY_PATH="$__LD_LIBRARY_PATH" \
|
||||
GALLIUM_DRIVER=llvmpipe \
|
||||
VTEST_USE_EGL_SURFACELESS=1 \
|
||||
VTEST_USE_GLES=1 \
|
||||
virgl_test_server >"$RESULTS"/vtest-log.txt 2>&1 &
|
||||
|
||||
sleep 1
|
||||
if [ ${TEST_START_XORG:-0} -eq 1 ]; then
|
||||
"$INSTALL"/common/start-x.sh "$INSTALL"
|
||||
export DISPLAY=:0
|
||||
else
|
||||
# Run vulkan against the host's running X server (xvfb doesn't
|
||||
# have DRI3 support).
|
||||
# Set the DISPLAY env variable in each gitlab-runner's
|
||||
# configuration file:
|
||||
# https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runners-section
|
||||
quiet printf "%s%s\n" "Running against the hosts' X server. " \
|
||||
"DISPLAY is \"$DISPLAY\"."
|
||||
fi
|
||||
elif [ "x$PIGLIT_PLATFORM" = "xgbm" ]; then
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform gbm --api gl"
|
||||
elif [ "x$PIGLIT_PLATFORM" = "xmixed_glx_egl" ]; then
|
||||
# It is assumed that you have already brought up your X server before
|
||||
# calling this script.
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl"
|
||||
else
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl --profile core"
|
||||
RUN_CMD_WRAPPER="xvfb-run --server-args=\"-noreset\" sh -c"
|
||||
|
||||
### GL/ES ###
|
||||
|
||||
# Set environment for apitrace executable.
|
||||
export PATH="/apitrace/build:$PATH"
|
||||
|
||||
# Our rootfs may not have "less", which apitrace uses during
|
||||
# apitrace dump
|
||||
export PAGER=cat
|
||||
|
||||
SANITY_MESA_VERSION_CMD="wflinfo"
|
||||
|
||||
HANG_DETECTION_CMD=""
|
||||
|
||||
|
||||
# Set up the platform windowing system.
|
||||
|
||||
if [ "x$EGL_PLATFORM" = "xsurfaceless" ]; then
|
||||
|
||||
# Use the surfaceless EGL platform.
|
||||
export DISPLAY=
|
||||
export WAFFLE_PLATFORM="surfaceless_egl"
|
||||
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform surfaceless_egl --api gles2"
|
||||
|
||||
if [ "x$GALLIUM_DRIVER" = "xvirpipe" ]; then
|
||||
# piglit is to use virpipe, and virgl_test_server llvmpipe
|
||||
export GALLIUM_DRIVER="$GALLIUM_DRIVER"
|
||||
|
||||
LD_LIBRARY_PATH="$__LD_LIBRARY_PATH" \
|
||||
GALLIUM_DRIVER=llvmpipe \
|
||||
VTEST_USE_EGL_SURFACELESS=1 \
|
||||
VTEST_USE_GLES=1 \
|
||||
virgl_test_server >"$RESULTS"/vtest-log.txt 2>&1 &
|
||||
|
||||
sleep 1
|
||||
fi
|
||||
elif [ "x$PIGLIT_PLATFORM" = "xgbm" ]; then
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform gbm --api gl"
|
||||
elif [ "x$PIGLIT_PLATFORM" = "xmixed_glx_egl" ]; then
|
||||
# It is assumed that you have already brought up your X server before
|
||||
# calling this script.
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl"
|
||||
else
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl --profile core"
|
||||
RUN_CMD_WRAPPER="xvfb-run --server-args=\"-noreset\" sh -c"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$ZINK_USE_LAVAPIPE" ]; then
|
||||
export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/lvp_icd.x86_64.json"
|
||||
fi
|
||||
|
||||
# If the job is parallel at the gitlab job level, will take the corresponding
|
||||
@@ -131,7 +178,7 @@ PIGLIT_OPTIONS=$(printf "%s" "$PIGLIT_OPTIONS")
|
||||
|
||||
PIGLIT_TESTS=$(printf "%s" "$PIGLIT_TESTS")
|
||||
|
||||
PIGLIT_CMD="./piglit run -l verbose --timeout 300 -j${FDO_CI_CONCURRENT:-4} $PIGLIT_OPTIONS $PIGLIT_TESTS replay "$(/usr/bin/printf "%q" "$RESULTS")
|
||||
PIGLIT_CMD="./piglit run --timeout 300 -j${FDO_CI_CONCURRENT:-4} $PIGLIT_OPTIONS $PIGLIT_TESTS replay "$(/usr/bin/printf "%q" "$RESULTS")
|
||||
|
||||
RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD && $HANG_DETECTION_CMD $PIGLIT_CMD"
|
||||
|
||||
|
@@ -34,7 +34,6 @@ cp -Rp .gitlab-ci/fossilize-runner.sh install/
|
||||
cp -Rp .gitlab-ci/crosvm-init.sh install/
|
||||
cp -Rp .gitlab-ci/*.txt install/
|
||||
cp -Rp .gitlab-ci/report-flakes.py install/
|
||||
cp -Rp .gitlab-ci/valve install/
|
||||
cp -Rp .gitlab-ci/vkd3d-proton install/
|
||||
cp -Rp .gitlab-ci/*-runner.sh install/
|
||||
find . -path \*/ci/\*.txt \
|
||||
@@ -48,7 +47,7 @@ mkdir -p artifacts/
|
||||
tar -cf artifacts/install.tar install
|
||||
cp -Rp .gitlab-ci/common artifacts/ci-common
|
||||
cp -Rp .gitlab-ci/lava artifacts/
|
||||
cp -Rp .gitlab-ci/b2c artifacts/
|
||||
cp -Rp .gitlab-ci/valve artifacts/
|
||||
|
||||
if [ -n "$MINIO_ARTIFACT_NAME" ]; then
|
||||
# Pass needed files to the test stage
|
||||
|
@@ -16,12 +16,3 @@ for driver in freedreno intel v3d; do
|
||||
./run -j${FDO_CI_CONCURRENT:-4} ./shaders \
|
||||
> $ARTIFACTSDIR/${driver}-shader-db.txt
|
||||
done
|
||||
|
||||
# Run shader-db over a number of supported chipsets for nouveau
|
||||
for chipset in 40 a3 c0 e4 f0 134 162; do
|
||||
echo "Running drm-shim for nouveau - $chipset"
|
||||
env LD_PRELOAD=$LIBDIR/libnouveau_noop_drm_shim.so \
|
||||
NOUVEAU_CHIPSET=${chipset} \
|
||||
./run -j${FDO_CI_CONCURRENT:-4} ./shaders \
|
||||
> $ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt
|
||||
done
|
||||
|
@@ -1,25 +1,19 @@
|
||||
# This file list source dependencies to avoid creating/running jobs
|
||||
# those outcome cannot be changed by the modifications from a branch.
|
||||
|
||||
# Rule to filter for only scheduled pipelines.
|
||||
.scheduled_pipeline-rules:
|
||||
rules:
|
||||
- if: &is-scheduled-pipeline '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
when: on_success
|
||||
# Generic rule to not run the job during scheduled pipelines
|
||||
# ----------------------------------------------------------
|
||||
.scheduled_pipelines-rules:
|
||||
rules: &ignore_scheduled_pipelines
|
||||
if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
when: never
|
||||
|
||||
# Generic rule to not run the job during scheduled pipelines. Jobs that aren't
|
||||
# something like a nightly run should include this rule.
|
||||
.no_scheduled_pipelines-rules:
|
||||
# Mesa core source file dependencies
|
||||
# ----------------------------------
|
||||
.mesa-rules:
|
||||
rules:
|
||||
- if: *is-scheduled-pipeline
|
||||
when: never
|
||||
|
||||
# Mesa core source file dependencies that may impact any test job
|
||||
# ---------------------------------------------------------------
|
||||
.core-rules:
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- changes: &core_file_list
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes: &mesa_core_file_list
|
||||
- .gitlab-ci.yml
|
||||
- .gitlab-ci/**/*
|
||||
- include/**/*
|
||||
@@ -28,24 +22,12 @@
|
||||
- src/*
|
||||
- src/compiler/**/*
|
||||
- src/drm-shim/**/*
|
||||
- src/egl/**/*
|
||||
- src/gbm/**/*
|
||||
- src/glx/**/*
|
||||
- src/gtest/**/*
|
||||
- src/hgl/**/*
|
||||
- src/include/**/*
|
||||
# Some src/util and src/compiler files use headers from mesa/ (e.g.
|
||||
# mtypes.h). We should clean that up.
|
||||
- src/mesa/**/*.h
|
||||
- src/tool/**/*
|
||||
- src/util/**/*
|
||||
when: on_success
|
||||
|
||||
# Mesa source file dependencies that may impact any GL driver test job.
|
||||
.gl-rules:
|
||||
rules:
|
||||
- !reference [.core-rules, rules]
|
||||
- changes: &mesa_core_file_list
|
||||
- src/egl/**/*
|
||||
- src/glx/**/*
|
||||
- src/loader/**/*
|
||||
- src/mapi/**/*
|
||||
- src/mesa/*
|
||||
@@ -59,7 +41,22 @@
|
||||
- src/mesa/vbo/**/*
|
||||
- src/mesa/x86/**/*
|
||||
- src/mesa/x86-64/**/*
|
||||
- src/tool/**/*
|
||||
- src/util/**/*
|
||||
|
||||
.vulkan-rules:
|
||||
rules:
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes: &vulkan_file_list
|
||||
- src/vulkan/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
# Gallium core source file dependencies
|
||||
# -------------------------------------
|
||||
.gallium-rules:
|
||||
rules:
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes: &gallium_core_file_list
|
||||
- src/gallium/*
|
||||
- src/gallium/auxiliary/**/*
|
||||
@@ -70,50 +67,63 @@
|
||||
- src/gallium/targets/**/*
|
||||
- src/gallium/tests/**/*
|
||||
- src/gallium/winsys/*
|
||||
when: on_success
|
||||
|
||||
# Source file dependencies that may impact any Vulkan driver build or test
|
||||
.vulkan-rules:
|
||||
rules:
|
||||
- !reference [.core-rules, rules]
|
||||
- changes: &vulkan_file_list
|
||||
- src/vulkan/**/*
|
||||
when: on_success
|
||||
|
||||
.softpipe-rules:
|
||||
stage: software-renderer
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes: &softpipe_file_list
|
||||
- src/gallium/drivers/softpipe/**/*
|
||||
- src/gallium/winsys/sw/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.llvmpipe-rules:
|
||||
stage: software-renderer
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes: &llvmpipe_file_list
|
||||
- src/gallium/drivers/llvmpipe/**/*
|
||||
- src/gallium/winsys/sw/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.lavapipe-rules:
|
||||
stage: software-renderer
|
||||
rules:
|
||||
- !reference [.vulkan-rules, rules]
|
||||
# One could probably be a little more clever here and skip non-gallium Mesa changes (see also .llvmpipe-cl-rules).
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes: &lavapipe_file_list
|
||||
- src/gallium/drivers/llvmpipe/**/*
|
||||
- src/gallium/frontends/lavapipe/**/*
|
||||
- src/gallium/winsys/sw/**/*
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.llvmpipe-cl-rules:
|
||||
stage: software-renderer
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
- .gitlab-ci.yml
|
||||
- .gitlab-ci/**/*
|
||||
@@ -133,80 +143,73 @@
|
||||
- changes: &clover_file_list
|
||||
- src/gallium/frontends/clover/**/*
|
||||
when: on_success
|
||||
|
||||
.collabora-farm-rules:
|
||||
rules:
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
|
||||
.igalia-farm-rules:
|
||||
rules:
|
||||
- if: '$IGALIA_FARM == "offline"'
|
||||
when: never
|
||||
|
||||
# Skips freedreno jobs if either of the farms we use are offline.
|
||||
.freedreno-farm-rules:
|
||||
rules:
|
||||
- if: '$FD_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
|
||||
# Rules for changes that impact either freedreno or turnip.
|
||||
.freedreno-common-rules:
|
||||
rules:
|
||||
- !reference [.freedreno-farm-rules, rules]
|
||||
- changes: &freedreno_core_file_list
|
||||
- src/freedreno/ci/**/*
|
||||
- src/freedreno/common/**/*
|
||||
- src/freedreno/drm/**/*
|
||||
- src/freedreno/fdl/**/*
|
||||
- src/freedreno/ir3/**/*
|
||||
- src/freedreno/isa/**/*
|
||||
- src/freedreno/registers/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.freedreno-rules:
|
||||
stage: freedreno
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- !reference [.freedreno-common-rules, rules]
|
||||
- changes: &freedreno_gl_file_list
|
||||
- src/freedreno/ir2/**/*
|
||||
- if: '$FD_FARM == "offline"'
|
||||
when: never
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- changes: &freedreno_file_list
|
||||
# Note: when https://gitlab.com/gitlab-org/gitlab/-/issues/198688
|
||||
# is supported, we can change the src/freedreno/ rule to explicitly
|
||||
# exclude tools
|
||||
- src/freedreno/**/*
|
||||
- src/gallium/drivers/freedreno/**/*
|
||||
- src/gallium/winsys/freedreno/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.turnip-rules:
|
||||
stage: freedreno
|
||||
rules:
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- !reference [.freedreno-common-rules, rules]
|
||||
- changes:
|
||||
- src/freedreno/vulkan/**/*
|
||||
when: on_success
|
||||
|
||||
# For piglit and skqp test jobs that run both GL and VK tests.
|
||||
.freedreno-turnip-rules:
|
||||
rules:
|
||||
- !reference [.freedreno-rules, rules]
|
||||
- !reference [.turnip-rules, rules]
|
||||
|
||||
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
|
||||
# rules duplication manually
|
||||
.freedreno-rules-restricted:
|
||||
stage: freedreno
|
||||
rules:
|
||||
- if: '$FD_FARM == "offline"'
|
||||
when: never
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
# If the triggerer has access to the restricted traces and if it is pre-merge
|
||||
- if: '($GITLAB_USER_LOGIN !~ "/^(robclark|anholt|flto|cwabbott0|Danil|tomeu|okias)$/") &&
|
||||
- if: '($GITLAB_USER_LOGIN !~ "/^(robclark|anholt|flto|cwabbott0|Danil|tomeu)$/") &&
|
||||
($GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH)'
|
||||
when: never
|
||||
- !reference [.freedreno-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*freedreno_file_list
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
# Rules for GL driver performance tracking. We want them to run as code is
|
||||
# merged to main, but we don't want them to block marge. So, they need to have
|
||||
# only when: never or when: manual, and a separate script maintained by
|
||||
# Collabora triggers the manual job after merge to main.
|
||||
.gl-rules-performance:
|
||||
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
|
||||
# rules duplication manually
|
||||
.freedreno-rules-performance:
|
||||
stage: freedreno
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- if: '$FD_FARM == "offline"'
|
||||
when: never
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- *ignore_scheduled_pipelines
|
||||
# Run only on pre-merge pipelines from Marge
|
||||
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH'
|
||||
when: never
|
||||
@@ -216,37 +219,44 @@
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: manual
|
||||
|
||||
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
|
||||
# rules duplication manually
|
||||
.freedreno-rules-performance:
|
||||
stage: freedreno
|
||||
rules:
|
||||
- !reference [.freedreno-farm-rules, rules]
|
||||
- !reference [.gl-rules-performance, rules]
|
||||
- changes:
|
||||
*freedreno_core_file_list
|
||||
*vulkan_file_list
|
||||
when: manual
|
||||
- changes:
|
||||
*freedreno_gl_file_list
|
||||
*freedreno_file_list
|
||||
when: manual
|
||||
- when: never
|
||||
|
||||
.nouveau-rules:
|
||||
stage: nouveau
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/nouveau/**/*
|
||||
- src/gallium/drivers/nouveau/**/*
|
||||
- src/gallium/winsys/kmsro/**/*
|
||||
- src/gallium/winsys/nouveau/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.panfrost-midgard-rules:
|
||||
stage: arm
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes: &panfrost_gallium_file_list
|
||||
- src/gallium/drivers/panfrost/**/*
|
||||
- src/gallium/winsys/panfrost/**/*
|
||||
@@ -261,85 +271,130 @@
|
||||
- changes:
|
||||
- src/panfrost/midgard/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.panfrost-bifrost-rules:
|
||||
stage: arm
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*panfrost_common_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*panfrost_gallium_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- changes: &panfrost_vulkan_file_list
|
||||
- src/panfrost/vulkan/*
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/panfrost/bifrost/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.vc4-rules:
|
||||
stage: broadcom
|
||||
rules:
|
||||
- !reference [.igalia-farm-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/broadcom/**/*
|
||||
- src/gallium/drivers/vc4/**/*
|
||||
- src/gallium/winsys/kmsro/**/*
|
||||
- src/gallium/winsys/vc4/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.v3d-rules:
|
||||
stage: broadcom
|
||||
rules:
|
||||
- !reference [.igalia-farm-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/broadcom/**/*
|
||||
- src/gallium/drivers/v3d/**/*
|
||||
- src/gallium/winsys/kmsro/**/*
|
||||
- src/gallium/winsys/v3d/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.v3dv-rules:
|
||||
stage: broadcom
|
||||
rules:
|
||||
- !reference [.igalia-farm-rules, rules]
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/broadcom/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.lima-rules:
|
||||
stage: arm
|
||||
rules:
|
||||
- if: '$LIMA_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/gallium/drivers/lima/**/*
|
||||
- src/gallium/winsys/lima/**/*
|
||||
- src/lima/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.radv-rules:
|
||||
stage: amd
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes: &radv_file_list
|
||||
- src/amd/**/*
|
||||
- src/vulkan/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.virgl-rules:
|
||||
stage: layered-backends
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*llvmpipe_file_list
|
||||
when: on_success
|
||||
@@ -347,30 +402,47 @@
|
||||
- src/gallium/drivers/virgl/**/*
|
||||
- src/gallium/winsys/virgl/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
# Unfortunately we can't sed the on_success from another rules set, so we have
|
||||
# to do duplicate the files lists to set the job to manual (see
|
||||
# .gl-rules-performance)
|
||||
.virgl-iris-rules-performance:
|
||||
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
|
||||
# rules duplication manually
|
||||
.virgl-lava-rules-performance:
|
||||
stage: layered-backends
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.gl-rules-performance, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
# Run only on pre-merge pipelines from Marge
|
||||
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: manual
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: manual
|
||||
- changes:
|
||||
*llvmpipe_file_list
|
||||
when: manual
|
||||
- changes:
|
||||
*virgl_file_list
|
||||
when: manual
|
||||
- when: never
|
||||
|
||||
.radeonsi-rules:
|
||||
stage: amd
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes: &radeonsi_file_list
|
||||
- src/gallium/drivers/radeonsi/**/*
|
||||
- src/gallium/include/winsys/**/*
|
||||
- src/gallium/winsys/amdgpu/**/*
|
||||
- src/amd/*
|
||||
- src/amd/addrlib/**/*
|
||||
@@ -378,110 +450,138 @@
|
||||
- src/amd/llvm/**/*
|
||||
- src/amd/registers/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.radeonsi-vaapi-rules:
|
||||
stage: amd
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*radeonsi_file_list
|
||||
when: on_success
|
||||
- changes: &radeon_vcn_file_list
|
||||
- src/gallium/frontends/va/**/*
|
||||
- src/gallium/drivers/radeon/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.i915g-rules:
|
||||
stage: intel
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/gallium/drivers/i915/**/*
|
||||
- src/gallium/winsys/i915/**/*
|
||||
- src/intel/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.crocus-rules:
|
||||
stage: intel
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/gallium/drivers/crocus/**/*
|
||||
- src/gallium/winsys/crocus/**/*
|
||||
- src/intel/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.iris-rules:
|
||||
stage: intel
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes: &iris_file_list
|
||||
- src/gallium/drivers/iris/**/*
|
||||
- src/gallium/winsys/iris/**/*
|
||||
- src/intel/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
# Unfortunately we can't sed the on_success from another rules set, so we have
|
||||
# to do duplicate the files lists to set the job to manual (see
|
||||
# .gl-rules-performance)
|
||||
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
|
||||
# rules duplication manually
|
||||
.iris-rules-performance:
|
||||
stage: intel
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.gl-rules-performance, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
# Run only on pre-merge pipelines from Marge
|
||||
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: manual
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: manual
|
||||
- changes:
|
||||
*iris_file_list
|
||||
when: manual
|
||||
- when: never
|
||||
|
||||
.anv-rules:
|
||||
stage: intel
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
|
||||
when: never
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/intel/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.intel-rules:
|
||||
stage: intel
|
||||
.zink-rules:
|
||||
stage: layered-backends
|
||||
rules:
|
||||
- !reference [.collabora-farm-rules, rules]
|
||||
# Note that we trigger on changes both anv and iris, because piglit and skqp jobs test both.
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- !reference [.gl-rules, rules]
|
||||
- changes: &iris_file_list
|
||||
- src/gallium/drivers/iris/**/*
|
||||
- src/gallium/winsys/iris/**/*
|
||||
- src/intel/**/*
|
||||
when: on_success
|
||||
|
||||
.zink-common-rules:
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*lavapipe_file_list
|
||||
when: on_success
|
||||
- changes: &zink_file_list
|
||||
- src/gallium/drivers/zink/**/*
|
||||
when: on_success
|
||||
|
||||
.zink-lvp-rules:
|
||||
stage: layered-backends
|
||||
rules:
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- !reference [.lavapipe-rules, rules]
|
||||
|
||||
.zink-anv-rules:
|
||||
stage: layered-backends
|
||||
rules:
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- !reference [.anv-rules, rules]
|
||||
|
||||
.zink-turnip-rules:
|
||||
stage: layered-backends
|
||||
rules:
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- !reference [.turnip-rules, rules]
|
||||
- when: never
|
||||
|
||||
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
|
||||
# rules duplication manually
|
||||
@@ -489,67 +589,69 @@
|
||||
rules:
|
||||
- if: '$MICROSOFT_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*softpipe_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*lavapipe_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- changes: &d3d12_file_list
|
||||
- src/gallium/drivers/d3d12/**/*
|
||||
- src/microsoft/**/*
|
||||
- src/gallium/frontends/wgl/*
|
||||
- src/gallium/winsys/d3d12/wgl/*
|
||||
- src/gallium/targets/libgl-gdi/*
|
||||
- src/gallium/targets/libgl-d3d12/*
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/microsoft/**/*
|
||||
*zink_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*radv_file_list
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.glon12-test-rules:
|
||||
.windows-test-rules:
|
||||
rules:
|
||||
- if: '$MICROSOFT_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*lavapipe_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*vulkan_file_list
|
||||
when: on_success
|
||||
- changes: *d3d12_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/microsoft/compiler/*
|
||||
when: on_success
|
||||
|
||||
.spirv2dxil-test-rules:
|
||||
rules:
|
||||
- if: '$MICROSOFT_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- !reference [.core-rules, rules]
|
||||
- changes: &spirv2dxil_file_list
|
||||
- src/microsoft/ci/*
|
||||
- src/microsoft/compiler/*
|
||||
- src/microsoft/spirv_to_dxil/*
|
||||
when: on_success
|
||||
|
||||
.dozen-test-rules:
|
||||
rules:
|
||||
- if: '$MICROSOFT_FARM == "offline"'
|
||||
when: never
|
||||
- !reference [.vulkan-rules, rules]
|
||||
- changes:
|
||||
*spirv2dxil_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/microsoft/vulkan/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.etnaviv-rules:
|
||||
stage: etnaviv
|
||||
rules:
|
||||
- !reference [.gl-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
- src/etnaviv/**/*
|
||||
- src/gallium/drivers/etnaviv/**/*
|
||||
@@ -558,12 +660,18 @@
|
||||
- src/gallium/winsys/kmsro/**/*
|
||||
- src/gallium/winsys/etnaviv/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
# Rules for unusual architectures that only build a subset of drivers
|
||||
.ppc64el-rules:
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*softpipe_file_list
|
||||
when: on_success
|
||||
@@ -579,6 +687,9 @@
|
||||
- changes:
|
||||
*radeonsi_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*zink_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*virgl_file_list
|
||||
when: on_success
|
||||
@@ -586,11 +697,17 @@
|
||||
- src/gallium/drivers/nouveau/**/*
|
||||
- src/gallium/winsys/nouveau/**/*
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.s390x-rules:
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- *ignore_scheduled_pipelines
|
||||
- changes:
|
||||
*mesa_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*gallium_core_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*softpipe_file_list
|
||||
when: on_success
|
||||
@@ -600,3 +717,7 @@
|
||||
- changes:
|
||||
*lavapipe_file_list
|
||||
when: on_success
|
||||
- changes:
|
||||
*zink_file_list
|
||||
when: on_success
|
||||
- when: never
|
||||
|
@@ -1,4 +1,6 @@
|
||||
.test:
|
||||
extends:
|
||||
- .ci-run-policy
|
||||
# Cancel job if a newer commit is pushed to the same branch
|
||||
interruptible: true
|
||||
variables:
|
||||
@@ -98,11 +100,6 @@
|
||||
variables:
|
||||
DEQP_VER: vk
|
||||
|
||||
.skqp-test:
|
||||
variables:
|
||||
HWCI_START_XORG: 1
|
||||
HWCI_TEST_SCRIPT: "/install/skqp-runner.sh"
|
||||
|
||||
.fossilize-test:
|
||||
script:
|
||||
- ./install/fossilize-runner.sh
|
||||
@@ -114,18 +111,18 @@
|
||||
|
||||
.baremetal-test:
|
||||
extends:
|
||||
- .ci-run-policy
|
||||
- .test
|
||||
# Cancel job if a newer commit is pushed to the same branch
|
||||
interruptible: true
|
||||
stage: test
|
||||
before_script:
|
||||
- !reference [default, before_script]
|
||||
# Use this instead of gitlab's artifacts download because it hits packet.net
|
||||
# instead of fd.o. Set FDO_HTTP_CACHE_URI to an http cache for your test lab to
|
||||
# improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for
|
||||
# setup).
|
||||
- echo -e "\e[0Ksection_start:$(date +%s):artifacts_download[collapsed=true]\r\e[0KDownloading artifacts from minio"
|
||||
- wget ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.gz -S --progress=dot:giga -O- | tar -xz
|
||||
- echo -e "\e[0Ksection_end:$(date +%s):artifacts_download\r\e[0K"
|
||||
artifacts:
|
||||
when: always
|
||||
name: "mesa_${CI_JOB_NAME}"
|
||||
@@ -137,37 +134,21 @@
|
||||
reports:
|
||||
junit: results/junit.xml
|
||||
|
||||
# ARM testing of bare-metal boards attached to an x86 gitlab-runner system
|
||||
.baremetal-test-armhf:
|
||||
extends:
|
||||
- .baremetal-test
|
||||
- .use-debian/arm_test
|
||||
variables:
|
||||
BM_ROOTFS: /rootfs-armhf
|
||||
MINIO_ARTIFACT_NAME: mesa-armhf
|
||||
needs:
|
||||
- debian/arm_test
|
||||
- job: debian-armhf
|
||||
artifacts: false
|
||||
|
||||
# ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system
|
||||
.baremetal-test-arm64:
|
||||
extends:
|
||||
- .baremetal-test
|
||||
- .use-debian/arm_test
|
||||
variables:
|
||||
BM_ROOTFS: /rootfs-arm64
|
||||
MINIO_ARTIFACT_NAME: mesa-arm64
|
||||
needs:
|
||||
- debian/arm_test
|
||||
- job: debian-arm64
|
||||
artifacts: false
|
||||
|
||||
# ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system, using an asan mesa build
|
||||
.baremetal-arm64-asan-test:
|
||||
extends:
|
||||
- .baremetal-test
|
||||
- .use-debian/arm_test
|
||||
variables:
|
||||
DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.6:/install/lib/libdlclose-skip.so"
|
||||
MINIO_ARTIFACT_NAME: mesa-arm64-asan
|
||||
@@ -199,25 +180,26 @@
|
||||
# depend on more than one image per job. So, the job container is
|
||||
# built as part of the CI in the boot2container project.
|
||||
image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2022-03-03.2
|
||||
timeout: 1h 40m
|
||||
extends:
|
||||
- .use-debian/x86_test-vk
|
||||
variables:
|
||||
# No need by default to pull the whole repo
|
||||
GIT_STRATEGY: none
|
||||
# boot2container initrd configuration parameters.
|
||||
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/144/download' # 5.17.1
|
||||
B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.6/downloads/initramfs.linux_amd64.cpio.xz'
|
||||
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/117/download' # 5.16-for-mesa-ci
|
||||
B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.4/downloads/initramfs.linux_amd64.cpio.xz'
|
||||
B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$'
|
||||
B2C_JOB_WARN_REGEX: '\*ERROR\* ring .* timeout, but soft recovered'
|
||||
B2C_JOB_WARN_REGEX: 'null'
|
||||
B2C_LOG_LEVEL: 6
|
||||
B2C_POWEROFF_DELAY: 15
|
||||
B2C_SESSION_END_REGEX: '^.*It''s now safe to turn off your computer\r$'
|
||||
B2C_SESSION_REBOOT_REGEX: '(GPU hang detected!|\*ERROR\* ring [^\s]+ timeout(?!, but soft recovered)|The CS has been cancelled because the context is lost)'
|
||||
B2C_TIMEOUT_BOOT_MINUTES: 45
|
||||
B2C_TIMEOUT_BOOT_RETRIES: 1
|
||||
B2C_SESSION_REBOOT_REGEX: 'GPU hang detected!'
|
||||
B2C_TIMEOUT_BOOT_MINUTES: 240
|
||||
B2C_TIMEOUT_BOOT_RETRIES: 2
|
||||
B2C_TIMEOUT_FIRST_MINUTES: 5
|
||||
B2C_TIMEOUT_FIRST_RETRIES: 3
|
||||
B2C_TIMEOUT_MINUTES: 2
|
||||
B2C_TIMEOUT_OVERALL_MINUTES: 90
|
||||
B2C_TIMEOUT_OVERALL_MINUTES: 240
|
||||
B2C_TIMEOUT_RETRIES: 0
|
||||
|
||||
# As noted in the top description, we make a distinction between the
|
||||
@@ -226,12 +208,11 @@
|
||||
# we rename the MESA_IMAGE variable into IMAGE_UNDER_TEST.
|
||||
IMAGE_UNDER_TEST: "$MESA_IMAGE"
|
||||
|
||||
INSTALL_TARBALL_NAME: "install.tar"
|
||||
INSTALL_TARBALL: "./artifacts/${INSTALL_TARBALL_NAME}"
|
||||
CI_B2C_ARTIFACTS: "./artifacts/b2c"
|
||||
INSTALL_TARBALL: "./artifacts/install.tar"
|
||||
CI_VALVE_ARTIFACTS: "./artifacts/valve"
|
||||
CI_COMMON_SCRIPTS: "./artifacts/ci-common"
|
||||
GENERATE_ENV_SCRIPT: "${CI_COMMON_SCRIPTS}/generate-env.sh"
|
||||
B2C_JOB_TEMPLATE: "${CI_B2C_ARTIFACTS}/b2c.yml.jinja2.jinja2"
|
||||
B2C_JOB_TEMPLATE: "${CI_VALVE_ARTIFACTS}/b2c.yml.jinja2.jinja2"
|
||||
JOB_FOLDER: "job_folder"
|
||||
before_script:
|
||||
# We don't want the tarball unpacking of .test, but will take the JWT bits.
|
||||
@@ -255,15 +236,15 @@
|
||||
fi
|
||||
|
||||
[ -s "$INSTALL_TARBALL" ] || exit 1
|
||||
[ -d "$CI_B2C_ARTIFACTS" ] || exit 1
|
||||
[ -d "$CI_VALVE_ARTIFACTS" ] || exit 1
|
||||
[ -d "$CI_COMMON_SCRIPTS" ] || exit 1
|
||||
|
||||
|
||||
B2C_TEST_SCRIPT="bash -c 'source ./set-job-env-vars.sh; tar xf ${INSTALL_TARBALL_NAME}; ${B2C_TEST_SCRIPT}'"
|
||||
B2C_TEST_SCRIPT="bash -c 'source ./set-job-env-vars.sh ; ${B2C_TEST_SCRIPT}'"
|
||||
|
||||
# The Valve CI gateway receives jobs in a YAML format. Create a
|
||||
# job description from the CI environment.
|
||||
python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py \
|
||||
python3 "$CI_VALVE_ARTIFACTS"/generate_b2c.py \
|
||||
--ci-job-id "${CI_JOB_ID}" \
|
||||
--container-cmd "${B2C_TEST_SCRIPT}" \
|
||||
--initramfs-url "${B2C_INITRAMFS_URL}" \
|
||||
@@ -302,8 +283,9 @@
|
||||
echo "export CI_JOB_JWT=${CI_JOB_JWT}" >> ${JOB_FOLDER}/set-job-env-vars.sh
|
||||
set -x
|
||||
|
||||
# Copy the mesa install tarball to the job folder, for later extraction
|
||||
mv "${INSTALL_TARBALL}" "${JOB_FOLDER}"
|
||||
# Extract the Mesa distribution into the location expected by
|
||||
# the Mesa CI deqp-runner scripts.
|
||||
tar x -C ${JOB_FOLDER} -f $INSTALL_TARBALL
|
||||
|
||||
script: |
|
||||
slugify () {
|
||||
@@ -320,6 +302,9 @@
|
||||
# Gitlab coordinator for status presentation. results/junit.xml
|
||||
# will be parsed by the UI for more detailed explanations of
|
||||
# test execution.
|
||||
needs:
|
||||
- debian/x86_test-vk
|
||||
- debian-testing
|
||||
artifacts:
|
||||
when: always
|
||||
name: "mesa_${CI_JOB_NAME}"
|
||||
@@ -327,19 +312,3 @@
|
||||
- ${JOB_FOLDER}/results
|
||||
reports:
|
||||
junit: ${JOB_FOLDER}/results/junit.xml
|
||||
|
||||
.b2c-test-vk:
|
||||
extends:
|
||||
- .use-debian/x86_test-vk
|
||||
- .b2c-test
|
||||
needs:
|
||||
- debian/x86_test-vk
|
||||
- debian-testing
|
||||
|
||||
.b2c-test-gl:
|
||||
extends:
|
||||
- .use-debian/x86_test-gl
|
||||
- .b2c-test
|
||||
needs:
|
||||
- debian/x86_test-gl
|
||||
- debian-testing
|
||||
|
@@ -1,56 +0,0 @@
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
from freezegun import freeze_time
|
||||
|
||||
from .lava.helpers import generate_testsuite_result, jobs_logs_response
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
config.addinivalue_line(
|
||||
"markers", "slow: marks tests as slow (deselect with '-m \"not slow\"')"
|
||||
)
|
||||
|
||||
@pytest.fixture
|
||||
def mock_sleep():
|
||||
"""Mock time.sleep to make test faster"""
|
||||
with patch("time.sleep", return_value=None):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def frozen_time(mock_sleep):
|
||||
with freeze_time() as frozen_time:
|
||||
yield frozen_time
|
||||
|
||||
|
||||
RESULT_GET_TESTJOB_RESULTS = [{"metadata": {"result": "test"}}]
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_proxy():
|
||||
def create_proxy_mock(
|
||||
job_results=RESULT_GET_TESTJOB_RESULTS,
|
||||
testsuite_results=[generate_testsuite_result()],
|
||||
**kwargs
|
||||
):
|
||||
proxy_mock = MagicMock()
|
||||
proxy_submit_mock = proxy_mock.scheduler.jobs.submit
|
||||
proxy_submit_mock.return_value = "1234"
|
||||
|
||||
proxy_results_mock = proxy_mock.results.get_testjob_results_yaml
|
||||
proxy_results_mock.return_value = yaml.safe_dump(job_results)
|
||||
|
||||
proxy_test_suites_mock = proxy_mock.results.get_testsuite_results_yaml
|
||||
proxy_test_suites_mock.return_value = yaml.safe_dump(testsuite_results)
|
||||
|
||||
proxy_logs_mock = proxy_mock.scheduler.jobs.logs
|
||||
proxy_logs_mock.return_value = jobs_logs_response()
|
||||
|
||||
for key, value in kwargs.items():
|
||||
setattr(proxy_logs_mock, key, value)
|
||||
|
||||
return proxy_mock
|
||||
|
||||
yield create_proxy_mock
|
@@ -1,139 +0,0 @@
|
||||
from contextlib import nullcontext as does_not_raise
|
||||
from datetime import datetime
|
||||
from itertools import cycle
|
||||
from typing import Callable, Generator, Iterable, Optional, Tuple, Union
|
||||
|
||||
import yaml
|
||||
from freezegun import freeze_time
|
||||
from lava.utils.log_section import (
|
||||
DEFAULT_GITLAB_SECTION_TIMEOUTS,
|
||||
FALLBACK_GITLAB_SECTION_TIMEOUT,
|
||||
LogSectionType,
|
||||
)
|
||||
|
||||
|
||||
def section_timeout(section_type: LogSectionType) -> int:
|
||||
return int(
|
||||
DEFAULT_GITLAB_SECTION_TIMEOUTS.get(
|
||||
section_type, FALLBACK_GITLAB_SECTION_TIMEOUT
|
||||
).total_seconds()
|
||||
)
|
||||
|
||||
|
||||
def create_lava_yaml_msg(
|
||||
dt: Callable = datetime.now, msg="test", lvl="target"
|
||||
) -> dict[str, str]:
|
||||
return {"dt": str(dt()), "msg": msg, "lvl": lvl}
|
||||
|
||||
|
||||
def generate_testsuite_result(
|
||||
name="test-mesa-ci", result="pass", metadata_extra=None, extra=None
|
||||
):
|
||||
if metadata_extra is None:
|
||||
metadata_extra = {}
|
||||
if extra is None:
|
||||
extra = {}
|
||||
return {"metadata": {"result": result, **metadata_extra}, "name": name}
|
||||
|
||||
|
||||
def jobs_logs_response(
|
||||
finished=False, msg=None, lvl="target", result=None
|
||||
) -> Tuple[bool, str]:
|
||||
timed_msg = {"dt": str(datetime.now()), "msg": "New message", "lvl": lvl}
|
||||
if result:
|
||||
timed_msg["lvl"] = "target"
|
||||
timed_msg["msg"] = f"hwci: mesa: {result}"
|
||||
|
||||
logs = [timed_msg] if msg is None else msg
|
||||
|
||||
return finished, yaml.safe_dump(logs)
|
||||
|
||||
|
||||
def section_aware_message_generator(
|
||||
messages: dict[LogSectionType, Iterable[int]], result: Optional[str] = None
|
||||
) -> Iterable[tuple[dict, Iterable[int]]]:
|
||||
default = [1]
|
||||
|
||||
result_message_section = LogSectionType.TEST_CASE
|
||||
|
||||
for section_type in LogSectionType:
|
||||
delay = messages.get(section_type, default)
|
||||
yield mock_lava_signal(section_type), delay
|
||||
if result and section_type == result_message_section:
|
||||
# To consider the job finished, the result `echo` should be produced
|
||||
# in the correct section
|
||||
yield create_lava_yaml_msg(msg=f"hwci: mesa: {result}"), delay
|
||||
|
||||
|
||||
def message_generator():
|
||||
for section_type in LogSectionType:
|
||||
yield mock_lava_signal(section_type)
|
||||
|
||||
|
||||
def level_generator():
|
||||
# Tests all known levels by default
|
||||
yield from cycle(("results", "feedback", "warning", "error", "debug", "target"))
|
||||
|
||||
|
||||
def generate_n_logs(
|
||||
n=1,
|
||||
tick_fn: Union[Generator, Iterable[int], int] = 1,
|
||||
level_fn=level_generator,
|
||||
result="pass",
|
||||
):
|
||||
"""Simulate a log partitionated in n components"""
|
||||
level_gen = level_fn()
|
||||
|
||||
if isinstance(tick_fn, Generator):
|
||||
tick_gen = tick_fn
|
||||
elif isinstance(tick_fn, Iterable):
|
||||
tick_gen = cycle(tick_fn)
|
||||
else:
|
||||
tick_gen = cycle((tick_fn,))
|
||||
|
||||
with freeze_time(datetime.now()) as time_travel:
|
||||
tick_sec: int = next(tick_gen)
|
||||
while True:
|
||||
# Simulate a scenario where the target job is waiting for being started
|
||||
for _ in range(n - 1):
|
||||
level: str = next(level_gen)
|
||||
|
||||
time_travel.tick(tick_sec)
|
||||
yield jobs_logs_response(finished=False, msg=[], lvl=level)
|
||||
|
||||
time_travel.tick(tick_sec)
|
||||
yield jobs_logs_response(finished=True, result=result)
|
||||
|
||||
|
||||
def to_iterable(tick_fn):
|
||||
if isinstance(tick_fn, Generator):
|
||||
return tick_fn
|
||||
elif isinstance(tick_fn, Iterable):
|
||||
return cycle(tick_fn)
|
||||
else:
|
||||
return cycle((tick_fn,))
|
||||
|
||||
|
||||
def mock_logs(messages=None, result=None):
|
||||
if messages is None:
|
||||
messages = {}
|
||||
with freeze_time(datetime.now()) as time_travel:
|
||||
# Simulate a complete run given by message_fn
|
||||
for msg, tick_list in section_aware_message_generator(messages, result):
|
||||
for tick_sec in tick_list:
|
||||
yield jobs_logs_response(finished=False, msg=[msg])
|
||||
time_travel.tick(tick_sec)
|
||||
|
||||
|
||||
def mock_lava_signal(type: LogSectionType) -> dict[str, str]:
|
||||
return {
|
||||
LogSectionType.TEST_CASE: create_lava_yaml_msg(
|
||||
msg="<STARTTC> case", lvl="debug"
|
||||
),
|
||||
LogSectionType.TEST_SUITE: create_lava_yaml_msg(
|
||||
msg="<STARTRUN> suite", lvl="debug"
|
||||
),
|
||||
LogSectionType.LAVA_POST_PROCESSING: create_lava_yaml_msg(
|
||||
msg="<LAVA_SIGNAL_ENDTC case>", lvl="target"
|
||||
),
|
||||
}.get(type, create_lava_yaml_msg())
|
@@ -3,40 +3,91 @@
|
||||
# Copyright (C) 2022 Collabora Limited
|
||||
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
import xmlrpc.client
|
||||
from contextlib import nullcontext as does_not_raise
|
||||
from datetime import datetime
|
||||
from itertools import chain, repeat
|
||||
from itertools import repeat
|
||||
from typing import Tuple
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from lava.exceptions import MesaCIException, MesaCIRetryError
|
||||
import yaml
|
||||
from freezegun import freeze_time
|
||||
from lava.lava_job_submitter import (
|
||||
DEVICE_HANGING_TIMEOUT_SEC,
|
||||
NUMBER_OF_RETRIES_TIMEOUT_DETECTION,
|
||||
LAVAJob,
|
||||
follow_job_execution,
|
||||
hide_sensitive_data,
|
||||
retriable_follow_job,
|
||||
)
|
||||
from lava.utils import LogSectionType
|
||||
|
||||
from .lava.helpers import (
|
||||
generate_n_logs,
|
||||
generate_testsuite_result,
|
||||
jobs_logs_response,
|
||||
mock_lava_signal,
|
||||
mock_logs,
|
||||
section_timeout,
|
||||
)
|
||||
|
||||
NUMBER_OF_MAX_ATTEMPTS = NUMBER_OF_RETRIES_TIMEOUT_DETECTION + 1
|
||||
def jobs_logs_response(finished=False, msg=None) -> Tuple[bool, str]:
|
||||
timed_msg = {"dt": str(datetime.now()), "msg": "New message"}
|
||||
logs = [timed_msg] if msg is None else msg
|
||||
|
||||
return finished, yaml.safe_dump(logs)
|
||||
|
||||
|
||||
def result_get_testjob_results_response() -> str:
|
||||
result = {"result": "test"}
|
||||
results = [{"metadata": result}]
|
||||
|
||||
return yaml.safe_dump(results)
|
||||
|
||||
|
||||
def result_get_testcase_results_response() -> str:
|
||||
result = {"result": "pass"}
|
||||
test_cases = [result]
|
||||
|
||||
return yaml.safe_dump(test_cases)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_proxy():
|
||||
def create_proxy_mock(**kwargs):
|
||||
proxy_mock = MagicMock()
|
||||
proxy_submit_mock = proxy_mock.scheduler.jobs.submit
|
||||
proxy_submit_mock.return_value = "1234"
|
||||
|
||||
proxy_results_mock = proxy_mock.results.get_testjob_results_yaml
|
||||
proxy_results_mock.return_value = result_get_testjob_results_response()
|
||||
|
||||
proxy_test_cases_mock = proxy_mock.results.get_testcase_results_yaml
|
||||
proxy_test_cases_mock.return_value = result_get_testcase_results_response()
|
||||
|
||||
proxy_logs_mock = proxy_mock.scheduler.jobs.logs
|
||||
proxy_logs_mock.return_value = jobs_logs_response()
|
||||
for key, value in kwargs.items():
|
||||
setattr(proxy_logs_mock, key, value)
|
||||
|
||||
return proxy_mock
|
||||
|
||||
yield create_proxy_mock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_proxy_waiting_time(mock_proxy):
|
||||
def update_mock_proxy(frozen_time, **kwargs):
|
||||
wait_time = kwargs.pop("wait_time", 1)
|
||||
wait_time = kwargs.pop("wait_time", 0)
|
||||
proxy_mock = mock_proxy(**kwargs)
|
||||
proxy_job_state = proxy_mock.scheduler.job_state
|
||||
proxy_job_state.return_value = {"job_state": "Running"}
|
||||
@@ -47,167 +98,101 @@ def mock_proxy_waiting_time(mock_proxy):
|
||||
return update_mock_proxy
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_sleep():
|
||||
"""Mock time.sleep to make test faster"""
|
||||
with patch("time.sleep", return_value=None):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def frozen_time(mock_sleep):
|
||||
with freeze_time() as frozen_time:
|
||||
yield frozen_time
|
||||
|
||||
|
||||
@pytest.mark.parametrize("exception", [RuntimeError, SystemError, KeyError])
|
||||
def test_submit_and_follow_respects_exceptions(mock_sleep, mock_proxy, exception):
|
||||
with pytest.raises(MesaCIException):
|
||||
proxy = mock_proxy(side_effect=exception)
|
||||
job = LAVAJob(proxy, '')
|
||||
follow_job_execution(job)
|
||||
with pytest.raises(exception):
|
||||
follow_job_execution(mock_proxy(side_effect=exception), "")
|
||||
|
||||
|
||||
def generate_n_logs(n=1, tick_sec=1):
|
||||
"""Simulate a log partitionated in n components"""
|
||||
with freeze_time(datetime.now()) as time_travel:
|
||||
while True:
|
||||
# Simulate a scenario where the target job is waiting for being started
|
||||
for _ in range(n - 1):
|
||||
time_travel.tick(tick_sec)
|
||||
yield jobs_logs_response(finished=False, msg=[])
|
||||
|
||||
time_travel.tick(tick_sec)
|
||||
yield jobs_logs_response(finished=True)
|
||||
|
||||
|
||||
NETWORK_EXCEPTION = xmlrpc.client.ProtocolError("", 0, "test", {})
|
||||
XMLRPC_FAULT = xmlrpc.client.Fault(0, "test")
|
||||
|
||||
PROXY_SCENARIOS = {
|
||||
"simple pass case": (mock_logs(result="pass"), does_not_raise(), "pass", {}),
|
||||
"simple fail case": (mock_logs(result="fail"), does_not_raise(), "fail", {}),
|
||||
"simple hung case": (
|
||||
mock_logs(
|
||||
messages={
|
||||
LogSectionType.TEST_CASE: [
|
||||
section_timeout(LogSectionType.TEST_CASE) + 1
|
||||
]
|
||||
* 1000
|
||||
},
|
||||
result="fail",
|
||||
),
|
||||
pytest.raises(MesaCIRetryError),
|
||||
"hung",
|
||||
{},
|
||||
),
|
||||
"leftover dump from last job in boot section": (
|
||||
(
|
||||
mock_lava_signal(LogSectionType.LAVA_BOOT),
|
||||
jobs_logs_response(finished=False, msg=None, result="fail"),
|
||||
),
|
||||
pytest.raises(MesaCIRetryError),
|
||||
"hung",
|
||||
{},
|
||||
),
|
||||
"boot works at last retry": (
|
||||
mock_logs(
|
||||
messages={
|
||||
LogSectionType.LAVA_BOOT: [
|
||||
section_timeout(LogSectionType.LAVA_BOOT) + 1
|
||||
]
|
||||
* NUMBER_OF_RETRIES_TIMEOUT_DETECTION
|
||||
+ [1]
|
||||
},
|
||||
result="pass",
|
||||
),
|
||||
"finish case": (generate_n_logs(1), does_not_raise(), True),
|
||||
"works at last retry": (
|
||||
generate_n_logs(n=3, tick_sec=DEVICE_HANGING_TIMEOUT_SEC + 1),
|
||||
does_not_raise(),
|
||||
"pass",
|
||||
{},
|
||||
),
|
||||
"test case took too long": pytest.param(
|
||||
mock_logs(
|
||||
messages={
|
||||
LogSectionType.TEST_CASE: [
|
||||
section_timeout(LogSectionType.TEST_CASE) + 1
|
||||
]
|
||||
* (NUMBER_OF_MAX_ATTEMPTS + 1)
|
||||
},
|
||||
result="pass",
|
||||
),
|
||||
pytest.raises(MesaCIRetryError),
|
||||
"pass",
|
||||
{},
|
||||
True,
|
||||
),
|
||||
"timed out more times than retry attempts": (
|
||||
generate_n_logs(n=4, tick_fn=9999999),
|
||||
pytest.raises(MesaCIRetryError),
|
||||
"fail",
|
||||
{},
|
||||
generate_n_logs(n=4, tick_sec=DEVICE_HANGING_TIMEOUT_SEC + 1),
|
||||
does_not_raise(),
|
||||
False,
|
||||
),
|
||||
"long log case, no silence": (
|
||||
mock_logs(
|
||||
messages={LogSectionType.TEST_CASE: [1] * (1000)},
|
||||
result="pass",
|
||||
),
|
||||
generate_n_logs(n=1000, tick_sec=0),
|
||||
does_not_raise(),
|
||||
"pass",
|
||||
{},
|
||||
),
|
||||
"no retries, testsuite succeed": (
|
||||
mock_logs(result="pass"),
|
||||
does_not_raise(),
|
||||
"pass",
|
||||
{
|
||||
"testsuite_results": [
|
||||
generate_testsuite_result(result="pass")
|
||||
]
|
||||
},
|
||||
),
|
||||
"no retries, but testsuite fails": (
|
||||
mock_logs(result="fail"),
|
||||
does_not_raise(),
|
||||
"fail",
|
||||
{
|
||||
"testsuite_results": [
|
||||
generate_testsuite_result(result="fail")
|
||||
]
|
||||
},
|
||||
),
|
||||
"no retries, one testsuite fails": (
|
||||
generate_n_logs(n=1, tick_fn=0, result="fail"),
|
||||
does_not_raise(),
|
||||
"fail",
|
||||
{
|
||||
"testsuite_results": [
|
||||
generate_testsuite_result(result="fail"),
|
||||
generate_testsuite_result(result="pass")
|
||||
]
|
||||
},
|
||||
True,
|
||||
),
|
||||
"very long silence": (
|
||||
generate_n_logs(n=NUMBER_OF_MAX_ATTEMPTS + 1, tick_fn=100000),
|
||||
pytest.raises(MesaCIRetryError),
|
||||
"fail",
|
||||
{},
|
||||
generate_n_logs(n=4, tick_sec=100000),
|
||||
does_not_raise(),
|
||||
False,
|
||||
),
|
||||
# If a protocol error happens, _call_proxy will retry without affecting timeouts
|
||||
"unstable connection, ProtocolError followed by final message": (
|
||||
(NETWORK_EXCEPTION, *list(mock_logs(result="pass"))),
|
||||
(NETWORK_EXCEPTION, jobs_logs_response(finished=True)),
|
||||
does_not_raise(),
|
||||
"pass",
|
||||
{},
|
||||
True,
|
||||
),
|
||||
# After an arbitrary number of retries, _call_proxy should call sys.exit
|
||||
"unreachable case, subsequent ProtocolErrors": (
|
||||
repeat(NETWORK_EXCEPTION),
|
||||
pytest.raises(SystemExit),
|
||||
"fail",
|
||||
{},
|
||||
False,
|
||||
),
|
||||
"XMLRPC Fault": ([XMLRPC_FAULT], pytest.raises(SystemExit, match="1"), False, {}),
|
||||
"XMLRPC Fault": ([XMLRPC_FAULT], pytest.raises(SystemExit, match="1"), False),
|
||||
}
|
||||
|
||||
|
||||
@patch("time.sleep", return_value=None) # mock sleep to make test faster
|
||||
@pytest.mark.parametrize(
|
||||
"test_log, expectation, job_result, proxy_args",
|
||||
"side_effect, expectation, has_finished",
|
||||
PROXY_SCENARIOS.values(),
|
||||
ids=PROXY_SCENARIOS.keys(),
|
||||
)
|
||||
def test_retriable_follow_job(
|
||||
mock_sleep,
|
||||
test_log,
|
||||
expectation,
|
||||
job_result,
|
||||
proxy_args,
|
||||
mock_proxy,
|
||||
mock_sleep, side_effect, expectation, has_finished, mock_proxy
|
||||
):
|
||||
with expectation:
|
||||
proxy = mock_proxy(side_effect=test_log, **proxy_args)
|
||||
job: LAVAJob = retriable_follow_job(proxy, "")
|
||||
assert job_result == job.status
|
||||
result = retriable_follow_job(mock_proxy(side_effect=side_effect), "")
|
||||
assert has_finished == result
|
||||
|
||||
|
||||
WAIT_FOR_JOB_SCENARIOS = {"one log run taking (sec):": (mock_logs(result="pass"))}
|
||||
WAIT_FOR_JOB_SCENARIOS = {
|
||||
"one log run taking (sec):": (generate_n_logs(1), True),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("wait_time", (DEVICE_HANGING_TIMEOUT_SEC * 2,))
|
||||
@pytest.mark.parametrize("wait_time", (0, DEVICE_HANGING_TIMEOUT_SEC * 2))
|
||||
@pytest.mark.parametrize(
|
||||
"side_effect",
|
||||
"side_effect, has_finished",
|
||||
WAIT_FOR_JOB_SCENARIOS.values(),
|
||||
ids=WAIT_FOR_JOB_SCENARIOS.keys(),
|
||||
)
|
||||
@@ -215,10 +200,11 @@ def test_simulate_a_long_wait_to_start_a_job(
|
||||
frozen_time,
|
||||
wait_time,
|
||||
side_effect,
|
||||
has_finished,
|
||||
mock_proxy_waiting_time,
|
||||
):
|
||||
start_time = datetime.now()
|
||||
job: LAVAJob = retriable_follow_job(
|
||||
result = retriable_follow_job(
|
||||
mock_proxy_waiting_time(
|
||||
frozen_time, side_effect=side_effect, wait_time=wait_time
|
||||
),
|
||||
@@ -228,127 +214,37 @@ def test_simulate_a_long_wait_to_start_a_job(
|
||||
end_time = datetime.now()
|
||||
delta_time = end_time - start_time
|
||||
|
||||
assert job.status == "pass"
|
||||
assert has_finished == result
|
||||
assert delta_time.total_seconds() >= wait_time
|
||||
|
||||
|
||||
|
||||
CORRUPTED_LOG_SCENARIOS = {
|
||||
"too much subsequent corrupted data": (
|
||||
[(False, "{'msg': 'Incomplete}")] * 100 + [jobs_logs_response(True)],
|
||||
pytest.raises((MesaCIRetryError)),
|
||||
SENSITIVE_DATA_SCENARIOS = {
|
||||
"no sensitive data tagged": (
|
||||
["bla bla", "mytoken: asdkfjsde1341=="],
|
||||
["bla bla", "mytoken: asdkfjsde1341=="],
|
||||
"HIDEME",
|
||||
),
|
||||
"one subsequent corrupted data": (
|
||||
[(False, "{'msg': 'Incomplete}")] * 2 + [jobs_logs_response(True)],
|
||||
does_not_raise(),
|
||||
"sensitive data tagged": (
|
||||
["bla bla", "mytoken: asdkfjsde1341== # HIDEME"],
|
||||
["bla bla"],
|
||||
"HIDEME",
|
||||
),
|
||||
"sensitive data tagged with custom word": (
|
||||
["bla bla", "mytoken: asdkfjsde1341== # DELETETHISLINE", "third line"],
|
||||
["bla bla", "third line"],
|
||||
"DELETETHISLINE",
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"data_sequence, expected_exception",
|
||||
CORRUPTED_LOG_SCENARIOS.values(),
|
||||
ids=CORRUPTED_LOG_SCENARIOS.keys(),
|
||||
"input, expectation, tag",
|
||||
SENSITIVE_DATA_SCENARIOS.values(),
|
||||
ids=SENSITIVE_DATA_SCENARIOS.keys(),
|
||||
)
|
||||
def test_log_corruption(mock_sleep, data_sequence, expected_exception, mock_proxy):
|
||||
proxy_mock = mock_proxy()
|
||||
proxy_logs_mock = proxy_mock.scheduler.jobs.logs
|
||||
proxy_logs_mock.side_effect = data_sequence
|
||||
with expected_exception:
|
||||
retriable_follow_job(proxy_mock, "")
|
||||
def test_hide_sensitive_data(input, expectation, tag):
|
||||
yaml_data = yaml.safe_dump(input)
|
||||
yaml_result = hide_sensitive_data(yaml_data, tag)
|
||||
result = yaml.safe_load(yaml_result)
|
||||
|
||||
|
||||
LAVA_RESULT_LOG_SCENARIOS = {
|
||||
# the submitter should accept xtrace logs
|
||||
"Bash xtrace echo with kmsg interleaving": (
|
||||
"echo hwci: mesa: pass[ 737.673352] <LAVA_SIGNAL_ENDTC mesa-ci>",
|
||||
"pass",
|
||||
),
|
||||
# the submitter should accept xtrace logs
|
||||
"kmsg result print": (
|
||||
"[ 737.673352] hwci: mesa: pass",
|
||||
"pass",
|
||||
),
|
||||
# if the job result echo has a very bad luck, it still can be interleaved
|
||||
# with kmsg
|
||||
"echo output with kmsg interleaving": (
|
||||
"hwci: mesa: pass[ 737.673352] <LAVA_SIGNAL_ENDTC mesa-ci>",
|
||||
"pass",
|
||||
),
|
||||
"fail case": (
|
||||
"hwci: mesa: fail",
|
||||
"fail",
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"message, expectation",
|
||||
LAVA_RESULT_LOG_SCENARIOS.values(),
|
||||
ids=LAVA_RESULT_LOG_SCENARIOS.keys(),
|
||||
)
|
||||
def test_parse_job_result_from_log(message, expectation, mock_proxy):
|
||||
job = LAVAJob(mock_proxy(), "")
|
||||
job.parse_job_result_from_log([message])
|
||||
|
||||
assert job.status == expectation
|
||||
|
||||
|
||||
@pytest.mark.slow(
|
||||
reason="Slow and sketchy test. Needs a LAVA log raw file at /tmp/log.yaml"
|
||||
)
|
||||
def test_full_yaml_log(mock_proxy, frozen_time):
|
||||
import itertools
|
||||
import random
|
||||
from datetime import datetime
|
||||
|
||||
import yaml
|
||||
|
||||
def time_travel_from_log_chunk(data_chunk):
|
||||
if not data_chunk:
|
||||
return
|
||||
|
||||
first_log_time = data_chunk[0]["dt"]
|
||||
frozen_time.move_to(first_log_time)
|
||||
yield
|
||||
|
||||
last_log_time = data_chunk[-1]["dt"]
|
||||
frozen_time.move_to(last_log_time)
|
||||
return
|
||||
|
||||
def time_travel_to_test_time():
|
||||
# Suppose that the first message timestamp of the entire LAVA job log is
|
||||
# the same of from the job submitter execution
|
||||
with open("/tmp/log.yaml", "r") as f:
|
||||
first_log = f.readline()
|
||||
first_log_time = yaml.safe_load(first_log)[0]["dt"]
|
||||
frozen_time.move_to(first_log_time)
|
||||
|
||||
def load_lines() -> list:
|
||||
with open("/tmp/log.yaml", "r") as f:
|
||||
data = yaml.safe_load(f)
|
||||
chain = itertools.chain(data)
|
||||
try:
|
||||
while True:
|
||||
data_chunk = [next(chain) for _ in range(random.randint(0, 50))]
|
||||
# Suppose that the first message timestamp is the same of
|
||||
# log fetch RPC call
|
||||
time_travel_from_log_chunk(data_chunk)
|
||||
yield False, []
|
||||
# Travel to the same datetime of the last fetched log line
|
||||
# in the chunk
|
||||
time_travel_from_log_chunk(data_chunk)
|
||||
yield False, data_chunk
|
||||
except StopIteration:
|
||||
yield True, data_chunk
|
||||
return
|
||||
|
||||
proxy = mock_proxy()
|
||||
|
||||
def reset_logs(*args):
|
||||
proxy.scheduler.jobs.logs.side_effect = load_lines()
|
||||
|
||||
proxy.scheduler.jobs.submit = reset_logs
|
||||
with pytest.raises(MesaCIRetryError):
|
||||
time_travel_to_test_time()
|
||||
retriable_follow_job(proxy, "")
|
||||
assert result == expectation
|
||||
|
@@ -1,349 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (C) 2022 Collabora Limited
|
||||
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
from lava.exceptions import MesaCIKnownIssueException, MesaCITimeoutError
|
||||
from lava.utils import (
|
||||
GitlabSection,
|
||||
LogFollower,
|
||||
LogSectionType,
|
||||
fix_lava_color_log,
|
||||
fix_lava_gitlab_section_log,
|
||||
hide_sensitive_data,
|
||||
)
|
||||
|
||||
from ..lava.helpers import create_lava_yaml_msg, does_not_raise
|
||||
|
||||
GITLAB_SECTION_SCENARIOS = {
|
||||
"start collapsed": (
|
||||
"start",
|
||||
True,
|
||||
f"\x1b[0Ksection_start:mock_date:my_first_section[collapsed=true]\r\x1b[0K{GitlabSection.colour}my_header\x1b[0m",
|
||||
),
|
||||
"start non_collapsed": (
|
||||
"start",
|
||||
False,
|
||||
f"\x1b[0Ksection_start:mock_date:my_first_section\r\x1b[0K{GitlabSection.colour}my_header\x1b[0m",
|
||||
),
|
||||
"end collapsed": (
|
||||
"end",
|
||||
True,
|
||||
"\x1b[0Ksection_end:mock_date:my_first_section\r\x1b[0K",
|
||||
),
|
||||
"end non_collapsed": (
|
||||
"end",
|
||||
False,
|
||||
"\x1b[0Ksection_end:mock_date:my_first_section\r\x1b[0K",
|
||||
),
|
||||
}
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"method, collapsed, expectation",
|
||||
GITLAB_SECTION_SCENARIOS.values(),
|
||||
ids=GITLAB_SECTION_SCENARIOS.keys(),
|
||||
)
|
||||
def test_gitlab_section(method, collapsed, expectation):
|
||||
gs = GitlabSection(
|
||||
id="my_first_section",
|
||||
header="my_header",
|
||||
type=LogSectionType.TEST_CASE,
|
||||
start_collapsed=collapsed,
|
||||
)
|
||||
gs.get_timestamp = lambda x: "mock_date"
|
||||
gs.start()
|
||||
result = getattr(gs, method)()
|
||||
assert result == expectation
|
||||
|
||||
|
||||
def test_gl_sections():
|
||||
lines = [
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "debug",
|
||||
"msg": "Received signal: <STARTRUN> 0_mesa 5971831_1.3.2.3.1",
|
||||
},
|
||||
# Redundant log message which triggers the same Gitlab Section, it
|
||||
# should be ignored, unless the id is different
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "target",
|
||||
"msg": "[ 7.778836] <LAVA_SIGNAL_STARTRUN 0_mesa 5971831_1.3.2.3.1>",
|
||||
},
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "debug",
|
||||
"msg": "Received signal: <STARTTC> mesa-ci_iris-kbl-traces",
|
||||
},
|
||||
# Another redundant log message
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "target",
|
||||
"msg": "[ 16.997829] <LAVA_SIGNAL_STARTTC mesa-ci_iris-kbl-traces>",
|
||||
},
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "target",
|
||||
"msg": "<LAVA_SIGNAL_ENDTC mesa-ci_iris-kbl-traces>",
|
||||
},
|
||||
]
|
||||
lf = LogFollower()
|
||||
for line in lines:
|
||||
lf.manage_gl_sections(line)
|
||||
|
||||
parsed_lines = lf.flush()
|
||||
assert "section_start" in parsed_lines[0]
|
||||
assert "collapsed=true" not in parsed_lines[0]
|
||||
assert "section_end" in parsed_lines[1]
|
||||
assert "section_start" in parsed_lines[2]
|
||||
assert "collapsed=true" not in parsed_lines[2]
|
||||
assert "section_end" in parsed_lines[3]
|
||||
assert "section_start" in parsed_lines[4]
|
||||
assert "collapsed=true" in parsed_lines[4]
|
||||
|
||||
|
||||
def test_log_follower_flush():
|
||||
lines = [
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "debug",
|
||||
"msg": "Received signal: <STARTTC> mesa-ci_iris-kbl-traces",
|
||||
},
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "target",
|
||||
"msg": "<LAVA_SIGNAL_ENDTC mesa-ci_iris-kbl-traces>",
|
||||
},
|
||||
]
|
||||
lf = LogFollower()
|
||||
lf.feed(lines)
|
||||
parsed_lines = lf.flush()
|
||||
empty = lf.flush()
|
||||
lf.feed(lines)
|
||||
repeated_parsed_lines = lf.flush()
|
||||
|
||||
assert parsed_lines
|
||||
assert not empty
|
||||
assert repeated_parsed_lines
|
||||
|
||||
|
||||
SENSITIVE_DATA_SCENARIOS = {
|
||||
"no sensitive data tagged": (
|
||||
["bla bla", "mytoken: asdkfjsde1341=="],
|
||||
["bla bla", "mytoken: asdkfjsde1341=="],
|
||||
"HIDEME",
|
||||
),
|
||||
"sensitive data tagged": (
|
||||
["bla bla", "mytoken: asdkfjsde1341== # HIDEME"],
|
||||
["bla bla"],
|
||||
"HIDEME",
|
||||
),
|
||||
"sensitive data tagged with custom word": (
|
||||
["bla bla", "mytoken: asdkfjsde1341== # DELETETHISLINE", "third line"],
|
||||
["bla bla", "third line"],
|
||||
"DELETETHISLINE",
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"input, expectation, tag",
|
||||
SENSITIVE_DATA_SCENARIOS.values(),
|
||||
ids=SENSITIVE_DATA_SCENARIOS.keys(),
|
||||
)
|
||||
def test_hide_sensitive_data(input, expectation, tag):
|
||||
yaml_data = yaml.safe_dump(input)
|
||||
yaml_result = hide_sensitive_data(yaml_data, tag)
|
||||
result = yaml.safe_load(yaml_result)
|
||||
|
||||
assert result == expectation
|
||||
|
||||
|
||||
COLOR_MANGLED_SCENARIOS = {
|
||||
"Mangled error message at target level": (
|
||||
create_lava_yaml_msg(msg="[0m[0m[31mERROR - dEQP error: ", lvl="target"),
|
||||
"\x1b[0m\x1b[0m\x1b[31mERROR - dEQP error: ",
|
||||
),
|
||||
"Mangled pass message at target level": (
|
||||
create_lava_yaml_msg(
|
||||
msg="[0mPass: 26718, ExpectedFail: 95, Skip: 25187, Duration: 8:18, Remaining: 13",
|
||||
lvl="target",
|
||||
),
|
||||
"\x1b[0mPass: 26718, ExpectedFail: 95, Skip: 25187, Duration: 8:18, Remaining: 13",
|
||||
),
|
||||
"Mangled error message with bold formatting at target level": (
|
||||
create_lava_yaml_msg(msg="[1;31mReview the image changes...", lvl="target"),
|
||||
"\x1b[1;31mReview the image changes...",
|
||||
),
|
||||
"Mangled error message with high intensity background at target level": (
|
||||
create_lava_yaml_msg(msg="[100mReview the image changes...", lvl="target"),
|
||||
"\x1b[100mReview the image changes...",
|
||||
),
|
||||
"Mangled error message with underline+bg color+fg color at target level": (
|
||||
create_lava_yaml_msg(msg="[4;41;97mReview the image changes...", lvl="target"),
|
||||
"\x1b[4;41;97mReview the image changes...",
|
||||
),
|
||||
"Bad input for color code.": (
|
||||
create_lava_yaml_msg(
|
||||
msg="[4;97 This message is missing the `m`.", lvl="target"
|
||||
),
|
||||
"[4;97 This message is missing the `m`.",
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"message, fixed_message",
|
||||
COLOR_MANGLED_SCENARIOS.values(),
|
||||
ids=COLOR_MANGLED_SCENARIOS.keys(),
|
||||
)
|
||||
def test_fix_lava_color_log(message, fixed_message):
|
||||
fix_lava_color_log(message)
|
||||
|
||||
assert message["msg"] == fixed_message
|
||||
|
||||
|
||||
GITLAB_SECTION_MANGLED_SCENARIOS = {
|
||||
"Mangled section_start at target level": (
|
||||
create_lava_yaml_msg(
|
||||
msg="[0Ksection_start:1652658415:deqp[collapsed=false][0Kdeqp-runner",
|
||||
lvl="target",
|
||||
),
|
||||
"\x1b[0Ksection_start:1652658415:deqp[collapsed=false]\r\x1b[0Kdeqp-runner",
|
||||
),
|
||||
"Mangled section_start at target level with header with spaces": (
|
||||
create_lava_yaml_msg(
|
||||
msg="[0Ksection_start:1652658415:deqp[collapsed=false][0Kdeqp runner stats",
|
||||
lvl="target",
|
||||
),
|
||||
"\x1b[0Ksection_start:1652658415:deqp[collapsed=false]\r\x1b[0Kdeqp runner stats",
|
||||
),
|
||||
"Mangled section_end at target level": (
|
||||
create_lava_yaml_msg(
|
||||
msg="[0Ksection_end:1652658415:test_setup[0K",
|
||||
lvl="target",
|
||||
),
|
||||
"\x1b[0Ksection_end:1652658415:test_setup\r\x1b[0K",
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"message, fixed_message",
|
||||
GITLAB_SECTION_MANGLED_SCENARIOS.values(),
|
||||
ids=GITLAB_SECTION_MANGLED_SCENARIOS.keys(),
|
||||
)
|
||||
def test_fix_lava_gitlab_section_log(message, fixed_message):
|
||||
fix_lava_gitlab_section_log(message)
|
||||
|
||||
assert message["msg"] == fixed_message
|
||||
|
||||
|
||||
WATCHDOG_SCENARIOS = {
|
||||
"1 second before timeout": ({"seconds": -1}, does_not_raise()),
|
||||
"1 second after timeout": ({"seconds": 1}, pytest.raises(MesaCITimeoutError)),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"timedelta_kwargs, exception",
|
||||
WATCHDOG_SCENARIOS.values(),
|
||||
ids=WATCHDOG_SCENARIOS.keys(),
|
||||
)
|
||||
def test_log_follower_watchdog(frozen_time, timedelta_kwargs, exception):
|
||||
lines = [
|
||||
{
|
||||
"dt": datetime.now(),
|
||||
"lvl": "debug",
|
||||
"msg": "Received signal: <STARTTC> mesa-ci_iris-kbl-traces",
|
||||
},
|
||||
]
|
||||
td = {LogSectionType.TEST_CASE: timedelta(minutes=1)}
|
||||
lf = LogFollower(timeout_durations=td)
|
||||
lf.feed(lines)
|
||||
frozen_time.tick(
|
||||
lf.timeout_durations[LogSectionType.TEST_CASE] + timedelta(**timedelta_kwargs)
|
||||
)
|
||||
lines = [create_lava_yaml_msg()]
|
||||
with exception:
|
||||
lf.feed(lines)
|
||||
|
||||
|
||||
GITLAB_SECTION_ID_SCENARIOS = [
|
||||
("a-good_name", "a-good_name"),
|
||||
("spaces are not welcome", "spaces-are-not-welcome"),
|
||||
("abc:amd64 1/3", "abc-amd64-1-3"),
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case_name, expected_id", GITLAB_SECTION_ID_SCENARIOS)
|
||||
def test_gitlab_section_id(case_name, expected_id):
|
||||
gl = GitlabSection(
|
||||
id=case_name, header=case_name, type=LogSectionType.LAVA_POST_PROCESSING
|
||||
)
|
||||
|
||||
assert gl.id == expected_id
|
||||
|
||||
|
||||
A618_NETWORK_ISSUE_LOGS = [
|
||||
create_lava_yaml_msg(
|
||||
msg="[ 1733.599402] r8152 2-1.3:1.0 eth0: Tx status -71", lvl="target"
|
||||
),
|
||||
create_lava_yaml_msg(
|
||||
msg="[ 1733.604506] nfs: server 192.168.201.1 not responding, still trying",
|
||||
lvl="target",
|
||||
),
|
||||
]
|
||||
TEST_PHASE_LAVA_SIGNAL = create_lava_yaml_msg(
|
||||
msg="Received signal: <STARTTC> mesa-ci_a618_vk", lvl="debug"
|
||||
)
|
||||
|
||||
|
||||
A618_NETWORK_ISSUE_SCENARIOS = {
|
||||
"Pass - R8152 kmsg during boot": (A618_NETWORK_ISSUE_LOGS, does_not_raise()),
|
||||
"Fail - R8152 kmsg during test phase": (
|
||||
[TEST_PHASE_LAVA_SIGNAL, *A618_NETWORK_ISSUE_LOGS],
|
||||
pytest.raises(MesaCIKnownIssueException),
|
||||
),
|
||||
"Pass - Partial (1) R8152 kmsg during test phase": (
|
||||
[TEST_PHASE_LAVA_SIGNAL, A618_NETWORK_ISSUE_LOGS[0]],
|
||||
does_not_raise(),
|
||||
),
|
||||
"Pass - Partial (2) R8152 kmsg during test phase": (
|
||||
[TEST_PHASE_LAVA_SIGNAL, A618_NETWORK_ISSUE_LOGS[1]],
|
||||
does_not_raise(),
|
||||
),
|
||||
"Pass - Partial subsequent (3) R8152 kmsg during test phase": (
|
||||
[
|
||||
TEST_PHASE_LAVA_SIGNAL,
|
||||
A618_NETWORK_ISSUE_LOGS[0],
|
||||
A618_NETWORK_ISSUE_LOGS[0],
|
||||
],
|
||||
does_not_raise(),
|
||||
),
|
||||
"Pass - Partial subsequent (4) R8152 kmsg during test phase": (
|
||||
[
|
||||
TEST_PHASE_LAVA_SIGNAL,
|
||||
A618_NETWORK_ISSUE_LOGS[1],
|
||||
A618_NETWORK_ISSUE_LOGS[1],
|
||||
],
|
||||
does_not_raise(),
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"messages, expectation",
|
||||
A618_NETWORK_ISSUE_SCENARIOS.values(),
|
||||
ids=A618_NETWORK_ISSUE_SCENARIOS.keys(),
|
||||
)
|
||||
def test_detect_failure(messages, expectation):
|
||||
lf = LogFollower()
|
||||
with expectation:
|
||||
lf.feed(messages)
|
@@ -35,9 +35,6 @@ console_patterns:
|
||||
job_success:
|
||||
regex: >-
|
||||
{{ job_success_regex }}
|
||||
job_warn:
|
||||
regex: >-
|
||||
{{ job_warn_regex }}
|
||||
|
||||
# Environment to deploy
|
||||
deployment:
|
||||
@@ -48,8 +45,7 @@ deployment:
|
||||
cmdline: >
|
||||
SALAD.machine_id={{ '{{' }} machine_id }}
|
||||
console={{ '{{' }} local_tty_device }},115200 earlyprintk=vga,keep
|
||||
loglevel={{ log_level }} no_hash_pointers
|
||||
b2c.service="--privileged --tls-verify=false --pid=host docker://{{ '{{' }} fdo_proxy_registry }}/mupuf/valve-infra/telegraf-container:latest" b2c.hostname=dut-{{ '{{' }} machine.full_name }}
|
||||
loglevel={{ log_level }} amdgpu.gpu_recovery=0 no_hash_pointers
|
||||
b2c.container="-ti --tls-verify=false docker://{{ '{{' }} fdo_proxy_registry }}/mupuf/valve-infra/machine_registration:latest check"
|
||||
b2c.ntp_peer=10.42.0.1 b2c.pipefail b2c.cache_device=auto b2c.poweroff_delay={{ poweroff_delay }}
|
||||
b2c.minio="gateway,{{ '{{' }} minio_url }},{{ '{{' }} job_bucket_access_key }},{{ '{{' }} job_bucket_secret_key }}"
|
@@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "x$VK_DRIVER" = "x" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Useful debug output, you rarely know what envirnoment you'll be
|
||||
# running in within container-land, this can be a landmark.
|
||||
ls -l
|
||||
|
||||
INSTALL=$(realpath -s "$PWD"/install)
|
||||
RESULTS=$(realpath -s "$PWD"/results)
|
||||
|
||||
# Set up the driver environment.
|
||||
# Modifiying here directly LD_LIBRARY_PATH may cause problems when
|
||||
# using a command wrapper. Hence, we will just set it when running the
|
||||
# command.
|
||||
export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/"
|
||||
|
||||
# Sanity check to ensure that our environment is sufficient to make our tests
|
||||
# run against the Mesa built by CI, rather than any installed distro version.
|
||||
MESA_VERSION=$(cat "$INSTALL/VERSION" | sed 's/\./\\./g')
|
||||
|
||||
# Force the stdout and stderr streams to be unbuffered in python.
|
||||
export PYTHONUNBUFFERED=1
|
||||
|
||||
# Set the Vulkan driver to use.
|
||||
export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json"
|
||||
if [ ${VK_DRIVER} = "radeon" ]; then
|
||||
# Disable vsync
|
||||
export MESA_VK_WSI_PRESENT_MODE=mailbox
|
||||
export vblank_mode=0
|
||||
fi
|
||||
|
||||
# Set environment for Wine.
|
||||
export WINEDEBUG="-all"
|
||||
export WINEPREFIX="/dxvk-wine64"
|
||||
export WINEESYNC=1
|
||||
|
||||
# Wait for amdgpu to be fully loaded
|
||||
sleep 1
|
||||
|
||||
# Avoid having to perform nasty command pre-processing to insert the
|
||||
# wine executable in front of the test executables. Instead, use the
|
||||
# kernel's binfmt support to automatically use Wine as an interpreter
|
||||
# when asked to load PE executables.
|
||||
# TODO: Have boot2container mount this filesystem for all jobs?
|
||||
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
|
||||
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
|
||||
|
||||
# Set environment for DXVK.
|
||||
export DXVK_LOG_LEVEL="info"
|
||||
export DXVK_LOG="$RESULTS/dxvk"
|
||||
[ -d "$DXVK_LOG" ] || mkdir -pv "$DXVK_LOG"
|
||||
export DXVK_STATE_CACHE=0
|
||||
|
||||
# Set environment for replaying traces.
|
||||
export PATH="/apitrace-msvc-win64/bin:/gfxreconstruct/build/bin:$PATH"
|
||||
|
||||
SANITY_MESA_VERSION_CMD="vulkaninfo"
|
||||
|
||||
# Set up the Window System Interface (WSI)
|
||||
# TODO: Can we get away with GBM?
|
||||
if [ ${TEST_START_XORG:-0} -eq 1 ]; then
|
||||
"$INSTALL"/common/start-x.sh "$INSTALL"
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
|
||||
wine --version
|
||||
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD | tee /tmp/version.txt | grep \"Mesa $MESA_VERSION\(\s\|$\)\""
|
||||
|
||||
RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD"
|
||||
|
||||
set +e
|
||||
eval $RUN_CMD
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
|
||||
fi
|
||||
set -e
|
||||
|
||||
# Just to be sure...
|
||||
chmod +x ./valvetraces-run.sh
|
||||
./valvetraces-run.sh
|
@@ -14,7 +14,7 @@ RESULTS=$(realpath -s "$PWD"/results)
|
||||
# Modifiying here directly LD_LIBRARY_PATH may cause problems when
|
||||
# using a command wrapper. Hence, we will just set it when running the
|
||||
# command.
|
||||
export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/:/vkd3d-proton-tests/x64/"
|
||||
export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/"
|
||||
|
||||
|
||||
# Sanity check to ensure that our environment is sufficient to make our tests
|
||||
@@ -64,7 +64,7 @@ else
|
||||
mkdir "$RESULTS"
|
||||
fi
|
||||
|
||||
VKD3D_PROTON_TESTSUITE_CMD="/vkd3d-proton-tests/x64/bin/d3d12 >$RESULTS/vkd3d-proton.log"
|
||||
VKD3D_PROTON_TESTSUITE_CMD="wine /vkd3d-proton-tests/x64/bin/d3d12.exe >$RESULTS/vkd3d-proton.log 2>&1"
|
||||
|
||||
quiet printf "%s\n" "Running vkd3d-proton testsuite..."
|
||||
RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $HANG_DETECTION_CMD $VKD3D_PROTON_TESTSUITE_CMD"
|
||||
@@ -72,7 +72,7 @@ RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $HANG_DETECTION_CMD $VKD3D_P
|
||||
set +e
|
||||
eval $RUN_CMD
|
||||
|
||||
VKD3D_PROTON_RESULTS="${VKD3D_PROTON_RESULTS:-vkd3d-proton-results}"
|
||||
VKD3D_PROTON_RESULTS="vkd3d-proton-${VKD3D_PROTON_RESULTS:-results}"
|
||||
RESULTSFILE="$RESULTS/$VKD3D_PROTON_RESULTS.txt"
|
||||
mkdir -p .gitlab-ci/vkd3d-proton
|
||||
grep "Test failed" "$RESULTS"/vkd3d-proton.log > "$RESULTSFILE"
|
||||
@@ -85,7 +85,6 @@ else
|
||||
fi
|
||||
|
||||
if diff -q ".gitlab-ci/vkd3d-proton/$VKD3D_PROTON_RESULTS.txt.baseline" "$RESULTSFILE"; then
|
||||
echo "SUCCESS: No changes found!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@@ -1,11 +1,13 @@
|
||||
# escape=`
|
||||
|
||||
ARG base_image
|
||||
FROM ${base_image}
|
||||
FROM mcr.microsoft.com/windows:1809
|
||||
|
||||
# Make sure any failure in PowerShell scripts is fatal
|
||||
SHELL ["powershell", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"]
|
||||
ENV ErrorActionPreference='Stop'
|
||||
|
||||
COPY mesa_deps_vs2019.ps1 C:\
|
||||
RUN C:\mesa_deps_vs2019.ps1
|
||||
|
||||
COPY mesa_deps_build.ps1 C:\
|
||||
RUN C:\mesa_deps_build.ps1
|
||||
|
||||
# When building, `--isolation=process` can leverage all cores and memory
|
||||
# docker build --isolation=process -f .\Dockerfile_build -t mesa_dep --build-arg base_image=mesa_vs .
|
||||
|
||||
|
@@ -1,29 +0,0 @@
|
||||
# escape=`
|
||||
|
||||
ARG base_image
|
||||
FROM ${base_image}
|
||||
|
||||
# https://www.thomasmaurer.ch/2019/07/how-to-install-and-update-powershell-7/
|
||||
# Wrapping the following command in cmd.exe
|
||||
# iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"
|
||||
RUN powershell -ExecutionPolicy RemoteSigned -Command "$ErrorActionPreference = 'Stop'; iex ""& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"""
|
||||
|
||||
# Make sure any failure in PowerShell scripts is fatal
|
||||
SHELL ["pwsh", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"]
|
||||
RUN Write-Output $PSVersionTable $ErrorActionPreference
|
||||
|
||||
COPY mesa_deps_vs2019.ps1 C:\
|
||||
RUN C:\mesa_deps_vs2019.ps1
|
||||
COPY mesa_vs_init.ps1 C:\
|
||||
|
||||
ENV VULKAN_SDK_VERSION='1.3.211.0'
|
||||
COPY mesa_deps_choco.ps1 C:\
|
||||
RUN C:\mesa_deps_choco.ps1
|
||||
|
||||
# Example usage:
|
||||
# `base_image` should use windows image that can be run with `--isolation=process` option,
|
||||
# since the resulting container will want to be used that way be later containers in the build process.
|
||||
# Only --isolation=hyperv can succeed building this container locally,
|
||||
# --isolation=process have network issue when installing Visual Studio and choco will crash
|
||||
# docker build --isolation=hyperv -f .\Dockerfile_vs -t mesa_vs --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" .
|
||||
|
@@ -30,7 +30,3 @@ host, without Docker.
|
||||
The Mesa build runs inside the base container, executing `mesa_build.ps1`.
|
||||
This simply compiles Mesa using Meson and Ninja, executing the build and
|
||||
unit tests. Currently, no build artifacts are captured.
|
||||
|
||||
## Using build scripts locally
|
||||
|
||||
`*.ps1` scripts for building dockers are using PowerShell 7 to run
|
||||
|
@@ -13,18 +13,18 @@ New-Item -Path $hkey_path -force
|
||||
New-ItemProperty -Path $hkey_path -Name $hkey_name -Value 0 -PropertyType DWORD
|
||||
|
||||
$results = New-Item -ItemType Directory results
|
||||
$deqp_options = @("--deqp-surface-width", 256, "--deqp-surface-height", 256, "--deqp-surface-type", "pbuffer", "--deqp-gl-config-name", "rgba8888d24s8ms0", "--deqp-visibility", "hidden")
|
||||
$deqp_module = "C:\deqp\external\vulkancts\modules\vulkan\deqp-vk.exe"
|
||||
$caselist = "C:\deqp\mustpass\vk-master.txt"
|
||||
$baseline = ".\_install\warp-fails.txt"
|
||||
$suite = ".\_install\deqp-dozen.toml"
|
||||
$includes = @("-t", "dEQP-VK.api.*", "-t", "dEQP-VK.info.*", "-t", "dEQP-VK.draw.*", "-t", "dEQP-VK.query_pool.*", "-t", "dEQP-VK.memory.*")
|
||||
|
||||
$env:DZN_DEBUG = "warp"
|
||||
$env:MESA_VK_IGNORE_CONFORMANCE_WARNING = "true"
|
||||
deqp-runner suite --suite $($suite) --output $($results) --baseline $($baseline) --testlog-to-xml C:\deqp\executor\testlog-to-xml.exe --jobs 4 --fraction 3
|
||||
deqp-runner run --deqp $($deqp_module) --output $($results) --caselist $($caselist) --baseline $($baseline) $($includes) --testlog-to-xml C:\deqp\executor\testlog-to-xml.exe --jobs 4 -- $($deqp_options)
|
||||
$deqpstatus = $?
|
||||
|
||||
$template = "See https://$($env:CI_PROJECT_ROOT_NAMESPACE).pages.freedesktop.org/-/$($env:CI_PROJECT_NAME)/-/jobs/$($env:CI_JOB_ID)/artifacts/results/{{testcase}}.xml"
|
||||
deqp-runner junit --testsuite dEQP --results "$($results)/failures.csv" --output "$($results)/junit.xml" --limit 50 --template $template
|
||||
Copy-Item -Path "C:\deqp\testlog.css" -Destination $($results)
|
||||
Copy-Item -Path "C:\deqp\testlog.xsl" -Destination $($results)
|
||||
|
||||
if (!$deqpstatus) {
|
||||
Exit 1
|
||||
|
@@ -1,8 +1,3 @@
|
||||
# Clear CI_COMMIT_MESSAGE and CI_COMMIT_DESCRIPTION for please meson
|
||||
# when the commit message is complicated
|
||||
$env:CI_COMMIT_MESSAGE=""
|
||||
$env:CI_COMMIT_DESCRIPTION=""
|
||||
|
||||
# force the CA cert cache to be rebuilt, in case Meson tries to access anything
|
||||
Write-Host "Refreshing Windows TLS CA cache"
|
||||
(New-Object System.Net.WebClient).DownloadString("https://github.com") >$null
|
||||
@@ -22,46 +17,31 @@ Remove-Item -Recurse -Force $installdir
|
||||
New-Item -ItemType Directory -Path $builddir
|
||||
New-Item -ItemType Directory -Path $installdir
|
||||
|
||||
Write-Output "*" > $builddir\.gitignore
|
||||
Write-Output "*" > $installdir\.gitignore
|
||||
|
||||
Write-Output builddir:$builddir
|
||||
Write-Output installdir:$installdir
|
||||
Write-Output sourcedir:$sourcedir
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
$depsInstallPath="C:\mesa-deps"
|
||||
$installPath=& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -property installationpath
|
||||
Write-Output "vswhere.exe installPath: $installPath"
|
||||
$installPath="C:\BuildTools"
|
||||
Write-Output "Final installPath: $installPath"
|
||||
Import-Module (Join-Path $installPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
|
||||
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -no_logo -host_arch=amd64'
|
||||
|
||||
Push-Location $builddir
|
||||
|
||||
meson `
|
||||
--default-library=shared `
|
||||
-Dzlib:default_library=static `
|
||||
--buildtype=release `
|
||||
-Db_ndebug=false `
|
||||
-Db_vscrt=mt `
|
||||
--cmake-prefix-path="$depsInstallPath" `
|
||||
--pkg-config-path="$depsInstallPath\lib\pkgconfig;$depsInstallPath\share\pkgconfig" `
|
||||
meson --default-library=shared -Dzlib:default_library=static --buildtype=release -Db_ndebug=false `
|
||||
-Db_vscrt=mt --cmake-prefix-path="C:\llvm-10" `
|
||||
--pkg-config-path="C:\llvm-10\lib\pkgconfig;C:\llvm-10\share\pkgconfig;C:\spirv-tools\lib\pkgconfig" `
|
||||
--prefix="$installdir" `
|
||||
-Dllvm=enabled `
|
||||
-Dshared-llvm=disabled `
|
||||
-Dvulkan-drivers="swrast,amd,microsoft-experimental" `
|
||||
-Dgallium-drivers="swrast,d3d12,zink" `
|
||||
-Dshared-glapi=enabled `
|
||||
-Dgles2=enabled `
|
||||
-Dmicrosoft-clc=enabled `
|
||||
-Dstatic-libclc=all `
|
||||
-Dspirv-to-dxil=true `
|
||||
-Dbuild-tests=true `
|
||||
-Dwerror=true `
|
||||
-Dwarning_level=2 `
|
||||
-Dzlib:warning_level=1 `
|
||||
-Dlibelf:warning_level=1 `
|
||||
$sourcedir && `
|
||||
meson install --skip-subprojects && `
|
||||
meson test --num-processes 32 --print-errorlogs
|
||||
-Dllvm=enabled -Dshared-llvm=disabled `
|
||||
"-Dvulkan-drivers=swrast,amd,microsoft-experimental" "-Dgallium-drivers=swrast,d3d12,zink" `
|
||||
-Dshared-glapi=enabled -Dgles2=enabled -Dmicrosoft-clc=enabled -Dstatic-libclc=all -Dspirv-to-dxil=true `
|
||||
-Dbuild-tests=true -Dwerror=true -Dwarning_level=2 -Dzlib:warning_level=1 -Dlibelf:warning_level=1 `
|
||||
$sourcedir
|
||||
|
||||
ninja install -j32
|
||||
meson test --num-processes 32
|
||||
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
@@ -79,6 +59,5 @@ Copy-Item ".\.gitlab-ci\windows\spirv2dxil_check.ps1" -Destination $installdir
|
||||
Copy-Item ".\.gitlab-ci\windows\spirv2dxil_run.ps1" -Destination $installdir
|
||||
|
||||
Copy-Item ".\.gitlab-ci\windows\deqp_runner_run.ps1" -Destination $installdir
|
||||
Copy-Item ".\src\microsoft\ci\deqp-dozen.toml" -Destination $installdir
|
||||
|
||||
Get-ChildItem -Recurse -Filter "ci" | Get-ChildItem -Filter "*.txt" | Copy-Item -Destination $installdir
|
||||
|
@@ -1,16 +1,62 @@
|
||||
# Download new TLS certs from Windows Update
|
||||
Get-Date
|
||||
Write-Host "Updating TLS certificate store"
|
||||
$certdir = (New-Item -ItemType Directory -Name "_tlscerts")
|
||||
certutil -syncwithWU "$certdir"
|
||||
Foreach ($file in (Get-ChildItem -Path "$certdir\*" -Include "*.crt")) {
|
||||
Import-Certificate -FilePath $file -CertStoreLocation Cert:\LocalMachine\Root
|
||||
}
|
||||
Remove-Item -Recurse -Path $certdir
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing Chocolatey"
|
||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1"
|
||||
Update-SessionEnvironment
|
||||
Write-Host "Installing Chocolatey packages"
|
||||
|
||||
# Chocolatey tries to download winflexbison from SourceForge, which is not super reliable, and has no retry
|
||||
# loop of its own - so we give it a helping hand here
|
||||
For ($i = 0; $i -lt 5; $i++) {
|
||||
choco install -y python3 --params="/InstallDir:C:\python3"
|
||||
$python_install = $?
|
||||
choco install --allow-empty-checksums -y cmake git git-lfs ninja pkgconfiglite winflexbison vulkan-sdk --installargs "ADD_CMAKE_TO_PATH=System"
|
||||
$other_install = $?
|
||||
$choco_installed = $other_install -and $python_install
|
||||
if ($choco_installed) {
|
||||
Break
|
||||
}
|
||||
}
|
||||
|
||||
if (!$choco_installed) {
|
||||
Write-Host "Couldn't install dependencies from Chocolatey"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
# Add Chocolatey's native install path
|
||||
Update-SessionEnvironment
|
||||
# Python and CMake add themselves to the system environment path, which doesn't get refreshed
|
||||
# until we start a new shell
|
||||
$env:PATH = "C:\python3;C:\python3\scripts;C:\Program Files\CMake\bin;$env:PATH"
|
||||
|
||||
Start-Process -NoNewWindow -Wait git -ArgumentList 'config --global core.autocrlf false'
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing Meson, Mako and numpy"
|
||||
pip3 install meson mako numpy
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install dependencies from pip"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
# we want more secure TLS 1.2 for most things, but it breaks SourceForge
|
||||
# downloads so must be done after Chocolatey use
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls13;
|
||||
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "deps" | Out-Null
|
||||
|
||||
Get-Date
|
||||
Write-Host "Cloning LLVM release/12.x"
|
||||
git clone -b release/12.x --depth=1 https://github.com/llvm/llvm-project deps/llvm-project
|
||||
git clone -b release/12.x --depth=1 https://github.com/llvm/llvm-project llvm-project
|
||||
if (!$?) {
|
||||
Write-Host "Failed to clone LLVM repository"
|
||||
Exit 1
|
||||
@@ -21,44 +67,21 @@ if (!$?) {
|
||||
# a tag matching LLVM 12.0.0
|
||||
Get-Date
|
||||
Write-Host "Cloning SPIRV-LLVM-Translator"
|
||||
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator deps/llvm-project/llvm/projects/SPIRV-LLVM-Translator
|
||||
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/SPIRV-LLVM-Translator
|
||||
if (!$?) {
|
||||
Write-Host "Failed to clone SPIRV-LLVM-Translator repository"
|
||||
Exit 1
|
||||
}
|
||||
Push-Location deps/llvm-project/llvm/projects/SPIRV-LLVM-Translator
|
||||
Push-Location llvm-project/llvm/projects/SPIRV-LLVM-Translator
|
||||
git checkout 5b641633b3bcc3251a52260eee11db13a79d7258
|
||||
Pop-Location
|
||||
|
||||
$depsInstallPath="C:\mesa-deps"
|
||||
|
||||
Get-Date
|
||||
# slightly convoluted syntax but avoids the CWD being under the PS filesystem meta-path
|
||||
$llvm_build = New-Item -ItemType Directory -ErrorAction SilentlyContinue -Force -Path ".\deps\llvm-project" -Name "build"
|
||||
$llvm_build = New-Item -ItemType Directory -Path ".\llvm-project" -Name "build"
|
||||
Push-Location -Path $llvm_build.FullName
|
||||
Write-Host "Compiling LLVM and Clang"
|
||||
cmake ../llvm `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DLLVM_USE_CRT_RELEASE=MT `
|
||||
-DCMAKE_PREFIX_PATH="$depsInstallPath" `
|
||||
-DCMAKE_INSTALL_PREFIX="$depsInstallPath" `
|
||||
-DLLVM_ENABLE_PROJECTS="clang" `
|
||||
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" `
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=TRUE `
|
||||
-DLLVM_ENABLE_ASSERTIONS=TRUE `
|
||||
-DLLVM_INCLUDE_UTILS=OFF `
|
||||
-DLLVM_INCLUDE_RUNTIMES=OFF `
|
||||
-DLLVM_INCLUDE_TESTS=OFF `
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF `
|
||||
-DLLVM_INCLUDE_GO_TESTS=OFF `
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF `
|
||||
-DLLVM_BUILD_LLVM_C_DYLIB=OFF `
|
||||
-DLLVM_ENABLE_DIA_SDK=OFF `
|
||||
-DCLANG_BUILD_TOOLS=ON `
|
||||
-DLLVM_SPIRV_INCLUDE_TESTS=OFF `
|
||||
-Wno-dev && `
|
||||
ninja -j32 install
|
||||
cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake ../llvm -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DCMAKE_INSTALL_PREFIX="C:\llvm-10" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_TARGETS_TO_BUILD=AMDGPU;X86 -DLLVM_OPTIMIZED_TABLEGEN=TRUE -DLLVM_ENABLE_ASSERTIONS=TRUE -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INCLUDE_RUNTIMES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DLLVM_ENABLE_DIA_SDK=OFF -DCLANG_BUILD_TOOLS=ON -DLLVM_SPIRV_INCLUDE_TESTS=OFF && ninja -j32 install'
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
if (!$buildstatus) {
|
||||
@@ -67,64 +90,57 @@ if (!$buildstatus) {
|
||||
}
|
||||
|
||||
Get-Date
|
||||
$libclc_build = New-Item -ItemType Directory -Path ".\deps\llvm-project" -Name "build-libclc"
|
||||
$libclc_build = New-Item -ItemType Directory -Path ".\llvm-project" -Name "build-libclc"
|
||||
Push-Location -Path $libclc_build.FullName
|
||||
Write-Host "Compiling libclc"
|
||||
# libclc can only be built with Ninja, because CMake's VS backend doesn't know how to compile new language types
|
||||
cmake ../libclc `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DCMAKE_CXX_FLAGS="-m64" `
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW `
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
|
||||
-DCMAKE_INSTALL_PREFIX="$depsInstallPath" `
|
||||
-DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-" && `
|
||||
ninja -j32 install
|
||||
cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake ../libclc -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="C:\llvm-10" -DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-" && ninja -j32 install'
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $libclc_build
|
||||
Remove-Item -Recurse -Path $libclc_build
|
||||
if (!$buildstatus) {
|
||||
Write-Host "Failed to compile libclc"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $llvm_build
|
||||
Remove-Item -Recurse -Path $llvm_build
|
||||
|
||||
Get-Date
|
||||
Write-Host "Cloning SPIRV-Tools"
|
||||
git clone -b "sdk-$env:VULKAN_SDK_VERSION" --depth=1 https://github.com/KhronosGroup/SPIRV-Tools deps/SPIRV-Tools
|
||||
git clone https://github.com/KhronosGroup/SPIRV-Tools
|
||||
if (!$?) {
|
||||
Write-Host "Failed to clone SPIRV-Tools repository"
|
||||
Exit 1
|
||||
}
|
||||
git clone -b "sdk-$env:VULKAN_SDK_VERSION" --depth=1 https://github.com/KhronosGroup/SPIRV-Headers deps/SPIRV-Tools/external/SPIRV-Headers
|
||||
git clone https://github.com/KhronosGroup/SPIRV-Headers SPIRV-Tools/external/SPIRV-Headers
|
||||
if (!$?) {
|
||||
Write-Host "Failed to clone SPIRV-Headers repository"
|
||||
Exit 1
|
||||
}
|
||||
Write-Host "Building SPIRV-Tools"
|
||||
$spv_build = New-Item -ItemType Directory -Path ".\deps\SPIRV-Tools" -Name "build"
|
||||
$spv_build = New-Item -ItemType Directory -Path ".\SPIRV-Tools" -Name "build"
|
||||
Push-Location -Path $spv_build.FullName
|
||||
# SPIRV-Tools doesn't use multi-threaded MSVCRT, but we need it to
|
||||
cmake .. `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW `
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
|
||||
-DCMAKE_INSTALL_PREFIX="$depsInstallPath" && `
|
||||
ninja -j32 install
|
||||
cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="C:\spirv-tools" && ninja -j32 install'
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $spv_build
|
||||
Remove-Item -Recurse -Path $spv_build
|
||||
if (!$buildstatus) {
|
||||
Write-Host "Failed to compile SPIRV-Tools"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
function Remove-Symlinks {
|
||||
Get-ChildItem -Force -ErrorAction SilentlyContinue @Args | Where-Object { if($_.Attributes -match "ReparsePoint"){$_.Delete()} }
|
||||
# See https://gitlab.freedesktop.org/mesa/mesa/-/issues/3855
|
||||
# Until that's resolved, we need the vulkan-runtime as a build dependency to be able to run any unit tests on GL
|
||||
Get-Date
|
||||
Write-Host "Downloading Vulkan-Runtime"
|
||||
Invoke-WebRequest -Uri 'https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-runtime.exe' -OutFile 'C:\vulkan-runtime.exe' | Out-Null
|
||||
Write-Host "Installing Vulkan-Runtime"
|
||||
Start-Process -NoNewWindow -Wait C:\vulkan-runtime.exe -ArgumentList '/S'
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Vulkan-Runtime"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Symlinks -Path "deps" -Recurse
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "deps" | Out-Null
|
||||
Remove-Item C:\vulkan-runtime.exe -Force
|
||||
|
||||
Get-Date
|
||||
Write-Host "Complete"
|
||||
|
@@ -1,73 +0,0 @@
|
||||
# Download new TLS certs from Windows Update
|
||||
Get-Date
|
||||
Write-Host "Updating TLS certificate store"
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "_tlscerts" | Out-Null
|
||||
$certdir = (New-Item -ItemType Directory -Name "_tlscerts")
|
||||
certutil -syncwithWU "$certdir"
|
||||
Foreach ($file in (Get-ChildItem -Path "$certdir\*" -Include "*.crt")) {
|
||||
Import-Certificate -FilePath $file -CertStoreLocation Cert:\LocalMachine\Root | Out-Null
|
||||
}
|
||||
Remove-Item -Recurse -Path $certdir
|
||||
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing Chocolatey"
|
||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1"
|
||||
Update-SessionEnvironment
|
||||
Write-Host "Installing Chocolatey packages"
|
||||
|
||||
# Chocolatey tries to download winflexbison from SourceForge, which is not super reliable, and has no retry
|
||||
# loop of its own - so we give it a helping hand here
|
||||
For ($i = 0; $i -lt 5; $i++) {
|
||||
choco install --no-progress -y python3 --params="/InstallDir:C:\python3"
|
||||
$python_install = $?
|
||||
choco install --allow-empty-checksums --no-progress -y cmake git git-lfs ninja pkgconfiglite winflexbison --installargs "ADD_CMAKE_TO_PATH=System"
|
||||
$other_install = $?
|
||||
$choco_installed = $other_install -and $python_install
|
||||
if ($choco_installed) {
|
||||
Break
|
||||
}
|
||||
}
|
||||
|
||||
if (!$choco_installed) {
|
||||
Write-Host "Couldn't install dependencies from Chocolatey"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
# Add Chocolatey's native install path
|
||||
Update-SessionEnvironment
|
||||
# Python and CMake add themselves to the system environment path, which doesn't get refreshed
|
||||
# until we start a new shell
|
||||
$env:PATH = "C:\python3;C:\python3\scripts;C:\Program Files\CMake\bin;$env:PATH"
|
||||
|
||||
Start-Process -NoNewWindow -Wait git -ArgumentList 'config --global core.autocrlf false'
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing Meson, Mako and numpy"
|
||||
pip3 install meson mako numpy --progress-bar off
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install dependencies from pip"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading Vulkan-SDK"
|
||||
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanSDK-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan_sdk.exe'
|
||||
C:\vulkan_sdk.exe --am --al -c in
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Vulkan SDK"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item C:\vulkan_sdk.exe -Force
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading Vulkan-Runtime"
|
||||
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanRT-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan-runtime.exe' | Out-Null
|
||||
Write-Host "Installing Vulkan-Runtime"
|
||||
Start-Process -NoNewWindow -Wait C:\vulkan-runtime.exe -ArgumentList '/S'
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Vulkan-Runtime"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item C:\vulkan-runtime.exe -Force
|
@@ -25,9 +25,6 @@ if (!$?) {
|
||||
Exit 1
|
||||
}
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading glext.h"
|
||||
New-Item -ItemType Directory -Path ".\glext" -Name "GL"
|
||||
@@ -49,14 +46,7 @@ Get-Date
|
||||
$piglit_build = New-Item -ItemType Directory -Path "C:\src\piglit" -Name "build"
|
||||
Push-Location -Path $piglit_build.FullName
|
||||
Write-Host "Compiling Piglit"
|
||||
cmake .. `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DCMAKE_INSTALL_PREFIX="C:\Piglit" `
|
||||
-DGLUT_INCLUDE_DIR=C:\freeglut\include `
|
||||
-DGLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib `
|
||||
-DGLEXT_INCLUDE_DIR=.\glext && `
|
||||
ninja -j32
|
||||
cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Piglit" -DGLUT_INCLUDE_DIR=C:\freeglut\include -DGLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib -DGLEXT_INCLUDE_DIR=.\glext && ninja -j32'
|
||||
$buildstatus = $?
|
||||
ninja -j32 install | Out-Null
|
||||
$installstatus = $?
|
||||
@@ -73,7 +63,7 @@ Get-Date
|
||||
Write-Host "Cloning spirv-samples"
|
||||
git clone --no-progress --single-branch --no-checkout https://github.com/dneto0/spirv-samples.git C:\spirv-samples\
|
||||
Push-Location -Path C:\spirv-samples\
|
||||
git checkout 36372636df06a24c4e2de1551beee055db01b91d
|
||||
git checkout 7ac0ad5a7fe0ec884faba1dc2916028d0268eeef
|
||||
Pop-Location
|
||||
|
||||
Get-Date
|
||||
@@ -96,12 +86,7 @@ Get-Date
|
||||
$deqp_build = New-Item -ItemType Directory -Path "C:\deqp"
|
||||
Push-Location -Path $deqp_build.FullName
|
||||
Write-Host "Compiling deqp"
|
||||
cmake -S $($deqp_source) `
|
||||
-B . `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DDEQP_TARGET=default && `
|
||||
ninja -j32
|
||||
cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake -S $($deqp_source) -B . -GNinja -DCMAKE_BUILD_TYPE=Release -DDEQP_TARGET=default && ninja -j32"
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
if (!$buildstatus -Or !$installstatus) {
|
||||
|
@@ -10,29 +10,9 @@ Invoke-WebRequest -Uri $msvc_2019_url -OutFile C:\vs_buildtools.exe
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing Visual Studio 2019"
|
||||
# Command line
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/command-line-parameter-examples?view=vs-2019
|
||||
# Component ids
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2019
|
||||
Start-Process -NoNewWindow -Wait -FilePath C:\vs_buildtools.exe `
|
||||
-ArgumentList `
|
||||
"--wait", `
|
||||
"--quiet", `
|
||||
"--norestart", `
|
||||
"--nocache", `
|
||||
"--installPath", "C:\BuildTools", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.ASAN", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.ATL", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.ATLMFC", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", `
|
||||
"--add", "Microsoft.VisualStudio.Component.Graphics.Tools", `
|
||||
"--add", "Microsoft.VisualStudio.Component.Windows10SDK.20348"
|
||||
|
||||
Start-Process -NoNewWindow -Wait C:\vs_buildtools.exe -ArgumentList '--wait --quiet --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Graphics.Tools --add Microsoft.VisualStudio.Component.Windows10SDK.18362 --includeRecommended'
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Visual Studio tools"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item C:\vs_buildtools.exe -Force
|
||||
Get-Date
|
||||
|
@@ -1,11 +0,0 @@
|
||||
$vsInstallPath=& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -property installationpath
|
||||
Write-Output "vswhere.exe installPath: $vsInstallPath"
|
||||
$vsInstallPath = if ("$vsInstallPath" -eq "" ) { "C:\BuildTools" } else { "$vsInstallPath" }
|
||||
Write-Output "Final installPath: $vsInstallPath"
|
||||
Import-Module (Join-Path $vsInstallPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
|
||||
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
|
||||
# VS2015 14.0
|
||||
# VS2017 14.16
|
||||
# VS2019 14.29
|
||||
# VS2022 14.32
|
||||
Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation -DevCmdArguments '-vcvars_ver=14.29 -arch=x64 -no_logo -host_arch=amd64'
|
@@ -18,7 +18,7 @@ foreach ($spvasm in $spvasm_files) {
|
||||
$spv_version = $Matches[1]
|
||||
}
|
||||
|
||||
$as_output = . "$env:VULKAN_SDK\Bin\spirv-as.exe" --target-env spv$spv_version --preserve-numeric-ids -o $spvfile $spvasm 2>&1 | % { if ($_ -is [System.Management.Automation.ErrorRecord]) { $_.Exception.Message } else { $_ } } | Out-String
|
||||
$as_output = C:\spirv-tools\bin\spirv-as.exe --target-env spv$spv_version --preserve-numeric-ids -o $spvfile $spvasm 2>&1 | % { if ($_ -is [System.Management.Automation.ErrorRecord]) { $_.Exception.Message } else { $_ } } | Out-String
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Output "$test_name Skip: Unable to assemble shader"
|
||||
Write-Output "$as_output`n"
|
||||
|
@@ -1,10 +1,9 @@
|
||||
[binaries]
|
||||
c = ['ccache', 'x86_64-w64-mingw32-gcc-posix']
|
||||
cpp = ['ccache', 'x86_64-w64-mingw32-g++-posix']
|
||||
c = ['ccache', 'x86_64-w64-mingw32-gcc']
|
||||
cpp = ['ccache', 'x86_64-w64-mingw32-g++']
|
||||
ar = 'x86_64-w64-mingw32-ar'
|
||||
strip = 'x86_64-w64-mingw32-strip'
|
||||
pkgconfig = '/usr/x86_64-w64-mingw32/bin/pkg-config'
|
||||
llvm-config = '/usr/x86_64-w64-mingw32/bin/llvm-config'
|
||||
pkgconfig = '/usr/local/bin/x86_64-w64-mingw32-pkg-config'
|
||||
windres = 'x86_64-w64-mingw32-windres'
|
||||
exe_wrapper = ['wine64']
|
||||
|
||||
|
@@ -2,8 +2,7 @@
|
||||
- Check if a new version of Mesa is available which might have fixed the problem.
|
||||
- If you can, check if the latest development version (git main) works better.
|
||||
- Check if your bug has already been reported here.
|
||||
- For any logs, backtraces, etc - use [code blocks](https://docs.gitlab.com/ee/user/markdown.html#code-spans-and-blocks), GitLab removes line breaks without this.
|
||||
- Do not paste long logs directly into the description. Use https://gitlab.freedesktop.org/-/snippets/new, attachments, or a pastebin with a long expiration instead.
|
||||
- For any logs, backtraces, etc - use [code blocks](https://docs.gitlab.com/ee/user/markdown.html#code-spans-and-blocks)
|
||||
- As examples of good bug reports you may review one of these - #2598, #2615, #2608
|
||||
|
||||
|
||||
@@ -11,9 +10,6 @@ Otherwise, fill the requested information below.
|
||||
And please remove anything that doesn't apply to keep things readable :)
|
||||
|
||||
|
||||
The title should effectively distinguish this bug report from others and be specific to issue you encounter. When writing the title of the bug report, include a short description of the issue, the hardware/driver(s) affected and application(s) affected.
|
||||
|
||||
|
||||
### Description
|
||||
|
||||
Describe what you are doing, what you expect and what you're
|
||||
|
@@ -2,8 +2,7 @@
|
||||
- Check if a new version of Mesa is available which might have fixed the problem.
|
||||
- If you can, check if the latest development version (git main) works better.
|
||||
- Check if your bug has already been reported here.
|
||||
- For any logs, backtraces, etc - use [code blocks](https://docs.gitlab.com/ee/user/markdown.html#code-spans-and-blocks), GitLab removes line breaks without this.
|
||||
- Do not paste long logs directly into the description. Use https://gitlab.freedesktop.org/-/snippets/new, attachments, or a pastebin with a long expiration instead.
|
||||
- For any logs, backtraces, etc - use [code blocks](https://docs.gitlab.com/ee/user/markdown.html#code-spans-and-blocks)
|
||||
- As examples of good bug reports you may review one of these - #2598, #2615, #2608
|
||||
|
||||
|
||||
@@ -11,9 +10,6 @@ Otherwise, please fill the requested information below.
|
||||
And please remove anything that doesn't apply to keep things readable :)
|
||||
|
||||
|
||||
The title should effectively distinguish this bug report from others and be specific to issue you encounter. When writing the title of the bug report, include a short description of the issue, the hardware/driver(s) affected and application(s) affected.
|
||||
|
||||
|
||||
### System information
|
||||
|
||||
Please post `inxi -GSC -xx` output ([fenced with triple backticks](https://docs.gitlab.com/ee/user/markdown.html#code-spans-and-blocks)) OR fill information below manually
|
||||
|
7
.mailmap
7
.mailmap
@@ -65,7 +65,7 @@ Anuj Phogat <anuj.phogat@gmail.com> <anuj.phogat@intel.com>
|
||||
|
||||
Arthur Huillet <arthur.huillet@free.fr> Arthur HUILLET <arthur.huillet@free.fr>
|
||||
|
||||
Axel Davy <davyaxel0@gmail.com> <axel.davy@ens.fr>
|
||||
Axel Davy <axel.davy@ens.fr> <davyaxel0@gmail.com>
|
||||
|
||||
Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> <basni@chromium.org>
|
||||
|
||||
@@ -220,9 +220,8 @@ Emmanuel Vadot <manu@FreeBSD.org> Emmanuel <manu@FreeBSD.org>
|
||||
Emma Anholt <emma@anholt.net> <anholt@FreeBSD.org>
|
||||
Emma Anholt <emma@anholt.net> <eric@anholt.net>
|
||||
|
||||
Eric Engestrom <eric@igalia.com> <eric@engestrom.ch>
|
||||
Eric Engestrom <eric@igalia.com> <eric.engestrom@imgtec.com>
|
||||
Eric Engestrom <eric@igalia.com> <eric.engestrom@intel.com>
|
||||
Eric Engestrom <eric@engestrom.ch> <eric.engestrom@imgtec.com>
|
||||
Eric Engestrom <eric@engestrom.ch> <eric.engestrom@intel.com>
|
||||
|
||||
Erik Faye-Lund <kusmabite@gmail.com> <erik.faye-lund@collabora.com>
|
||||
|
||||
|
41266
.pick_status.json
41266
.pick_status.json
File diff suppressed because it is too large
Load Diff
52
.travis.yml
Normal file
52
.travis.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
language: c
|
||||
|
||||
os: osx
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
|
||||
env:
|
||||
global:
|
||||
- PKG_CONFIG_PATH=""
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- env:
|
||||
- BUILD=meson
|
||||
|
||||
before_install:
|
||||
- HOMEBREW_NO_AUTO_UPDATE=1 brew install expat gettext
|
||||
- if test "x$BUILD" = xmeson; then
|
||||
HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja;
|
||||
fi
|
||||
|
||||
# Set PATH for homebrew pip3 installs
|
||||
- PYTHON_VERSION=$(python3 -V | awk '{print $2}' | cut -d. -f1-2)
|
||||
- PATH="$HOME/Library/Python/$PYTHON_VERSION/bin:${PATH}"
|
||||
# Set PKG_CONFIG_PATH for keg-only expat
|
||||
- PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig:${PKG_CONFIG_PATH}"
|
||||
# Set PATH for keg-only gettext
|
||||
- PATH="/usr/local/opt/gettext/bin:${PATH}"
|
||||
|
||||
# Install xquartz for prereqs ...
|
||||
- XQUARTZ_VERSION="2.7.11"
|
||||
- wget -nv https://github.com/XQuartz/XQuartz/releases/download/XQuartz-${XQUARTZ_VERSION}/XQuartz-${XQUARTZ_VERSION}.dmg
|
||||
- hdiutil attach XQuartz-${XQUARTZ_VERSION}.dmg
|
||||
- sudo installer -pkg /Volumes/XQuartz-${XQUARTZ_VERSION}/XQuartz.pkg -target /
|
||||
- hdiutil detach /Volumes/XQuartz-${XQUARTZ_VERSION}
|
||||
# ... and set paths
|
||||
- PKG_CONFIG_PATH="/opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig:${PKG_CONFIG_PATH}"
|
||||
|
||||
install:
|
||||
- if test "x$BUILD" = xmeson; then
|
||||
pip3 install --user meson;
|
||||
pip3 install --user mako;
|
||||
fi
|
||||
|
||||
script:
|
||||
- if test "x$BUILD" = xmeson; then
|
||||
meson _build -Dbuild-tests=true;
|
||||
ninja -C _build || travis_terminate 1;
|
||||
ninja -C _build test || travis_terminate 1;
|
||||
ninja -C _build install || travis_terminate 1;
|
||||
fi
|
20
CODEOWNERS
20
CODEOWNERS
@@ -28,11 +28,11 @@ meson.build @dbaker @eric
|
||||
/android/ @roman.stratiienko
|
||||
|
||||
# Compatibility headers
|
||||
/include/c99* @xexaxo
|
||||
/src/c11/ @eric @lygstate
|
||||
/include/c99* @evelikov
|
||||
/include/c11* @eric
|
||||
|
||||
# Documentation
|
||||
/docs/ @eric @xexaxo
|
||||
/docs/ @eric @evelikov
|
||||
|
||||
|
||||
##########
|
||||
@@ -52,21 +52,21 @@ meson.build @dbaker @eric
|
||||
#############
|
||||
|
||||
# EGL
|
||||
/src/egl/ @eric @xexaxo
|
||||
/include/EGL/ @eric @xexaxo
|
||||
/src/egl/ @eric @evelikov
|
||||
/include/EGL/ @eric @evelikov
|
||||
|
||||
# EGL - Android support
|
||||
/src/egl/drivers/dri2/platform_android.c @robh @tfiga
|
||||
|
||||
# EGL - Device support
|
||||
/src/egl/drivers/dri2/platform_device.c @xexaxo
|
||||
/src/egl/drivers/dri2/platform_device.c @evelikov
|
||||
|
||||
# EGL - Wayland support
|
||||
/src/egl/wayland/ @daniels @eric
|
||||
/src/egl/drivers/dri2/platform_wayland.c @daniels @eric
|
||||
|
||||
# Gallium targets
|
||||
/src/gallium/targets/ @xexaxo
|
||||
/src/gallium/targets/ @evelikov
|
||||
|
||||
# GLX
|
||||
/src/glx/ @ajax
|
||||
@@ -87,11 +87,11 @@ meson.build @dbaker @eric
|
||||
/src/hgl/ @kallisti5
|
||||
|
||||
# Loader - DRI/classic
|
||||
/src/loader/ @xexaxo
|
||||
/src/loader/ @evelikov
|
||||
|
||||
# Loader - Gallium
|
||||
/src/gallium/auxiliary/pipe-loader/ @xexaxo
|
||||
/src/gallium/auxiliary/target-helpers/ @xexaxo
|
||||
/src/gallium/auxiliary/pipe-loader/ @evelikov
|
||||
/src/gallium/auxiliary/target-helpers/ @evelikov
|
||||
|
||||
# Vulkan WSI - Display
|
||||
/src/vulkan/wsi/wsi_common_display.* @keithp
|
||||
|
@@ -98,8 +98,6 @@ LOCAL_SHARED_LIBRARIES += \
|
||||
MESON_GEN_PKGCONFIGS += android.hardware.graphics.mapper:4.0
|
||||
endif
|
||||
|
||||
__MY_SHARED_LIBRARIES := $(LOCAL_SHARED_LIBRARIES)
|
||||
|
||||
ifeq ($(TARGET_IS_64_BIT),true)
|
||||
LOCAL_MULTILIB := 64
|
||||
else
|
||||
@@ -114,43 +112,29 @@ endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# $1: name
|
||||
# $2: symlink suffix
|
||||
# $3: subdir
|
||||
# $4: source prebuilt
|
||||
# $5: export headers
|
||||
define mesa3d-lib
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||
LOCAL_MODULE := $1
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := $3
|
||||
LOCAL_PREBUILT_MODULE_FILE := $($4)
|
||||
LOCAL_MULTILIB := first
|
||||
LOCAL_CHECK_ELF_FILES := false
|
||||
LOCAL_MODULE_SUFFIX := .so
|
||||
LOCAL_MODULE_SYMLINKS := $1$2
|
||||
LOCAL_SHARED_LIBRARIES := $(__MY_SHARED_LIBRARIES)
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := $5
|
||||
include $(BUILD_PREBUILT)
|
||||
|
||||
ifdef TARGET_2ND_ARCH
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||
LOCAL_MODULE := $1
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := $3
|
||||
LOCAL_PREBUILT_MODULE_FILE := $(2ND_$4)
|
||||
LOCAL_MULTILIB := 32
|
||||
LOCAL_SRC_FILES_$(TARGET_ARCH) := $(call relative_top_path,$(LOCAL_PATH))$($4)
|
||||
LOCAL_SRC_FILES_$(TARGET_2ND_ARCH) := $(call relative_top_path,$(LOCAL_PATH))$(2ND_$4)
|
||||
LOCAL_MULTILIB := both
|
||||
else
|
||||
LOCAL_SRC_FILES := $(call relative_top_path,$(LOCAL_PATH))$($4)
|
||||
endif
|
||||
LOCAL_CHECK_ELF_FILES := false
|
||||
LOCAL_MODULE_SUFFIX := .so
|
||||
LOCAL_MODULE_SYMLINKS := $1$2
|
||||
LOCAL_SHARED_LIBRARIES := $(__MY_SHARED_LIBRARIES)
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := $5
|
||||
include $(BUILD_PREBUILT)
|
||||
endif
|
||||
include $(CLEAR_VARS)
|
||||
endef
|
||||
|
||||
__MY_SHARED_LIBRARIES := $(LOCAL_SHARED_LIBRARIES)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_SHARED_LIBRARIES := $(__MY_SHARED_LIBRARIES)
|
||||
|
||||
# Module 'libgallium_dri', produces '/vendor/lib{64}/dri/libgallium_dri.so'
|
||||
# This module also trigger DRI symlinks creation process
|
||||
$(eval $(call mesa3d-lib,libgallium_dri,.so.0,dri,MESA3D_GALLIUM_DRI_BIN))
|
||||
@@ -169,8 +153,10 @@ $(foreach driver,$(BOARD_MESA3D_VULKAN_DRIVERS), \
|
||||
$(eval $(call mesa3d-lib,vulkan.$(MESA_VK_LIB_SUFFIX_$(driver)),.so.0,hw,MESA3D_VULKAN_$(driver)_BIN)))
|
||||
|
||||
ifneq ($(filter true, $(BOARD_MESA3D_BUILD_LIBGBM)),)
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(MESA3D_TOP)/src/gbm/main
|
||||
|
||||
# Modules 'libgbm', produces '/vendor/lib{64}/libgbm.so'
|
||||
$(eval $(call mesa3d-lib,libgbm,.so.1,,MESA3D_LIBGBM_BIN,$(MESA3D_TOP)/src/gbm/main))
|
||||
$(eval $(call mesa3d-lib,libgbm,.so.1,,MESA3D_LIBGBM_BIN))
|
||||
endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@@ -21,23 +21,26 @@
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
# Turn "dir1/dir2/dir3/dir4" into "../../../../"
|
||||
define relative_top_path
|
||||
$(eval __s:=) \
|
||||
$(foreach tmp,$(subst /,$(space),$1),$(eval __s:=$(__s)../)) \
|
||||
$(__s)
|
||||
endef
|
||||
|
||||
MY_PATH := $(call my-dir)
|
||||
|
||||
AOSP_ABSOLUTE_PATH := $(realpath .)
|
||||
define relative-to-absolute
|
||||
$(if $(patsubst /%,,$1),$(AOSP_ABSOLUTE_PATH)/$1,$1)
|
||||
endef
|
||||
|
||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||
LOCAL_MODULE := meson.dummy.$(LOCAL_MULTILIB)
|
||||
m_dummy_$(LOCAL_MULTILIB) := $(TARGET_OUT_INTERMEDIATES)/MESON_DUMMY_$(LOCAL_MULTILIB)/dummy.c
|
||||
|
||||
m_dummy := $(local-generated-sources-dir)/dummy.c
|
||||
$(m_dummy):
|
||||
$(m_dummy_$(LOCAL_MULTILIB)):
|
||||
mkdir -p $(dir $@)
|
||||
touch $@
|
||||
|
||||
LOCAL_GENERATED_SOURCES := $(m_dummy)
|
||||
LOCAL_SRC_FILES := $(call relative_top_path,$(MY_PATH))$(m_dummy_$(LOCAL_MULTILIB))
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE := meson.dummy.$(LOCAL_MULTILIB)
|
||||
|
||||
# Prepare intermediate variables by AOSP make/core internals
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
@@ -80,7 +83,7 @@ MESA3D_GLES_BINS := \
|
||||
|
||||
MESON_GEN_NINJA := \
|
||||
cd $(MESON_OUT_DIR) && PATH=/usr/bin:/usr/local/bin:$$PATH meson ./build \
|
||||
--cross-file $(call relative-to-absolute,$(MESON_GEN_DIR))/aosp_cross \
|
||||
--cross-file $(AOSP_ABSOLUTE_PATH)/$(MESON_GEN_DIR)/aosp_cross \
|
||||
--buildtype=release \
|
||||
-Ddri-search-path=/vendor/$(MESA3D_LIB_DIR)/dri \
|
||||
-Dplatforms=android \
|
||||
@@ -169,7 +172,7 @@ endef
|
||||
|
||||
define m-lld-flags-cleaned
|
||||
$(subst prebuilts/,$(AOSP_ABSOLUTE_PATH)/prebuilts/, \
|
||||
$(subst $(OUT_DIR)/,$(call relative-to-absolute,$(OUT_DIR))/, \
|
||||
$(subst out/,$(AOSP_ABSOLUTE_PATH)/out/, \
|
||||
$(subst -Wl$(comma)--fatal-warnings,, \
|
||||
$(subst -Wl$(comma)--no-undefined-version,, \
|
||||
$(subst -Wl$(comma)--gc-sections,, \
|
||||
@@ -200,32 +203,17 @@ define m-c-flags
|
||||
endef
|
||||
|
||||
define filter-c-flags
|
||||
$(filter-out -std=gnu++17 -std=gnu99 -fno-rtti, \
|
||||
$(patsubst -W%,, $1))
|
||||
$(subst -std=gnu++17,, \
|
||||
$(subst -fno-rtti,, \
|
||||
$(patsubst -W%,, \
|
||||
$1)))
|
||||
endef
|
||||
|
||||
define nospace-includes
|
||||
$(subst $(space)-isystem$(space),$(space)-isystem, \
|
||||
$(subst $(space)-I$(space),$(space)-I, \
|
||||
$(strip $(c-includes))))
|
||||
endef
|
||||
|
||||
# Ensure include paths are always absolute
|
||||
# When OUT_DIR_COMMON_BASE env variable is set the AOSP/KATI will use absolute paths
|
||||
# for headers in intermediate output directories, but relative for all others.
|
||||
define abs-include
|
||||
$(strip \
|
||||
$(if $(patsubst -I%,,$1),\
|
||||
$(if $(patsubst -isystem/%,,$1),\
|
||||
$(subst -isystem,-isystem$(AOSP_ABSOLUTE_PATH)/,$1),\
|
||||
$1\
|
||||
),\
|
||||
$(if $(patsubst -I/%,,$1),\
|
||||
$(subst -I,-I$(AOSP_ABSOLUTE_PATH)/,$1),\
|
||||
$1\
|
||||
)\
|
||||
)
|
||||
)
|
||||
define m-c-abs-includes
|
||||
$(subst -isystem , -isystem $(AOSP_ABSOLUTE_PATH)/, \
|
||||
$(subst -I, -I$(AOSP_ABSOLUTE_PATH)/, \
|
||||
$(subst -I , -I, \
|
||||
$(c-includes))))
|
||||
endef
|
||||
|
||||
$(MESON_GEN_FILES_TARGET): PREPROCESS_MESON_CONFIGS:=$(PREPROCESS_MESON_CONFIGS)
|
||||
@@ -233,10 +221,8 @@ $(MESON_GEN_FILES_TARGET): MESON_GEN_DIR:=$(MESON_GEN_DIR)
|
||||
$(MESON_GEN_FILES_TARGET): $(sort $(shell find -L $(MESA3D_TOP) -not -path '*/\.*'))
|
||||
mkdir -p $(dir $@)
|
||||
echo -e "[properties]\n" \
|
||||
"c_args = [$(foreach flag,$(call filter-c-flags,$(m-c-flags)),'$(flag)', ) \
|
||||
$(foreach inc,$(nospace-includes),'$(call abs-include,$(inc))', )'']\n" \
|
||||
"cpp_args = [$(foreach flag,$(call filter-c-flags,$(m-cpp-flags)),'$(flag)', ) \
|
||||
$(foreach inc,$(nospace-includes),'$(call abs-include,$(inc))', )'']\n" \
|
||||
"c_args = [$(foreach flag, $(call filter-c-flags,$(m-c-flags) $(m-c-abs-includes)),'$(flag)', )'']\n" \
|
||||
"cpp_args = [$(foreach flag, $(call filter-c-flags,$(m-cpp-flags) $(m-c-abs-includes)),'$(flag)', )'']\n" \
|
||||
"c_link_args = [$(foreach flag, $(m-lld-flags-cleaned),'$(flag)',)'']\n" \
|
||||
"cpp_link_args = [$(foreach flag, $(m-lld-flags-cleaned),'$(flag)',)'']\n" \
|
||||
"needs_exe_wrapper = true\n" \
|
||||
@@ -246,7 +232,7 @@ $(MESON_GEN_FILES_TARGET): $(sort $(shell find -L $(MESA3D_TOP) -not -path '*/\.
|
||||
"cpp = [$(foreach arg,$(PRIVATE_CXX),'$(subst prebuilts/,$(AOSP_ABSOLUTE_PATH)/prebuilts/,$(arg))',)'']\n" \
|
||||
"c_ld = 'lld'\n" \
|
||||
"cpp_ld = 'lld'\n\n" \
|
||||
"pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=' + '$(call relative-to-absolute,$(MESON_GEN_DIR))', '/usr/bin/pkg-config']\n\n" \
|
||||
"pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=' + '$(AOSP_ABSOLUTE_PATH)/$(MESON_GEN_DIR)', '/usr/bin/pkg-config']\n\n" \
|
||||
"llvm-config = '/dev/null'\n" \
|
||||
"[host_machine]\n" \
|
||||
"system = 'linux'\n" \
|
||||
@@ -285,7 +271,7 @@ $(MESON_OUT_DIR)/install/.install.timestamp: MESON_BUILD:=$(MESON_BUILD)
|
||||
$(MESON_OUT_DIR)/install/.install.timestamp: $(MESON_OUT_DIR)/.build.timestamp
|
||||
rm -rf $(dir $@)
|
||||
mkdir -p $(dir $@)
|
||||
DESTDIR=$(call relative-to-absolute,$(dir $@)) $(MESON_BUILD) install
|
||||
DESTDIR=$(AOSP_ABSOLUTE_PATH)/$(dir $@) $(MESON_BUILD) install
|
||||
$(MESON_COPY_LIBGALLIUM)
|
||||
touch $@
|
||||
|
||||
|
@@ -40,7 +40,7 @@ import docutils.utils
|
||||
import docutils.parsers.rst.states as states
|
||||
|
||||
CURRENT_GL_VERSION = '4.6'
|
||||
CURRENT_VK_VERSION = '1.3'
|
||||
CURRENT_VK_VERSION = '1.2'
|
||||
|
||||
TEMPLATE = Template(textwrap.dedent("""\
|
||||
${header}
|
||||
|
@@ -1,98 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright © 2021-2021 Yonggang Luo
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
gen_help = """Generates visual studio module definition file."""
|
||||
|
||||
import argparse
|
||||
|
||||
"""
|
||||
For input template definition file
|
||||
For gcc/x64,gcc/arm64,visual studio
|
||||
`wglMakeCurrent@8 @357` => `wglMakeCurrent @357`
|
||||
`DrvCopyContext@12` => `DrvCopyContext`
|
||||
`stw_get_device` => `stw_get_device`
|
||||
For gcc/x86,gcc/arm
|
||||
`wglMakeCurrent@8 @357` => `wglMakeCurrent@8 @357 == wglMakeCurrent`
|
||||
`DrvCopyContext@12` => `DrvCopyContext@12 == DrvCopyContext`
|
||||
`stw_get_device` => `stw_get_device`
|
||||
|
||||
"""
|
||||
def gen_vs_module_def(in_file: str, out_file: str, compiler_id: str, cpu_family: str) -> None:
|
||||
out_file_lines = ['EXPORTS']
|
||||
with open(in_file, 'r', encoding='utf-8') as f:
|
||||
lines = f.readlines()
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
tokens = line.split(';')
|
||||
if not tokens:
|
||||
continue
|
||||
def_infos = [x for x in tokens[0].split(' ') if len(x) > 0]
|
||||
if not def_infos:
|
||||
if line:
|
||||
out_file_lines.append('\t' + line)
|
||||
else:
|
||||
out_file_lines.append('')
|
||||
continue
|
||||
name_infos = def_infos[0].split('@')
|
||||
if not name_infos:
|
||||
out_file_lines.append('\t;' + line)
|
||||
continue
|
||||
order_info = '' if len(def_infos) <= 1 else def_infos[1]
|
||||
if def_infos[0] != name_infos[0] and \
|
||||
(compiler_id == 'gcc') and (cpu_family not in {'x86_64', 'aarch64'}):
|
||||
if order_info:
|
||||
out_file_lines.append('\t' + def_infos[0] + ' ' + order_info + ' == ' + name_infos[0])
|
||||
else:
|
||||
out_file_lines.append('\t' + def_infos[0] + ' == ' + name_infos[0])
|
||||
else:
|
||||
if order_info:
|
||||
out_file_lines.append('\t' + name_infos[0] + ' ' + order_info)
|
||||
else:
|
||||
out_file_lines.append('\t' + name_infos[0])
|
||||
with open(out_file, 'wb') as f:
|
||||
out_file_content = '\n'.join(out_file_lines) + '\n'
|
||||
f.write(out_file_content.encode('utf-8'))
|
||||
'''
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/libgl-gdi/opengl32.def.in --out_file src/gallium/targets/libgl-gdi/opengl32.def --compiler_id gcc --cpu_family x86_64
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/libgl-gdi/opengl32.def.in --out_file src/gallium/targets/libgl-gdi/opengl32.mingw.def --compiler_id gcc --cpu_family x86
|
||||
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/osmesa/osmesa.def.in --out_file src/gallium/targets/osmesa/osmesa.def --compiler_id gcc --cpu_family x86_64
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/osmesa/osmesa.def.in --out_file src/gallium/targets/osmesa/osmesa.mingw.def --compiler_id gcc --cpu_family x86
|
||||
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/wgl/gallium_wgl.def.in --out_file src/gallium/targets/wgl/gallium_wgl.def --compiler_id gcc --cpu_family x86_64
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/wgl/gallium_wgl.def.in --out_file src/gallium/targets/wgl/gallium_wgl.mingw.def --compiler_id gcc --cpu_family x86
|
||||
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/egl/main/egl.def.in --out_file src/egl/main/egl.def --compiler_id gcc --cpu_family x86_64
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/egl/main/egl.def.in --out_file src/egl/main/egl.mingw.def --compiler_id gcc --cpu_family x86
|
||||
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/lavapipe/vulkan_lvp.def.in --out_file src/gallium/targets/lavapipe/vulkan_lvp.def --compiler_id gcc --cpu_family x86_64
|
||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/lavapipe/vulkan_lvp.def.in --out_file src/gallium/targets/lavapipe/vulkan_lvp.mingw.def --compiler_id gcc --cpu_family x86
|
||||
|
||||
'''
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description=gen_help)
|
||||
parser.add_argument('--in_file', help='input template moudle definition file')
|
||||
parser.add_argument('--out_file', help='output moudle definition file')
|
||||
parser.add_argument('--compiler_id', help='compiler id')
|
||||
parser.add_argument('--cpu_family', help='cpu family')
|
||||
args = parser.parse_args()
|
||||
# print(args)
|
||||
gen_vs_module_def(args.in_file, args.out_file, args.compiler_id, args.cpu_family)
|
@@ -19,6 +19,5 @@
|
||||
# SOFTWARE.
|
||||
|
||||
git_sha1_gen_py = files('git_sha1_gen.py')
|
||||
gen_vs_module_defs_py = files('gen_vs_module_defs.py')
|
||||
symbols_check = find_program('symbols-check.py')
|
||||
install_megadrivers_py = find_program('install_megadrivers.py')
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user