Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5baab050e2 |
@@ -24,25 +24,35 @@ jobs:
|
|||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -y gcc libcurl4-openssl-dev
|
apt-get install -y gcc libcurl4-openssl-dev
|
||||||
|
|
||||||
# Seed: use the committed linux-amd64 binary as the bootstrap
|
# Gen2: compile the bootstrap C source into a working elc binary
|
||||||
- name: Bootstrap from committed linux binary (seed)
|
- name: Build elc from bootstrap (gen2)
|
||||||
run: |
|
run: |
|
||||||
chmod +x dist/platform/elc-linux-amd64
|
# -Wl,--allow-multiple-definition: elc-bootstrap.c and el_runtime.c both define
|
||||||
echo "seed elc (committed linux-amd64 binary)"
|
# is_digit/is_whitespace; bootstrap predates the text-processing primitives commit
|
||||||
dist/platform/elc-linux-amd64 --version || true
|
|
||||||
|
|
||||||
# Gen2: use seed to self-host compile the El compiler
|
|
||||||
- name: Self-host compile El compiler (gen2)
|
|
||||||
run: |
|
|
||||||
dist/platform/elc-linux-amd64 elc-cli.el > dist/elc-gen2.c
|
|
||||||
gcc -O2 \
|
gcc -O2 \
|
||||||
-I el-compiler/runtime \
|
-I el-compiler/runtime \
|
||||||
dist/elc-gen2.c \
|
dist/elc-bootstrap.c \
|
||||||
el-compiler/runtime/el_runtime.c \
|
el-compiler/runtime/el_runtime.c \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm \
|
-lcurl -lpthread -lm \
|
||||||
|
-Wl,--allow-multiple-definition \
|
||||||
|
-o dist/elc-gen2
|
||||||
|
chmod +x dist/elc-gen2
|
||||||
|
echo "gen2 elc built"
|
||||||
|
dist/elc-gen2 --version || true
|
||||||
|
|
||||||
|
# Gen3: use gen2 to compile the El compiler from its own El source (self-host)
|
||||||
|
- name: Self-host compile El compiler with gen2 (gen3)
|
||||||
|
run: |
|
||||||
|
mkdir -p dist/platform
|
||||||
|
dist/elc-gen2 el-compiler/src/compiler.el > dist/elc-gen3.c
|
||||||
|
gcc -O2 \
|
||||||
|
-I el-compiler/runtime \
|
||||||
|
dist/elc-gen3.c \
|
||||||
|
el-compiler/runtime/el_runtime.c \
|
||||||
|
-lcurl -lpthread -lm \
|
||||||
-o dist/platform/elc
|
-o dist/platform/elc
|
||||||
chmod +x dist/platform/elc
|
chmod +x dist/platform/elc
|
||||||
echo "gen2 (self-hosted) elc built"
|
echo "gen3 (self-hosted) elc built"
|
||||||
dist/platform/elc --version || true
|
dist/platform/elc --version || true
|
||||||
|
|
||||||
- name: Run tests - text
|
- name: Run tests - text
|
||||||
@@ -77,7 +87,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c
|
"$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_core
|
-lcurl -lpthread -lm -o /tmp/el_native_core
|
||||||
/tmp/el_native_core
|
/tmp/el_native_core
|
||||||
|
|
||||||
- name: Run tests - native (text)
|
- name: Run tests - native (text)
|
||||||
@@ -87,7 +97,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c
|
"$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_text
|
-lcurl -lpthread -lm -o /tmp/el_native_text
|
||||||
/tmp/el_native_text
|
/tmp/el_native_text
|
||||||
|
|
||||||
- name: Run tests - native (string)
|
- name: Run tests - native (string)
|
||||||
@@ -97,7 +107,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c
|
"$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_string
|
-lcurl -lpthread -lm -o /tmp/el_native_string
|
||||||
/tmp/el_native_string
|
/tmp/el_native_string
|
||||||
|
|
||||||
- name: Run tests - native (math)
|
- name: Run tests - native (math)
|
||||||
@@ -107,7 +117,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c
|
"$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_math
|
-lcurl -lpthread -lm -o /tmp/el_native_math
|
||||||
/tmp/el_native_math
|
/tmp/el_native_math
|
||||||
|
|
||||||
- name: Run tests - native (state)
|
- name: Run tests - native (state)
|
||||||
@@ -117,7 +127,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c
|
"$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_state
|
-lcurl -lpthread -lm -o /tmp/el_native_state
|
||||||
/tmp/el_native_state
|
/tmp/el_native_state
|
||||||
|
|
||||||
- name: Run tests - native (time)
|
- name: Run tests - native (time)
|
||||||
@@ -127,7 +137,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c
|
"$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_time
|
-lcurl -lpthread -lm -o /tmp/el_native_time
|
||||||
/tmp/el_native_time
|
/tmp/el_native_time
|
||||||
|
|
||||||
- name: Run tests - native (json)
|
- name: Run tests - native (json)
|
||||||
@@ -137,7 +147,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c
|
"$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_json
|
-lcurl -lpthread -lm -o /tmp/el_native_json
|
||||||
/tmp/el_native_json
|
/tmp/el_native_json
|
||||||
|
|
||||||
- name: Run tests - native (env)
|
- name: Run tests - native (env)
|
||||||
@@ -147,7 +157,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c
|
"$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_env
|
-lcurl -lpthread -lm -o /tmp/el_native_env
|
||||||
/tmp/el_native_env
|
/tmp/el_native_env
|
||||||
|
|
||||||
- name: Run tests - native (fs)
|
- name: Run tests - native (fs)
|
||||||
@@ -157,7 +167,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c
|
"$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs
|
-lcurl -lpthread -lm -o /tmp/el_native_fs
|
||||||
/tmp/el_native_fs
|
/tmp/el_native_fs
|
||||||
|
|
||||||
# Publish only after merge (push event), not on PR validation runs
|
# Publish only after merge (push event), not on PR validation runs
|
||||||
@@ -168,7 +178,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${GCP_SA_KEY}" > /tmp/gcp-key.json
|
echo "${GCP_SA_KEY}" > /tmp/gcp-key.json
|
||||||
apt-get install -y -qq apt-transport-https ca-certificates gnupg curl
|
apt-get install -y -qq apt-transport-https ca-certificates gnupg curl
|
||||||
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg -o /usr/share/keyrings/cloud.google.gpg
|
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
|
||||||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list
|
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||||
apt-get update -qq && apt-get install -y google-cloud-cli
|
apt-get update -qq && apt-get install -y google-cloud-cli
|
||||||
gcloud auth activate-service-account --key-file=/tmp/gcp-key.json
|
gcloud auth activate-service-account --key-file=/tmp/gcp-key.json
|
||||||
|
|||||||
@@ -34,25 +34,35 @@ jobs:
|
|||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -y gcc libcurl4-openssl-dev
|
apt-get install -y gcc libcurl4-openssl-dev
|
||||||
|
|
||||||
# Seed: use the committed linux-amd64 binary as the bootstrap
|
# Gen2: compile the bootstrap C source into a working elc binary
|
||||||
- name: Bootstrap from committed linux binary (seed)
|
- name: Build elc from bootstrap (gen2)
|
||||||
run: |
|
run: |
|
||||||
chmod +x dist/platform/elc-linux-amd64
|
# -Wl,--allow-multiple-definition: elc-bootstrap.c and el_runtime.c both define
|
||||||
echo "seed elc (committed linux-amd64 binary)"
|
# is_digit/is_whitespace; bootstrap predates the text-processing primitives commit
|
||||||
dist/platform/elc-linux-amd64 --version || true
|
|
||||||
|
|
||||||
# Gen2: use seed to self-host compile the El compiler
|
|
||||||
- name: Self-host compile El compiler (gen2)
|
|
||||||
run: |
|
|
||||||
dist/platform/elc-linux-amd64 elc-cli.el > dist/elc-gen2.c
|
|
||||||
gcc -O2 \
|
gcc -O2 \
|
||||||
-I el-compiler/runtime \
|
-I el-compiler/runtime \
|
||||||
dist/elc-gen2.c \
|
dist/elc-bootstrap.c \
|
||||||
el-compiler/runtime/el_runtime.c \
|
el-compiler/runtime/el_runtime.c \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm \
|
-lcurl -lpthread -lm \
|
||||||
|
-Wl,--allow-multiple-definition \
|
||||||
|
-o dist/elc-gen2
|
||||||
|
chmod +x dist/elc-gen2
|
||||||
|
echo "gen2 elc built"
|
||||||
|
dist/elc-gen2 --version || true
|
||||||
|
|
||||||
|
# Gen3: use gen2 to compile the El compiler from its own El source (self-host)
|
||||||
|
- name: Self-host compile El compiler with gen2 (gen3)
|
||||||
|
run: |
|
||||||
|
mkdir -p dist/platform
|
||||||
|
dist/elc-gen2 el-compiler/src/compiler.el > dist/elc-gen3.c
|
||||||
|
gcc -O2 \
|
||||||
|
-I el-compiler/runtime \
|
||||||
|
dist/elc-gen3.c \
|
||||||
|
el-compiler/runtime/el_runtime.c \
|
||||||
|
-lcurl -lpthread -lm \
|
||||||
-o dist/platform/elc
|
-o dist/platform/elc
|
||||||
chmod +x dist/platform/elc
|
chmod +x dist/platform/elc
|
||||||
echo "gen2 (self-hosted) elc built"
|
echo "gen3 (self-hosted) elc built"
|
||||||
dist/platform/elc --version || true
|
dist/platform/elc --version || true
|
||||||
|
|
||||||
- name: Run tests - text
|
- name: Run tests - text
|
||||||
@@ -87,7 +97,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c
|
"$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_core
|
-lcurl -lpthread -lm -o /tmp/el_native_core
|
||||||
/tmp/el_native_core
|
/tmp/el_native_core
|
||||||
|
|
||||||
- name: Run tests - native (text)
|
- name: Run tests - native (text)
|
||||||
@@ -97,7 +107,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c
|
"$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_text
|
-lcurl -lpthread -lm -o /tmp/el_native_text
|
||||||
/tmp/el_native_text
|
/tmp/el_native_text
|
||||||
|
|
||||||
- name: Run tests - native (string)
|
- name: Run tests - native (string)
|
||||||
@@ -107,7 +117,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c
|
"$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_string
|
-lcurl -lpthread -lm -o /tmp/el_native_string
|
||||||
/tmp/el_native_string
|
/tmp/el_native_string
|
||||||
|
|
||||||
- name: Run tests - native (math)
|
- name: Run tests - native (math)
|
||||||
@@ -117,7 +127,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c
|
"$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_math
|
-lcurl -lpthread -lm -o /tmp/el_native_math
|
||||||
/tmp/el_native_math
|
/tmp/el_native_math
|
||||||
|
|
||||||
- name: Run tests - native (state)
|
- name: Run tests - native (state)
|
||||||
@@ -127,7 +137,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c
|
"$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_state
|
-lcurl -lpthread -lm -o /tmp/el_native_state
|
||||||
/tmp/el_native_state
|
/tmp/el_native_state
|
||||||
|
|
||||||
- name: Run tests - native (time)
|
- name: Run tests - native (time)
|
||||||
@@ -137,7 +147,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c
|
"$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_time
|
-lcurl -lpthread -lm -o /tmp/el_native_time
|
||||||
/tmp/el_native_time
|
/tmp/el_native_time
|
||||||
|
|
||||||
- name: Run tests - native (json)
|
- name: Run tests - native (json)
|
||||||
@@ -147,7 +157,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c
|
"$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_json
|
-lcurl -lpthread -lm -o /tmp/el_native_json
|
||||||
/tmp/el_native_json
|
/tmp/el_native_json
|
||||||
|
|
||||||
- name: Run tests - native (env)
|
- name: Run tests - native (env)
|
||||||
@@ -157,7 +167,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c
|
"$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_env
|
-lcurl -lpthread -lm -o /tmp/el_native_env
|
||||||
/tmp/el_native_env
|
/tmp/el_native_env
|
||||||
|
|
||||||
- name: Run tests - native (fs)
|
- name: Run tests - native (fs)
|
||||||
@@ -167,7 +177,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c
|
"$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs
|
-lcurl -lpthread -lm -o /tmp/el_native_fs
|
||||||
/tmp/el_native_fs
|
/tmp/el_native_fs
|
||||||
|
|
||||||
# Publish only after merge (push event), not on PR validation runs
|
# Publish only after merge (push event), not on PR validation runs
|
||||||
@@ -178,7 +188,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${GCP_SA_KEY}" > /tmp/gcp-key.json
|
echo "${GCP_SA_KEY}" > /tmp/gcp-key.json
|
||||||
apt-get install -y -qq apt-transport-https ca-certificates gnupg curl
|
apt-get install -y -qq apt-transport-https ca-certificates gnupg curl
|
||||||
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg -o /usr/share/keyrings/cloud.google.gpg
|
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
|
||||||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list
|
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||||
apt-get update -qq && apt-get install -y google-cloud-cli
|
apt-get update -qq && apt-get install -y google-cloud-cli
|
||||||
gcloud auth activate-service-account --key-file=/tmp/gcp-key.json
|
gcloud auth activate-service-account --key-file=/tmp/gcp-key.json
|
||||||
|
|||||||
@@ -34,26 +34,35 @@ jobs:
|
|||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -y gcc libcurl4-openssl-dev
|
apt-get install -y gcc libcurl4-openssl-dev
|
||||||
|
|
||||||
# Seed: use the committed linux-amd64 binary as the bootstrap
|
# Gen2: compile the bootstrap C source into a working elc binary
|
||||||
- name: Bootstrap from committed linux binary (seed)
|
- name: Build elc from bootstrap (gen2)
|
||||||
run: |
|
run: |
|
||||||
chmod +x dist/platform/elc-linux-amd64
|
# -Wl,--allow-multiple-definition: elc-bootstrap.c and el_runtime.c both define
|
||||||
echo "seed elc (committed linux-amd64 binary)"
|
# is_digit/is_whitespace; bootstrap predates the text-processing primitives commit
|
||||||
dist/platform/elc-linux-amd64 --version || true
|
|
||||||
|
|
||||||
# Gen2: use seed to self-host compile the El compiler
|
|
||||||
- name: Self-host compile El compiler (gen2)
|
|
||||||
run: |
|
|
||||||
mkdir -p dist/platform
|
|
||||||
dist/platform/elc-linux-amd64 elc-cli.el > dist/elc-gen2.c
|
|
||||||
gcc -O2 \
|
gcc -O2 \
|
||||||
-I el-compiler/runtime \
|
-I el-compiler/runtime \
|
||||||
dist/elc-gen2.c \
|
dist/elc-bootstrap.c \
|
||||||
el-compiler/runtime/el_runtime.c \
|
el-compiler/runtime/el_runtime.c \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm \
|
-lcurl -lpthread -lm \
|
||||||
|
-Wl,--allow-multiple-definition \
|
||||||
|
-o dist/elc-gen2
|
||||||
|
chmod +x dist/elc-gen2
|
||||||
|
echo "gen2 elc built"
|
||||||
|
dist/elc-gen2 --version || true
|
||||||
|
|
||||||
|
# Gen3: use gen2 to compile the El compiler from its own El source (self-host)
|
||||||
|
- name: Self-host compile El compiler with gen2 (gen3)
|
||||||
|
run: |
|
||||||
|
mkdir -p dist/platform
|
||||||
|
dist/elc-gen2 el-compiler/src/compiler.el > dist/elc-gen3.c
|
||||||
|
gcc -O2 \
|
||||||
|
-I el-compiler/runtime \
|
||||||
|
dist/elc-gen3.c \
|
||||||
|
el-compiler/runtime/el_runtime.c \
|
||||||
|
-lcurl -lpthread -lm \
|
||||||
-o dist/platform/elc
|
-o dist/platform/elc
|
||||||
chmod +x dist/platform/elc
|
chmod +x dist/platform/elc
|
||||||
echo "gen2 (self-hosted) elc built"
|
echo "gen3 (self-hosted) elc built"
|
||||||
dist/platform/elc --version || true
|
dist/platform/elc --version || true
|
||||||
|
|
||||||
# Build elb binary
|
# Build elb binary
|
||||||
@@ -65,7 +74,7 @@ jobs:
|
|||||||
-I el-compiler/runtime \
|
-I el-compiler/runtime \
|
||||||
dist/elb.c \
|
dist/elb.c \
|
||||||
el-compiler/runtime/el_runtime.c \
|
el-compiler/runtime/el_runtime.c \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm \
|
-lcurl -lpthread -lm \
|
||||||
-o dist/bin/elb
|
-o dist/bin/elb
|
||||||
chmod +x dist/bin/elb
|
chmod +x dist/bin/elb
|
||||||
echo "elb built"
|
echo "elb built"
|
||||||
@@ -78,7 +87,7 @@ jobs:
|
|||||||
-I el-compiler/runtime \
|
-I el-compiler/runtime \
|
||||||
dist/epm.c \
|
dist/epm.c \
|
||||||
el-compiler/runtime/el_runtime.c \
|
el-compiler/runtime/el_runtime.c \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm \
|
-lcurl -lpthread -lm \
|
||||||
-o dist/bin/epm
|
-o dist/bin/epm
|
||||||
chmod +x dist/bin/epm
|
chmod +x dist/bin/epm
|
||||||
echo "epm built"
|
echo "epm built"
|
||||||
@@ -91,7 +100,7 @@ jobs:
|
|||||||
-I el-compiler/runtime \
|
-I el-compiler/runtime \
|
||||||
dist/el-install.c \
|
dist/el-install.c \
|
||||||
el-compiler/runtime/el_runtime.c \
|
el-compiler/runtime/el_runtime.c \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm \
|
-lcurl -lpthread -lm \
|
||||||
-o dist/bin/el-install
|
-o dist/bin/el-install
|
||||||
chmod +x dist/bin/el-install
|
chmod +x dist/bin/el-install
|
||||||
echo "el-install built"
|
echo "el-install built"
|
||||||
@@ -128,7 +137,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c
|
"$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_core
|
-lcurl -lpthread -lm -o /tmp/el_native_core
|
||||||
/tmp/el_native_core
|
/tmp/el_native_core
|
||||||
|
|
||||||
- name: Run tests - native (text)
|
- name: Run tests - native (text)
|
||||||
@@ -138,7 +147,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c
|
"$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_text
|
-lcurl -lpthread -lm -o /tmp/el_native_text
|
||||||
/tmp/el_native_text
|
/tmp/el_native_text
|
||||||
|
|
||||||
- name: Run tests - native (string)
|
- name: Run tests - native (string)
|
||||||
@@ -148,7 +157,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c
|
"$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_string
|
-lcurl -lpthread -lm -o /tmp/el_native_string
|
||||||
/tmp/el_native_string
|
/tmp/el_native_string
|
||||||
|
|
||||||
- name: Run tests - native (math)
|
- name: Run tests - native (math)
|
||||||
@@ -158,7 +167,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c
|
"$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_math
|
-lcurl -lpthread -lm -o /tmp/el_native_math
|
||||||
/tmp/el_native_math
|
/tmp/el_native_math
|
||||||
|
|
||||||
- name: Run tests - native (state)
|
- name: Run tests - native (state)
|
||||||
@@ -168,7 +177,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c
|
"$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_state
|
-lcurl -lpthread -lm -o /tmp/el_native_state
|
||||||
/tmp/el_native_state
|
/tmp/el_native_state
|
||||||
|
|
||||||
- name: Run tests - native (time)
|
- name: Run tests - native (time)
|
||||||
@@ -178,7 +187,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c
|
"$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_time
|
-lcurl -lpthread -lm -o /tmp/el_native_time
|
||||||
/tmp/el_native_time
|
/tmp/el_native_time
|
||||||
|
|
||||||
- name: Run tests - native (json)
|
- name: Run tests - native (json)
|
||||||
@@ -188,7 +197,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c
|
"$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_json
|
-lcurl -lpthread -lm -o /tmp/el_native_json
|
||||||
/tmp/el_native_json
|
/tmp/el_native_json
|
||||||
|
|
||||||
- name: Run tests - native (env)
|
- name: Run tests - native (env)
|
||||||
@@ -198,7 +207,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c
|
"$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_env
|
-lcurl -lpthread -lm -o /tmp/el_native_env
|
||||||
/tmp/el_native_env
|
/tmp/el_native_env
|
||||||
|
|
||||||
- name: Run tests - native (fs)
|
- name: Run tests - native (fs)
|
||||||
@@ -208,7 +217,7 @@ jobs:
|
|||||||
RUNTIME="$(pwd)/el-compiler/runtime"
|
RUNTIME="$(pwd)/el-compiler/runtime"
|
||||||
"$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c
|
"$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c
|
||||||
gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \
|
gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs
|
-lcurl -lpthread -lm -o /tmp/el_native_fs
|
||||||
/tmp/el_native_fs
|
/tmp/el_native_fs
|
||||||
|
|
||||||
# Bundle the SDK tarball - runs from the repo root to reference lang/ paths correctly
|
# Bundle the SDK tarball - runs from the repo root to reference lang/ paths correctly
|
||||||
@@ -294,7 +303,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${GCP_SA_KEY}" > /tmp/gcp-key.json
|
echo "${GCP_SA_KEY}" > /tmp/gcp-key.json
|
||||||
apt-get install -y -qq apt-transport-https ca-certificates gnupg curl
|
apt-get install -y -qq apt-transport-https ca-certificates gnupg curl
|
||||||
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg -o /usr/share/keyrings/cloud.google.gpg
|
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
|
||||||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list
|
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||||
apt-get update -qq && apt-get install -y google-cloud-cli
|
apt-get update -qq && apt-get install -y google-cloud-cli
|
||||||
gcloud auth activate-service-account --key-file=/tmp/gcp-key.json
|
gcloud auth activate-service-account --key-file=/tmp/gcp-key.json
|
||||||
|
|||||||
@@ -4999,13 +4999,7 @@ el_val_t state_get_or(el_val_t key, el_val_t default_val) {
|
|||||||
|
|
||||||
el_val_t float_to_str(el_val_t f) {
|
el_val_t float_to_str(el_val_t f) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
double v = el_to_float(f);
|
snprintf(buf, sizeof(buf), "%g", el_to_float(f));
|
||||||
/* Normalize NaN to "nan" regardless of sign — platform-independent. */
|
|
||||||
if (isnan(v)) {
|
|
||||||
snprintf(buf, sizeof(buf), "nan");
|
|
||||||
} else {
|
|
||||||
snprintf(buf, sizeof(buf), "%g", v);
|
|
||||||
}
|
|
||||||
return el_wrap_str(el_strdup(buf));
|
return el_wrap_str(el_strdup(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ run_runtime_case() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o "${out_bin}" 2>/tmp/cal_test.cc.err; then
|
-lcurl -lpthread -o "${out_bin}" 2>/tmp/cal_test.cc.err; then
|
||||||
echo "FAIL ${name} — cc failed:"
|
echo "FAIL ${name} — cc failed:"
|
||||||
cat /tmp/cal_test.cc.err | sed 's/^/ /'
|
cat /tmp/cal_test.cc.err | sed 's/^/ /'
|
||||||
FAIL=$((FAIL+1))
|
FAIL=$((FAIL+1))
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ echo "==> Compiling runner.el via ${ELC}"
|
|||||||
|
|
||||||
echo "==> Linking against ${RUNTIME_DIR}/el_runtime.c"
|
echo "==> Linking against ${RUNTIME_DIR}/el_runtime.c"
|
||||||
cc -O2 -I "${RUNTIME_DIR}" "${OUT_C}" "${RUNTIME_DIR}/el_runtime.c" \
|
cc -O2 -I "${RUNTIME_DIR}" "${OUT_C}" "${RUNTIME_DIR}/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o "${OUT_BIN}"
|
-lcurl -lpthread -o "${OUT_BIN}"
|
||||||
|
|
||||||
echo "==> Running"
|
echo "==> Running"
|
||||||
"${OUT_BIN}"
|
"${OUT_BIN}"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ run_runtime_case() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o "${out_bin}" 2>/tmp/text_test.cc.err; then
|
-lcurl -lpthread -o "${out_bin}" 2>/tmp/text_test.cc.err; then
|
||||||
echo "FAIL ${name} — cc failed:"
|
echo "FAIL ${name} — cc failed:"
|
||||||
cat /tmp/text_test.cc.err | sed 's/^/ /'
|
cat /tmp/text_test.cc.err | sed 's/^/ /'
|
||||||
FAIL=$((FAIL+1))
|
FAIL=$((FAIL+1))
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ run_runtime_case() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o "${out_bin}" 2>/tmp/time_test.cc.err; then
|
-lcurl -lpthread -o "${out_bin}" 2>/tmp/time_test.cc.err; then
|
||||||
echo "FAIL ${name} — cc failed:"
|
echo "FAIL ${name} — cc failed:"
|
||||||
cat /tmp/time_test.cc.err | sed 's/^/ /'
|
cat /tmp/time_test.cc.err | sed 's/^/ /'
|
||||||
FAIL=$((FAIL+1))
|
FAIL=$((FAIL+1))
|
||||||
@@ -116,7 +116,7 @@ run_typeerror_case() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
if cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \
|
||||||
-lcurl -lssl -lcrypto -lpthread -lm -o /tmp/time_test_should_not_link 2>/tmp/time_test.cc.err; then
|
-lcurl -lpthread -o /tmp/time_test_should_not_link 2>/tmp/time_test.cc.err; then
|
||||||
echo "FAIL ${name} — cc unexpectedly succeeded; type rule did not fire"
|
echo "FAIL ${name} — cc unexpectedly succeeded; type rule did not fire"
|
||||||
FAIL=$((FAIL+1))
|
FAIL=$((FAIL+1))
|
||||||
FAILED_NAMES+=("${name}")
|
FAILED_NAMES+=("${name}")
|
||||||
|
|||||||
Reference in New Issue
Block a user