Skip to content

Commit

Permalink
Merge pull request #2200 from svaarala/v2.5.0-release-prep
Browse files Browse the repository at this point in the history
Release preparations for 2.5.0 release
  • Loading branch information
svaarala authored Nov 23, 2019
2 parents 44ca54f + 1fd2171 commit 6001888
Show file tree
Hide file tree
Showing 70 changed files with 369 additions and 206 deletions.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ test: apitest ecmatest

# Set of miscellaneous tests for release.
.PHONY: releasetest
releasetest: configuretest xmldoctest closuretest bluebirdtest luajstest jsinterpretertest lodashtest underscoretest emscriptenluatest emscriptenduktest emscripteninceptiontest emscriptenmandeltest emscriptentest errorinjecttest
releasetest: configuretest xmldoctest closuretest bluebirdtest luajstest jsinterpretertest lodashtest underscoretest emscriptenluatest emscriptenduktest emscriptenmandeltest emscriptentest errorinjecttest
@echo ""
@echo "### Release tests successful!" # These tests now have output checks.

Expand Down Expand Up @@ -1183,6 +1183,7 @@ docker-images-x64: docker-prepare
docker build -t duktape-site-ubuntu-18.04-x64 docker/duktape-site-ubuntu-18.04-x64
docker build -t duktape-duk-ubuntu-18.04-x64 docker/duktape-duk-ubuntu-18.04-x64
docker build -t duktape-shell-ubuntu-18.04-x64 docker/duktape-shell-ubuntu-18.04-x64
docker build -t duktape-release-1-ubuntu-18.04-x64 docker/duktape-release-1-ubuntu-18.04-x64

.PHONY: docker-images-s390x
docker-images-s390x: docker-prepare
Expand All @@ -1196,6 +1197,7 @@ docker-images: docker-images-x64
docker-clean:
-rm -f docker/*/gitconfig docker/*/prepare_repo.sh
-docker rmi \
duktape-release-1-ubuntu-18.04-x64:latest \
duktape-shell-ubuntu-18.04-x64:latest \
duktape-duk-ubuntu-18.04-x64:latest \
duktape-site-ubuntu-18.04-x64:latest \
Expand Down Expand Up @@ -1262,3 +1264,10 @@ docker-shell-wd:
.PHONY: docker-shell-wdmount
docker-shell-wdmount:
docker run -v $(shell pwd):/work/duktape --rm -ti duktape-shell-ubuntu-18.04-x64

.PHONY: docker-release-1-wd
docker-release-1-wd:
rm -f docker-input.zip docker-output.zip
#git archive --format zip --output docker-input.zip HEAD
zip -1 -q -r docker-input.zip .
docker run --rm -i -e STDIN_ZIP=1 duktape-release-1-ubuntu-18.04-x64 < docker-input.zip
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ These are also **intended for Linux only**. For example:
# shell running in the container.
$ make docker-shell-wdmount

# For non-native images you may need:
# https://github.com/multiarch/qemu-user-static

Branch policy
-------------

Expand Down
8 changes: 4 additions & 4 deletions RELEASES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3540,10 +3540,7 @@ Miscellaneous:

* Various portability fixes (GH-1931, GH-1976)

Planned
=======

2.5.0 (XXXX-XX-XX)
2.5.0 (2019-11-24)
------------------

* Rename the 'global' binding to 'globalThis' to match updated
Expand Down Expand Up @@ -3582,6 +3579,9 @@ Planned

* Minor performance and footprint improvements (GH-2167, GH-2177)

Planned
=======

3.0.0 (XXXX-XX-XX)
------------------

Expand Down
18 changes: 4 additions & 14 deletions doc/release-checklist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,19 @@ Checklist for ordinary releases

- Must add all new API calls

* Run ``make docker-release-1-wd``

- Check output manually

* Compilation tests:

- Clean compile for command line tool with (a) no options and (b) common
debug options (DUK_USE_DEBUG, DUK_USE_DEBUG_LEVEL=0, DUK_USE_DEBUG_PRINT=...,
DUK_USE_SELF_TESTS, DUK_USE_ASSERTIONS)

- Compile both from ``src`` and ``src-separate``.

- Run ``mandel.js`` to test the the command line tool works.

- Check that ``duk_tval`` is packed by default on x86 and unpacked on
x64

- util/checklist_compile_test.sh: linux compiler/arch combinations,
run in dist, check output manually

- Platform / compiler combinations (incomplete, should be automated):

+ FreeBSD clang
Expand All @@ -83,15 +80,8 @@ Checklist for ordinary releases

+ Linux SH4 gcc

- Check ``make duk-clang``, covers ``-Wcast-align``

- Check compile warnings when DUK_NORETURN() is not defined

* Test configure.py manually using metadata from the distributable

- Ensure that Duktape compiles with e.g. ``-DDUK_USE_FASTINT`` configure
argument

* duk-sanitize-clang:

