From d37eda4e9b7ed02659dd3c2cc05b4f9a8b5ce825 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 25 Jul 2020 13:23:57 -0500 Subject: [PATCH 1/3] Don't use x43bot to test install. --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 1e3f49ed..4432ef97 100644 --- a/Makefile +++ b/Makefile @@ -317,7 +317,6 @@ test-install: cd test/install && jpm --verbose --test --modpath=./modpath install https://github.com/janet-lang/jhydro.git cd test/install && jpm --verbose --test --modpath=./modpath install https://github.com/janet-lang/path.git cd test/install && jpm --verbose --test --modpath=./modpath install https://github.com/janet-lang/argparse.git - cd test/install && jpm --verbose --modpath=./modpath install https://github.com/bakpakin/x43bot.git help: @echo From ba08e487cb445663fb8d27db42654265614ae75f Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 25 Jul 2020 13:34:40 -0500 Subject: [PATCH 2/3] Disable PRF by default. Since it is not any better by default without initializing the key, we disable it by default. It can be turned on with JANET_PRF in janetconf.h. --- meson.build | 2 +- meson_options.txt | 2 +- src/conf/janetconf.h | 2 +- src/core/net.c | 3 ++- src/core/util.c | 2 +- src/include/janet.h | 2 +- test/suite4.janet | 4 +++- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index b2518693..78276551 100644 --- a/meson.build +++ b/meson.build @@ -63,7 +63,7 @@ conf.set('JANET_NO_NET', not get_option('net')) conf.set('JANET_REDUCED_OS', get_option('reduced_os')) conf.set('JANET_NO_TYPED_ARRAY', not get_option('typed_array')) conf.set('JANET_NO_INT_TYPES', not get_option('int_types')) -conf.set('JANET_NO_PRF', not get_option('prf')) +conf.set('JANET_PRF', get_option('prf')) conf.set('JANET_RECURSION_GUARD', get_option('recursion_guard')) conf.set('JANET_MAX_PROTO_DEPTH', get_option('max_proto_depth')) conf.set('JANET_MAX_MACRO_EXPAND', get_option('max_macro_expand')) diff --git a/meson_options.txt b/meson_options.txt index bfc8925f..eb068126 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,7 +10,7 @@ option('assembler', type : 'boolean', value : true) option('peg', type : 'boolean', value : true) option('typed_array', type : 'boolean', value : true) option('int_types', type : 'boolean', value : true) -option('prf', type : 'boolean', value : true) +option('prf', type : 'boolean', value : false) option('net', type : 'boolean', value : true) option('processes', type : 'boolean', value : true) option('umask', type : 'boolean', value : true) diff --git a/src/conf/janetconf.h b/src/conf/janetconf.h index 39a79f50..0f97e9d8 100644 --- a/src/conf/janetconf.h +++ b/src/conf/janetconf.h @@ -57,7 +57,7 @@ /* #define JANET_NO_UMASK */ /* Other settings */ -/* #define JANET_NO_PRF */ +/* #define JANET_PRF */ /* #define JANET_NO_UTC_MKTIME */ /* #define JANET_OUT_OF_MEMORY do { printf("janet out of memory\n"); exit(1); } while (0) */ /* #define JANET_EXIT(msg) do { printf("C assert failed executing janet: %s\n", msg); exit(1); } while (0) */ diff --git a/src/core/net.c b/src/core/net.c index 6d9ab81d..29a49883 100644 --- a/src/core/net.c +++ b/src/core/net.c @@ -566,7 +566,8 @@ static Janet cfun_net_server(int32_t argc, Janet *argv) { } /* Put sfd on our loop */ - JanetLoopFD lfd = {0}; + JanetLoopFD lfd; + memset(&lfd, 0, sizeof(lfd)); lfd.stream = make_stream(sfd, 0); lfd.event_type = JLE_READ_ACCEPT; lfd.data.read_accept.handler = fun; diff --git a/src/core/util.c b/src/core/util.c index d4af5667..31855c8f 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -97,7 +97,7 @@ const char *const janet_status_names[16] = { "alive" }; -#ifdef JANET_NO_PRF +#ifndef JANET_PRF int32_t janet_string_calchash(const uint8_t *str, int32_t len) { const uint8_t *end = str + len; diff --git a/src/include/janet.h b/src/include/janet.h index 05fd8a0f..72202b18 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -1381,7 +1381,7 @@ JANET_API int janet_verify(JanetFuncDef *def); JANET_API JanetBuffer *janet_pretty(JanetBuffer *buffer, int depth, int flags, Janet x); /* Misc */ -#ifndef JANET_NO_PRF +#ifdef JANET_PRF #define JANET_HASH_KEY_SIZE 16 JANET_API void janet_init_hash_key(uint8_t key[JANET_HASH_KEY_SIZE]); #endif diff --git a/test/suite4.janet b/test/suite4.janet index 3b20de96..5a046f52 100644 --- a/test/suite4.janet +++ b/test/suite4.janet @@ -48,7 +48,9 @@ (defn check-image "Run a marshaling test using the make-image and load-image functions." [x msg] - (assert-no-error msg (load-image (make-image x)))) + (def im (make-image x)) + (printf "\nimage-hash: %d" (-> im string hash)) + (assert-no-error msg (load-image im))) (check-image (fn [] (fn [] 1)) "marshal nested functions") (check-image (fiber/new (fn [] (fn [] 1))) "marshal nested functions in fiber") From 4cc680965cdc3c18d9d903766078f4ca79343c12 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 25 Jul 2020 13:47:54 -0500 Subject: [PATCH 3/3] Prepare for 1.11.1 release. --- CHANGELOG.md | 4 +++- src/conf/janetconf.h | 4 ++-- test/suite4.janet | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 184e826b..ed5c83d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ # Changelog All notable changes to this project will be documented in this file. -## ??? - Unreleased +## 1.11.1 - 2020-07-25 - Fix jpm and git with multiple git installs on Windows - Fix importing a .so file in the current directory - Allow passing byte sequence types directly to typed-array constructors. - Fix bug sending files between threads. +- Disable PRF by default. +- Update the soname. ## 1.11.0 - 2020-07-18 - Add `forever` macro. diff --git a/src/conf/janetconf.h b/src/conf/janetconf.h index 0f97e9d8..9d22b384 100644 --- a/src/conf/janetconf.h +++ b/src/conf/janetconf.h @@ -29,8 +29,8 @@ #define JANET_VERSION_MAJOR 1 #define JANET_VERSION_MINOR 11 #define JANET_VERSION_PATCH 1 -#define JANET_VERSION_EXTRA "-dev" -#define JANET_VERSION "1.11.1-dev" +#define JANET_VERSION_EXTRA "" +#define JANET_VERSION "1.11.1" /* #define JANET_BUILD "local" */ diff --git a/test/suite4.janet b/test/suite4.janet index 5a046f52..208f7cc4 100644 --- a/test/suite4.janet +++ b/test/suite4.janet @@ -49,7 +49,7 @@ "Run a marshaling test using the make-image and load-image functions." [x msg] (def im (make-image x)) - (printf "\nimage-hash: %d" (-> im string hash)) + # (printf "\nimage-hash: %d" (-> im string hash)) (assert-no-error msg (load-image im))) (check-image (fn [] (fn [] 1)) "marshal nested functions")