Skip to content

Commit da3fe88

Browse files
committed
Build: simplified the nest and improved the CI test
1 parent 2268daf commit da3fe88

6 files changed

+66
-80
lines changed

.github/workflows/main.yml

+4-18
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ jobs:
2323
uses: oldes/install-siskin@v0.17.0
2424

2525
- name: Build 64bit Rebol SQLite extension
26-
run: ./siskin Rebol-SQLite.nest --msvc %sqlite-windows-x64
27-
28-
- name: Prepare 64bit Rebol SQLite extension
29-
run: COPY .\msvc\Release-x64\sqlite-windows-x64.dll sqlite-windows-x64.rebx
26+
run: ./siskin Rebol-SQLite.nest --msvc -o sqlite-windows-x64.rebx sqlite-x64
3027

3128
- name: Install Rebol for extension test
3229
uses: oldes/install-rebol@v3.17.0
@@ -58,18 +55,10 @@ jobs:
5855
uses: oldes/install-siskin@v0.17.0
5956

6057
# - name: Build 32bit Rebol SQLite extension
61-
# run: ./siskin Rebol-SQLite.nest [%sqlite-linux-x86]
58+
# run: ./siskin Rebol-SQLite.nest -o sqlite-linux-x86.rebx sqlite-x86
6259

6360
- name: Build 64bit Rebol SQLite extension
64-
run: ./siskin Rebol-SQLite.nest %sqlite-linux-x64
65-
66-
# - name: Prepare 32bit Rebol SQLite extension
67-
# run: |
68-
# mv .\build\sqlite-linux-x86.so sqlite-linux-x86.rebx
69-
# gzip -9 ./sqlite-linux-x86.rebx
70-
71-
- name: Prepare 64bit Rebol SQLite extension
72-
run: mv ./build/sqlite-linux-x64.so sqlite-linux-x64.rebx
61+
run: ./siskin Rebol-SQLite.nest -o sqlite-linux-x64.rebx sqlite-x64
7362

7463
- name: Install Rebol for extension test
7564
uses: oldes/install-rebol@v3.17.0
@@ -95,10 +84,7 @@ jobs:
9584
uses: oldes/install-siskin@v0.17.0
9685

9786
- name: Build 64bit Rebol SQLite extension
98-
run: ./siskin Rebol-SQLite.nest %sqlite-macos-x64
99-
100-
- name: Prepare 64bit Rebol SQLite extension
101-
run: mv ./build/sqlite-macos-x64.dylib sqlite-macos-x64.rebx
87+
run: ./siskin Rebol-SQLite.nest -o sqlite-macos-x64.rebx sqlite-x64
10288

10389
- name: Install Rebol for extension test
10490
uses: oldes/install-rebol@v3.17.0

Rebol-SQLite.nest

+19-49
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ version: 3.46.0
1111
#if Windows? [ define: TO_WINDOWS define: _CRT_SECURE_NO_WARNINGS upx: on]
1212
#if macOS? [ define: TO_OSX define: HAS_BOOL]
1313
#if Linux? [ define: TO_LINUX ]
14+
#if BSD? [ compiler: clang ]
1415

1516
target-x86: [
1617
arch: x86
@@ -25,13 +26,15 @@ target-x64: [
2526
]
2627
#if Windows? [ defines: [ TO_WIN32_X64 _WIN32 ] ]
2728
#if Linux? [ defines: [ TO_LINUX_X64 ] ]
28-
#if macOS? [ defines: [ TO_OSX_X64 ] flags: ["-arch x86_64"] ]
29+
#if macOS? [ defines: [ TO_OSX_X64 ] flags: "-arch x86_64" ]
2930
]
3031

3132
target-arm64: [
3233
arch: arm64
33-
;flags: ["-arch arm64"]
34-
flags: "-target arm64-apple-darwin"
34+
;flags: "-arch arm64"
35+
#if macOS? [
36+
flags: "-target arm64-apple-darwin"
37+
]
3538
define: _FILE_OFFSET_BITS=64
3639
define: __LP64__ ; has long (integer) 64 bits
3740
define: __arm64__
@@ -75,53 +78,20 @@ r3-extension: [
7578
do %src/sqlite-rebol-extension.r3
7679
]
7780

78-
eggs: only [
79-
#if Windows? [
80-
"Rebol sqlite extension: win32_x86" [
81-
name: %sqlite-windows-x86
82-
:r3-extension
83-
:target-x86
84-
]
85-
"Rebol sqlite extension: win32_x64" [
86-
name: %sqlite-windows-x64
87-
:r3-extension
88-
:target-x64
89-
]
90-
]
91-
#if macOS? [
92-
"Rebol sqlite extension: osx_x64" [
93-
name: %sqlite-macos-x64
94-
:r3-extension
95-
:target-x64
96-
]
97-
"Rebol sqlite extension: osx_arm64" [
98-
name: %sqlite-macos-arm64
99-
:r3-extension
100-
:target-arm64
101-
]
81+
eggs: [
82+
"Rebol sqlite extension: x86" [
83+
name: %sqlite-x86
84+
:r3-extension
85+
:target-x86
10286
]
103-
#if Linux? [
104-
"Rebol sqlite extension: linux_x86" [
105-
name: %sqlite-linux-x86
106-
:r3-extension
107-
:target-x86
108-
]
109-
"Rebol sqlite extension: linux_x64" [
110-
name: %sqlite-linux-x64
111-
:r3-extension
112-
:target-x64
113-
]
87+
"Rebol sqlite extension: x64" [
88+
name: %sqlite-x64
89+
:r3-extension
90+
:target-x64
11491
]
115-
#if (system/platform = 'Haiku) [
116-
"Rebol sqlite extension: haiku_x86" [
117-
name: %sqlite-haiku-x86.rebx
118-
:r3-extension
119-
:target-x86
120-
]
121-
"Rebol sqlite extension: haiku_x64" [
122-
name: %sqlite-haiku-x64.rebx
123-
:r3-extension
124-
:target-x64
125-
]
92+
"Rebol sqlite extension: arm64" [
93+
name: %sqlite-arm64
94+
:r3-extension
95+
:target-arm64
12696
]
12797
]

