push:
branches:
- master
- - dev
pull_request:
branches:
- master
os: ubuntu-latest
runtime_library: ':libwasmer.a'
artifact_name: 'onyx-linux-wasmer-amd64'
+ - build: linux-amd64
+ os: ubuntu-latest
+ runtime_library: none
+ artifact_name: 'onyx-linux-none-amd64'
- build: windows-amd64
os: windows-latest
artifact_name: 'onyx-windows-amd64'
uses: ilammy/msvc-dev-cmd@v1
- name: Build Onyx for ${{ matrix.build }}
- if: matrix.build == 'linux-amd64'
+ if: (matrix.build == 'linux-amd64') && (matrix.runtime_library != 'none')
run: |
./build.sh compile package
env:
ONYX_INCLUDE_DIR: ../shared/include
ONYX_LIBRARY_DIR: ${{ env.ONYX_LIBRARY_DIR }}
ONYX_USE_DYNCALL: '1'
+
+ - name: Build Onyx for ${{ matrix.build }}
+ if: (matrix.build == 'linux-amd64') && (matrix.runtime_library == 'none')
+ run: |
+ ./build.sh compile package
+ env:
+ ONYX_CC: gcc
+ ONYX_ARCH: x86_64
+ ONYX_INCLUDE_DIR: ../shared/include
- name: Build Onyx for ${{ matrix.build }}
if: matrix.build == 'windows-amd64'
Context context;
-#define DOCSTRING_HEADER "Onyx toolchain version " VERSION "\n" \
+#define VERSION_STRING "Onyx toolchain version " VERSION "\n" \
+ "Built on " __TIMESTAMP__ "\n"
+
+#define DOCSTRING_HEADER VERSION_STRING \
"\n" \
"The toolchain for the Onyx programming language, created by Brendan Hansen.\n" \
"\n"
-
static const char* top_level_docstring = DOCSTRING_HEADER
"Usage:\n"
"\tonyx <subcommand>\n"
#endif
"\tcheck Checks syntax and types of an Onyx program.\n"
"\twatch Continuously rebuilds an Onyx program on file changes.\n"
- "\tpackage Package manager\n";
+ "\tpackage Package manager\n"
+ "\tversion Prints version information\n";
// "\tdoc <input files>\n"
static const char *build_docstring = DOCSTRING_HEADER
core_installation = getenv("ONYX_PATH");
#endif
#ifdef _BH_WINDOWS
- core_installation = bh_alloc_array(alloc, u8, 512);
- GetEnvironmentVariableA("ONYX_PATH", core_installation, 512);
+ char *tmp_core_installation = bh_alloc_array(alloc, u8, 512);
+ if (GetEnvironmentVariableA("ONYX_PATH", tmp_core_installation, 512) > 0) {
+ core_installation = tmp_core_installation;
+ }
#endif
if (core_installation == NULL) {
options.action = ONYX_COMPILE_ACTION_PRINT_HELP;
options.help_subcommand = argc > 2 ? argv[2] : NULL;
}
+ else if (!strcmp(argv[1], "version")) {
+ options.action = ONYX_COMPILE_ACTION_PRINT_VERSION;
+ goto skip_parsing_arguments;
+ }
else if (!strcmp(argv[1], "compile") || !strcmp(argv[1], "build")) {
options.action = ONYX_COMPILE_ACTION_COMPILE;
arg_parse_start = 2;
return 1;
}
+ case ONYX_COMPILE_ACTION_PRINT_VERSION: {
+ bh_printf(VERSION_STRING);
+ return 0;
+ }
+
case ONYX_COMPILE_ACTION_CHECK:
compiler_progress = do_compilation(&compile_opts);
break;
ONYX_DEF(__futex_wait, (WASM_PTR, WASM_I32, WASM_I32), (WASM_I32)) {
int *addr = ONYX_PTR(params->data[0].of.i32);
- #if defined(_BH_LINUX) || defined(_BH_DARWIN)
+ #if defined(_BH_LINUX)
struct timespec delay;
struct timespec *t = NULL;
ONYX_DEF(__futex_wake, (WASM_PTR, WASM_I32), (WASM_I32)) {
int *addr = ONYX_PTR(params->data[0].of.i32);
- #if defined(_BH_LINUX) || defined(_BH_DARWIN)
+ #if defined(_BH_LINUX)
int res = syscall(SYS_futex, addr, FUTEX_WAKE, params->data[1].of.i32, NULL, NULL, 0);
results->data[0] = WASM_I32_VAL(res);