Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions runtime/fastly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ add_builtin(fastly::fetch SRC builtins/fetch/fetch.cpp builtins/fetch/request-re
add_builtin(fastly::cache_override SRC builtins/cache-override.cpp)
add_builtin(fastly::fetch_event SRC builtins/fetch-event.cpp DEPENDENCIES OpenSSL)

add_compile_definitions(PUBLIC RUNTIME_VERSION=${RUNTIME_VERSION})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this line and verified with a local build the string starlingmonkey-3.16.2 is being correctly inlined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙏


project(FastlyJS)
3 changes: 2 additions & 1 deletion runtime/fastly/build-debug.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname "$0")" || exit 1
HOST_API=$(realpath host-api) cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0
RUNTIME_VERSION=$(npm pkg get version --json --prefix=../../ | jq -r)
HOST_API=$(realpath host-api) cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0 -DRUNTIME_VERSION="\"starlingmonkey-$RUNTIME_VERSION\""
cmake --build build-debug --parallel 10
mv build-debug/starling.wasm/starling.wasm ../../
3 changes: 2 additions & 1 deletion runtime/fastly/build-release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname "$0")" || exit 1
HOST_API=$(realpath host-api) cmake -B build-release -DCMAKE_BUILD_TYPE=Release -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0
RUNTIME_VERSION=$(npm pkg get version --json --prefix=../../ | jq -r)
HOST_API=$(realpath host-api) cmake -B build-release -DCMAKE_BUILD_TYPE=Release -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0 -DRUNTIME_VERSION="\"starlingmonkey-$RUNTIME_VERSION\""
cmake --build build-release
mv build-release/starling.wasm/starling.wasm ../../
2 changes: 0 additions & 2 deletions runtime/fastly/builtins/fastly.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace fastly::fastly {

#define RUNTIME_VERSION "starlingmonkey-dev"

class Env : public builtins::BuiltinNoConstructor<Env> {
private:
static bool env_get(JSContext *cx, unsigned argc, JS::Value *vp);
Expand Down
3 changes: 3 additions & 0 deletions runtime/js-compute-runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ WIT_BINDGEN ?= $(shell which wit-bindgen)
# Default optimization flgs for clang/clang++.
OPT_FLAGS ?= -O2

RUNTIME_VERSION ?= $(shell npm pkg get version --json | jq -r)

# Command helpers for making nice build output.
include mk/commands.mk

Expand Down Expand Up @@ -92,6 +94,7 @@ SM_OBJ += $(wildcard $(SM_SRC)/lib/*.a)
# This is required when using spidermonkey headers, as it allows us to enable
# the streams library when setting up the js context.
DEFINES := -DMOZ_JS_STREAMS
DEFINES += -DRUNTIME_VERSION='"$(RUNTIME_VERSION)"'

# Flags for c++ compilation
CXX_FLAGS := -std=gnu++20 -Wall -Werror -Qunused-arguments
Expand Down
2 changes: 0 additions & 2 deletions runtime/js-compute-runtime/js-compute-builtins.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ const JSErrorFormatString js_ErrorFormatString[JSErrNum_Limit] = {

#include "host_interface/host_api.h"

#define RUNTIME_VERSION "3.13.2-dev"

const JSErrorFormatString *GetErrorMessage(void *userRef, unsigned errorNumber);

JSObject *PromiseRejectedWithPendingError(JSContext *cx);
Expand Down