- Run::
Expand Down
11 changes: 10 additions & 1 deletion doc/release-notes-v2-5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ Main changes in this release (see RELEASES.rst for full details):
(duk_cbor_encode(), duk_cbor_decode()) and ECMAScript API (CBOR.encode(),
CBOR.decode()) are enabled by default.

* TBD.
* Add duk_pull() API call.

* Add "globalThis" binding, enabled by default. This replaces the previous
"global" binding (which was disabled by default) to match the revised
"global" specification.

* Various fixes and portability improvements.

Upgrading from Duktape 2.4
==========================
Expand All @@ -23,3 +29,6 @@ from Duktape v2.4.x. Note the following:
``DUK_USE_CBOR_SUPPORT`` and ``DUK_USE_CBOR_BUILTIN`` config options.
If you're using the CBOR extra, you should migrate to the built-in CBOR
support.

* ``globalThis`` binding is now enabled by default; it can be disabled
by disabling the ``DUK_USE_GLOBAL_BINDING`` config option.
6 changes: 6 additions & 0 deletions docker/duktape-release-1-ubuntu-18.04-x64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM duktape-base-ubuntu-18.04-x64:latest

COPY --chown=duktape:duktape run.sh .
RUN chmod 755 run.sh

CMD /work/run.sh
138 changes: 138 additions & 0 deletions docker/duktape-release-1-ubuntu-18.04-x64/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#!/bin/bash

set -e
set -x

/work/prepare_repo.sh

source emsdk/emsdk_env.sh

cd duktape
ROOT=`pwd`

test_combined_source_compilation() {
make clean dist
cd dist
cat Makefile.cmdline
rm -rf src-separate
make -f Makefile.cmdline
ls -l duk; size duk
./duk mandel.js > /tmp/out.txt
cat /tmp/out.txt
if [ `md5sum /tmp/out.txt | cut -f 1 -d ' '` != "627cd86f0a4255e018c564f86c6d0ab3" ]; then
echo "Combined source compilation failed!"
exit 1
fi
}

test_separate_source_compilation() {
make clean dist
cd dist
sed -i 's/DUKTAPE_SOURCES = src\/duktape.c/DUKTAPE_SOURCES = src-separate\/*.c/' Makefile.cmdline
sed -i 's/-I.\/src/-I.\/src-separate/' Makefile.cmdline
cat Makefile.cmdline
rm -rf src
make -f Makefile.cmdline
ls -l duk; size duk
./duk mandel.js > /tmp/out.txt
cat /tmp/out.txt
if [ `md5sum /tmp/out.txt | cut -f 1 -d ' '` != "627cd86f0a4255e018c564f86c6d0ab3" ]; then
echo "Combined source compilation failed!"
exit 1
fi
}

test_clang_compilation() {
make clean duk-clang
}

test_gxx_compilation() {
make clean duk-g++
make clean dukd-g++
}

test_misc_compilation() {
make clean duk-rom
make clean duk-low
make clean duk-low-norefc
make clean duk-low-rom
make clean duk-perf
make clean duk-size
make clean duk-pgo.O2
make clean dukd
make clean dukd-rom
make clean dukd-low
make clean dukd-low-norefc
make clean dukd-low-rom
}

test_configure_fastint() {
make clean dist
cd dist
rm -rf /tmp/out
python tools/configure.py -DDUK_USE_FASTINT --output-directory /tmp/out
ls -l /tmp/out
}

test_releasetest() {
make clean
make releasetest
}

test_checklist_compile_test() {
make clean dist
cd dist
bash ../util/checklist_compile_test.sh
}

echo ""
echo "*** Test compilation from combined sources"
echo ""
cd $ROOT
test_combined_source_compilation

echo ""
echo "*** Test compilation from separate sources"
echo ""
cd $ROOT
test_separate_source_compilation

echo ""
echo "*** Test clang compilation (duk-clang)"
echo ""
cd $ROOT
test_clang_compilation

echo ""
echo "*** Test C++ compilation (duk-g++)"
echo ""
cd $ROOT
test_gxx_compilation

echo ""
echo "*** Test misc compilation targets (duk-low, etc)"
echo ""
cd $ROOT
test_misc_compilation

echo ""
echo "*** Test configure.py -DDUK_USE_FASTINT"
echo ""
cd $ROOT
test_configure_fastint

echo ""
echo "*** Test make releasetest"
echo ""
cd $ROOT
test_releasetest

echo ""
echo "*** Test checklist_compile_test.sh"
echo ""
cd $ROOT
test_checklist_compile_test

echo ""
echo "*** All done!"
echo ""
1 change: 1 addition & 0 deletions src-input/builtins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,7 @@ objects:
setter_magic: 0
attributes: "c"
duktape: true
# XXX: columnNumber

- key: "toString"
value:
Expand Down
2 changes: 1 addition & 1 deletion src-input/duk_api_bytecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p,

DUK_ASSERT(thr != NULL);