ci-test.r3

+19-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,25 @@ Rebol [
33
needs: 3.13.1 ;; using system/options/modules as extension location
44
]
55

6-
print "Trying to import SQLite extension..."
7-
;; In the GitHub Actions, the built extension is copied into the current directory.
8-
unless empty? read %sqlite*.rebx [
9-
;; make sure that we load a fresh extension
6+
print ["Running test on Rebol build:" mold to-block system/build]
7+
8+
system/options/quiet: false
9+
system/options/log/rebol: 4
10+
11+
if CI?: any [
12+
"true" = get-env "CI"
13+
"true" = get-env "GITHUB_ACTIONS"
14+
"true" = get-env "TRAVIS"
15+
"true" = get-env "CIRCLECI"
16+
"true" = get-env "GITLAB_CI"
17+
][
18+
;; configure modules location for the CI test
19+
system/options/modules: dirize to-rebol-file any [
20+
get-env 'REBOL_MODULES_DIR
21+
what-dir
22+
]
23+
;; make sure that we load a fresh extension
1024
try [system/modules/sqlite: none]
11-
;; use current directory as a modules location
12-
system/options/modules: what-dir
1325
]
1426

1527
sqlite: import 'sqlite
@@ -194,7 +206,7 @@ print-horizontal-line
194206
print as-yellow "SQLITE SCHEME TESTS"
195207
print-horizontal-line
196208

197-
import %sqlite-scheme.reb
209+
import 'sqlite-scheme
198210

199211
if exists? %chinook.db [
200212
db: open/new sqlite:chinook.db

sqlite-scheme.reb

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ Rebol [
44
note: {This is just an initial proof of concept}
55
version: 0.1.0
66
author: "Oldes"
7-
needs: 3.13.1 ;; using system/options/modules as extension location
7+
needs: [
8+
3.13.1 ;; using system/options/modules as extension location
9+
sqlite
10+
]
811
]
912

1013
sys/make-scheme [

src/sqlite-commands-table.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
// ____ __ __ ______ __
2+
// / __ \/ /__/ /__ ___ /_ __/__ ____/ /
3+
// / /_/ / / _ / -_|_-<_ / / / -_) __/ _ \
4+
// \____/_/\_,_/\__/___(@)_/ \__/\__/_// /
5+
// ~~~ oldes.huhuman at gmail.com ~~~ /_/
16
//
2-
// auto-generated file, do not modify!
3-
//
7+
// Project: Rebol/SQLite extension
8+
// SPDX-License-Identifier: MIT
9+
// =============================================================================
10+
// NOTE: auto-generated file, do not modify!
11+
412
#include "sqlite-rebol-extension.h"
513
MyCommandPointer Command[] = {
614
cmd_sqlite_info,

src/sqlite-rebol-extension.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
// ____ __ __ ______ __
2+
// / __ \/ /__/ /__ ___ /_ __/__ ____/ /
3+
// / /_/ / / _ / -_|_-<_ / / / -_) __/ _ \
4+
// \____/_/\_,_/\__/___(@)_/ \__/\__/_// /
5+
// ~~~ oldes.huhuman at gmail.com ~~~ /_/
16
//
2-
// Rebol/SQLite extension
3-
// auto-generated file, do not modify! //
7+
// Project: Rebol/SQLite extension
8+
// SPDX-License-Identifier: MIT
9+
// =============================================================================
10+
// NOTE: auto-generated file, do not modify!
411

512
#include "sqlite-command.h"
613

@@ -52,7 +59,7 @@ int cmd_sqlite_shutdown(RXIFRM *frm, void *ctx);
5259
typedef int (*MyCommandPointer)(RXIFRM *frm, void *ctx);
5360

5461
#define EXT_SQLITE_INIT_CODE \
55-
"REBOL [Title: \"Rebol SQLite Extension\" Name: sqlite Type: module Exports: [] Version: 3.44.2.0 Author: Oldes Date: 4-Jun-2024/14:25:37+2:00 License: Apache-2.0 Url: https://github.com/Siskin-framework/Rebol-SQLite]\n"\
62+
"REBOL [Title: \"Rebol SQLite Extension\" Name: sqlite Type: module Exports: [] Version: 3.46.0.0 Needs: 3.13.1 Author: Oldes Date: 17-Jul-2024/20:51:34 License: MIT Url: https://github.com/Siskin-framework/Rebol-SQLite]\n"\
5663
"info: command [\"Returns info about SQLite extension library\" /of handle [handle!] \"SQLite Extension handle\"]\n"\
5764
"open: command [\"Opens a new database connection\" file [file!]]\n"\
5865
"exec: command [{Runs zero or more semicolon-separate SQL statements} db [handle!] \"sqlite-db\" sql [string!] \"statements\"]\n"\

0 commit comments

Comments
 (0)