Skip to content

Commit 3d9a8da

Browse files
author
Guy Bedford
authored
fix: debug build & tests (#818)
1 parent 863428f commit 3d9a8da

File tree

3 files changed

+18
-28
lines changed

3 files changed

+18
-28
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ jobs:
166166
name: Run Web Platform Tests
167167
strategy:
168168
matrix:
169-
include:
170-
- profile: debug
171-
- profile: release
169+
profile: [debug, release]
172170
needs: [build, ensure_cargo_installs]
173171
runs-on: ubuntu-latest
174172
steps:
@@ -228,6 +226,9 @@ jobs:
228226
if: github.ref != 'refs/heads/main'
229227
runs-on: ubuntu-latest
230228
needs: [build, ensure_cargo_installs]
229+
strategy:
230+
matrix:
231+
profile: [debug, release]
231232
steps:
232233
- name: Checkout fastly/js-compute-runtime
233234
uses: actions/checkout@v3
@@ -262,12 +263,10 @@ jobs:
262263
echo "bailing out from the build early"
263264
exit 1
264265
265-
# https://github.com/fastly/js-compute-runtime/issues/361
266-
# TODO: Use engine-debug on all apps once we upgrade to FF 109
267266
- name: Download Engine
268267
uses: actions/download-artifact@v3
269268
with:
270-
name: 'engine-debug'
269+
name: 'engine-${{ matrix.profile }}'
271270
- run: yarn install --frozen-lockfile
272271

273272
- name: js-compute Integration Tests Job
@@ -364,6 +363,9 @@ jobs:
364363
starlingmonkey-build:
365364
name: StarlingMonkey Build
366365
runs-on: ubuntu-latest
366+
strategy:
367+
matrix:
368+
profile: [debug, release]
367369
steps:
368370
- uses: actions/checkout@v3
369371
with:
@@ -373,10 +375,14 @@ jobs:
373375
rustup toolchain install 1.77.1
374376
rustup target add wasm32-wasi --toolchain 1.77.1
375377
- name: Build
378+
if: ${{ matrix.profile == 'release' }}
376379
run: npm run build:starlingmonkey
380+
- name: Build
381+
if: ${{ matrix.profile == 'debug' }}
382+
run: npm run build:starlingmonkey:debug
377383
- uses: actions/upload-artifact@v3
378384
with:
379-
name: starling-release
385+
name: starling-${{ matrix.profile }}
380386
path: starling.wasm
381387

382388
starlingmonkey-run_wpt:
@@ -438,6 +444,10 @@ jobs:
438444
strategy:
439445
matrix:
440446
platform: [viceroy, compute]
447+
profile: [debug, release]
448+
exclude:
449+
- platform: compute
450+
profile: release
441451
needs: [starlingmonkey-build]
442452
steps:
443453
- name: Checkout fastly/js-compute-runtime
@@ -475,7 +485,7 @@ jobs:
475485
- name: Download Engine
476486
uses: actions/download-artifact@v3
477487
with:
478-
name: starling-release
488+
name: starling-${{ matrix.profile }}
479489
- run: yarn install --frozen-lockfile
480490

481491
- name: Yarn install

runtime/fastly/builtins/fetch/request-response.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,14 @@ uint32_t RequestOrResponse::handle(JSObject *obj) {
238238
}
239239

240240
bool RequestOrResponse::has_body(JSObject *obj) {
241-
MOZ_ASSERT(is_instance(obj));
242241
return JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::HasBody)).toBoolean();
243242
}
244243

245244
host_api::HttpBody RequestOrResponse::body_handle(JSObject *obj) {
246-
MOZ_ASSERT(is_instance(obj));
247245
return host_api::HttpBody(JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::Body)).toInt32());
248246
}
249247

250248
JSObject *RequestOrResponse::body_stream(JSObject *obj) {
251-
MOZ_ASSERT(is_instance(obj));
252249
return JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::BodyStream)).toObjectOrNull();
253250
}
254251

@@ -259,7 +256,6 @@ JSObject *RequestOrResponse::body_source(JSContext *cx, JS::HandleObject obj) {
259256
}
260257

261258
bool RequestOrResponse::body_used(JSObject *obj) {
262-
MOZ_ASSERT(is_instance(obj));
263259
return JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::BodyUsed)).toBoolean();
264260
}
265261

@@ -1133,7 +1129,6 @@ bool RequestOrResponse::maybe_stream_body(JSContext *cx, JS::HandleObject body_o
11331129
}
11341130