DUK_DD(DUK_DDPRINT("loading function, p=%p, p_end=%p", (void *) p, (void *) p_end));
DUK_DD(DUK_DDPRINT("loading function, p=%p, p_end=%p", (const void *) p, (const void *) p_end));

DUK__ASSERT_LEFT(3 * 4);
count_instr = DUK_RAW_READINC_U32_BE(p);
Expand Down
13 changes: 13 additions & 0 deletions src-input/duk_api_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -6313,6 +6313,13 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) {
* Error throwing
*/

#if defined(DUK_USE_GCC_PRAGMAS)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn"
#elif defined(DUK_USE_CLANG_PRAGMAS)
#pragma clang diagnostic push
#endif

DUK_EXTERNAL void duk_throw_raw(duk_hthread *thr) {
duk_tval *tv_val;

Expand Down Expand Up @@ -6402,6 +6409,12 @@ DUK_EXTERNAL void duk_error_raw(duk_hthread *thr, duk_errcode_t err_code, const
DUK_WO_NORETURN(return;);
}

#if defined(DUK_USE_GCC_PRAGMAS)
#pragma GCC diagnostic pop
#elif defined(DUK_USE_CLANG_PRAGMAS)
#pragma clang diagnostic pop
#endif

#if !defined(DUK_USE_VARIADIC_MACROS)
DUK_NORETURN(DUK_LOCAL_DECL void duk__throw_error_from_stash(duk_hthread *thr, duk_errcode_t err_code, const char *fmt, va_list ap));

Expand Down
38 changes: 19 additions & 19 deletions src-input/duk_bi_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2263,11 +2263,11 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) {

/* XXX: split into separate functions for each field type? */
DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
duk_small_int_t magic = (duk_small_int_t) duk_get_current_magic(thr);
duk_small_int_t magic_ftype;
duk_small_int_t magic_bigendian;
duk_small_int_t magic_signed;
duk_small_int_t magic_typedarray;
duk_small_uint_t magic = (duk_small_uint_t) duk_get_current_magic(thr);
duk_small_uint_t magic_ftype;
duk_small_uint_t magic_bigendian;
duk_small_uint_t magic_signed;
duk_small_uint_t magic_typedarray;
duk_small_uint_t endswap;
duk_hbufobj *h_this;
duk_bool_t no_assert;
Expand All @@ -2278,10 +2278,10 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
duk_uint8_t *buf;
duk_double_union du;

magic_ftype = magic & 0x0007;
magic_bigendian = magic & 0x0008;
magic_signed = magic & 0x0010;
magic_typedarray = magic & 0x0020;
magic_ftype = magic & 0x0007U;
magic_bigendian = magic & 0x0008U;
magic_signed = magic & 0x0010U;
magic_typedarray = magic & 0x0020U;

h_this = duk__require_bufobj_this(thr); /* XXX: very inefficient for plain buffers */
DUK_ASSERT(h_this != NULL);
Expand Down Expand Up @@ -2522,11 +2522,11 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
/* XXX: split into separate functions for each field type? */
DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
duk_small_int_t magic = (duk_small_int_t) duk_get_current_magic(thr);
duk_small_int_t magic_ftype;
duk_small_int_t magic_bigendian;
duk_small_int_t magic_signed;
duk_small_int_t magic_typedarray;
duk_small_uint_t magic = (duk_small_uint_t) duk_get_current_magic(thr);
duk_small_uint_t magic_ftype;
duk_small_uint_t magic_bigendian;
duk_small_uint_t magic_signed;
duk_small_uint_t magic_typedarray;
duk_small_uint_t endswap;
duk_hbufobj *h_this;
duk_bool_t no_assert;
Expand All @@ -2538,10 +2538,10 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
duk_double_union du;
duk_int_t nbytes = 0;

magic_ftype = magic & 0x0007;
magic_bigendian = magic & 0x0008;
magic_signed = magic & 0x0010;
magic_typedarray = magic & 0x0020;
magic_ftype = magic & 0x0007U;
magic_bigendian = magic & 0x0008U;
magic_signed = magic & 0x0010U;
magic_typedarray = magic & 0x0020U;
DUK_UNREF(magic_signed);

h_this = duk__require_bufobj_this(thr); /* XXX: very inefficient for plain buffers */
Expand Down Expand Up @@ -2581,7 +2581,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
* (offset + nbytes) even when write fails due to invalid offset.
*/
if (magic_ftype != DUK__FLD_VARINT) {
DUK_ASSERT(magic_ftype >= 0 && magic_ftype < (duk_small_int_t) (sizeof(duk__buffer_nbytes_from_fldtype) / sizeof(duk_uint8_t)));
DUK_ASSERT(magic_ftype < (duk_small_uint_t) (sizeof(duk__buffer_nbytes_from_fldtype) / sizeof(duk_uint8_t)));
nbytes = duk__buffer_nbytes_from_fldtype[magic_ftype];
} else {
nbytes = duk_get_int(thr, 2);
Expand Down
Loading

0 comments on commit 6001888

Please sign in to comment.