11351131
JSObject *RequestOrResponse::create_body_stream(JSContext *cx, JS::HandleObject owner) {
1136-
MOZ_ASSERT(is_instance(owner));
11371132
MOZ_ASSERT(!body_stream(owner));
11381133
JS::RootedObject source(cx, NativeStreamSource::create(cx, owner, JS::UndefinedHandleValue,
11391134
body_source_pull_algorithm,
@@ -1159,7 +1154,6 @@ JSObject *RequestOrResponse::create_body_stream(JSContext *cx, JS::HandleObject
11591154

11601155
bool RequestOrResponse::body_get(JSContext *cx, JS::CallArgs args, JS::HandleObject self,
11611156
bool create_if_undefined) {
1162-
MOZ_ASSERT(is_instance(self));
11631157
if (!has_body(self)) {
11641158
args.rval().setNull();
11651159
return true;
@@ -3072,10 +3066,6 @@ bool Response::init_class(JSContext *cx, JS::HandleObject global) {
30723066
JSObject *Response::create(JSContext *cx, JS::HandleObject response,
30733067
host_api::HttpResp response_handle, host_api::HttpBody body_handle,
30743068
bool is_upstream, bool is_grip, JS::UniqueChars backend) {
3075-
// MOZ_ASSERT(cx);
3076-
// MOZ_ASSERT(is_instance(response));
3077-
// MOZ_ASSERT(response_handle);
3078-
// MOZ_ASSERT(body_handle);
30793069
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Response),
30803070
JS::Int32Value(response_handle.handle));
30813071
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Headers), JS::NullValue());

runtime/js-compute-runtime/builtins/request-response.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,14 @@ uint32_t RequestOrResponse::handle(JSObject *obj) {
224224
}
225225

226226
bool RequestOrResponse::has_body(JSObject *obj) {
227-
MOZ_ASSERT(is_instance(obj));
228227
return JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::HasBody)).toBoolean();
229228
}
230229

231230
host_api::HttpBody RequestOrResponse::body_handle(JSObject *obj) {
232-
MOZ_ASSERT(is_instance(obj));
233231
return host_api::HttpBody(JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::Body)).toInt32());
234232
}
235233

236234
JSObject *RequestOrResponse::body_stream(JSObject *obj) {
237-
MOZ_ASSERT(is_instance(obj));
238235
return JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::BodyStream)).toObjectOrNull();
239236
}
240237

@@ -245,7 +242,6 @@ JSObject *RequestOrResponse::body_source(JSContext *cx, JS::HandleObject obj) {
245242
}
246243

247244
bool RequestOrResponse::body_used(JSObject *obj) {
248-
MOZ_ASSERT(is_instance(obj));
249245
return JS::GetReservedSlot(obj, static_cast<uint32_t>(Slots::BodyUsed)).toBoolean();
250246
}
251247

@@ -1125,7 +1121,6 @@ bool RequestOrResponse::maybe_stream_body(JSContext *cx, JS::HandleObject body_o
11251121
}
11261122

11271123
JSObject *RequestOrResponse::create_body_stream(JSContext *cx, JS::HandleObject owner) {
1128-
MOZ_ASSERT(is_instance(owner));
11291124
MOZ_ASSERT(!body_stream(owner));
11301125
JS::RootedObject source(cx, builtins::NativeStreamSource::create(
11311126
cx, owner, JS::UndefinedHandleValue, body_source_pull_algorithm,
@@ -1151,7 +1146,6 @@ JSObject *RequestOrResponse::create_body_stream(JSContext *cx, JS::HandleObject
11511146

11521147
bool RequestOrResponse::body_get(JSContext *cx, JS::CallArgs args, JS::HandleObject self,
11531148
bool create_if_undefined) {
1154-
MOZ_ASSERT(is_instance(self));
11551149
if (!has_body(self)) {
11561150
args.rval().setNull();
11571151
return true;
@@ -3070,10 +3064,6 @@ bool Response::init_class(JSContext *cx, JS::HandleObject global) {
30703064
JSObject *Response::create(JSContext *cx, JS::HandleObject response,
30713065
host_api::HttpResp response_handle, host_api::HttpBody body_handle,
30723066
bool is_upstream, bool is_grip, JS::UniqueChars backend) {
3073-
// MOZ_ASSERT(cx);
3074-
// MOZ_ASSERT(is_instance(response));
3075-
// MOZ_ASSERT(response_handle);
3076-
// MOZ_ASSERT(body_handle);
30773067
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Response),
30783068
JS::Int32Value(response_handle.handle));
30793069
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Headers), JS::NullValue());

0 commit comments

Comments
 (0)