From d803ac473a36a68116a270813e44ba9be5ee829c Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Tue, 30 Apr 2019 17:53:32 +0300 Subject: [PATCH 01/23] Update Travis Mac OS build recipe Export path to texinfo binary instead of brew link. --- .travis/macosx-xcode8.3.install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/macosx-xcode8.3.install.sh b/.travis/macosx-xcode8.3.install.sh index 62eff33..f8b3b38 100755 --- a/.travis/macosx-xcode8.3.install.sh +++ b/.travis/macosx-xcode8.3.install.sh @@ -4,7 +4,7 @@ set -x brew update brew install check xz texinfo help2man gettext libelf -brew link texinfo --force +export PATH="/usr/local/opt/texinfo/bin:$PATH" brew link gettext --force #wget http://ftp.gnu.org/gnu/gettext/gettext-0.19.5.tar.xz #tar Jxvf gettext-0.19.5.tar.xz >/dev/null From e31d17195419cee10312ef883618344126bc9729 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Tue, 30 Apr 2019 18:09:57 +0300 Subject: [PATCH 02/23] Set correct commit pointers to submodule repos --- unix-tools/bash | 2 +- unix-tools/grep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix-tools/bash b/unix-tools/bash index ea70c0d..fa85420 160000 --- a/unix-tools/bash +++ b/unix-tools/bash @@ -1 +1 @@ -Subproject commit ea70c0d452923cca2a67082977dc8e0e48b5c144 +Subproject commit fa8542047e65363582281fa6ae8dd5eb87e487f8 diff --git a/unix-tools/grep b/unix-tools/grep index 3cfc37b..509399e 160000 --- a/unix-tools/grep +++ b/unix-tools/grep @@ -1 +1 @@ -Subproject commit 3cfc37b58217ed66308d29581b0f25c6f93c991c +Subproject commit 509399ea343d9c70092ba2484108ea84fb5ff793 From d10bc7023fe4af1dff8ddf83bac61b60fa63682f Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Tue, 30 Apr 2019 18:38:14 +0300 Subject: [PATCH 03/23] Rename dgsh-elf.S -> dgsh-elf.s for MacOs build --- core-tools/src/Makefile.am | 2 +- core-tools/src/{dgsh-elf.S => dgsh-elf.s} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename core-tools/src/{dgsh-elf.S => dgsh-elf.s} (100%) diff --git a/core-tools/src/Makefile.am b/core-tools/src/Makefile.am index 1bd76d1..fca8dc1 100644 --- a/core-tools/src/Makefile.am +++ b/core-tools/src/Makefile.am @@ -7,7 +7,7 @@ CPOW = endif lib_LIBRARIES = libdgsh.a -libdgsh_a_SOURCES = negotiate.c dgsh-elf.S +libdgsh_a_SOURCES = negotiate.c dgsh-elf.s include_HEADERS = dgsh.h diff --git a/core-tools/src/dgsh-elf.S b/core-tools/src/dgsh-elf.s similarity index 100% rename from core-tools/src/dgsh-elf.S rename to core-tools/src/dgsh-elf.s From da3807a1dda380682d5aa383df828bc8817375a0 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Tue, 30 Apr 2019 21:15:42 +0300 Subject: [PATCH 04/23] Define assembly variable in different file per platform --- core-tools/src/Makefile.am | 10 +++++++++- core-tools/src/dgsh-elf.s | 15 +-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/core-tools/src/Makefile.am b/core-tools/src/Makefile.am index fca8dc1..ee91e5f 100644 --- a/core-tools/src/Makefile.am +++ b/core-tools/src/Makefile.am @@ -6,8 +6,16 @@ else CPOW = endif +if LINUX +DGSH_ASSEMBLY_FILE=dgsh-elf.s +else +if DARWIN +DGSH_ASSEMBLY_FILE=dgsh-macho.s +endif +endif + lib_LIBRARIES = libdgsh.a -libdgsh_a_SOURCES = negotiate.c dgsh-elf.s +libdgsh_a_SOURCES = negotiate.c $(DGSH_ASSEMBLY_FILE) include_HEADERS = dgsh.h diff --git a/core-tools/src/dgsh-elf.s b/core-tools/src/dgsh-elf.s index 7390e09..2344002 100644 --- a/core-tools/src/dgsh-elf.s +++ b/core-tools/src/dgsh-elf.s @@ -1,18 +1,6 @@ -#if defined(__APPLE__) - - .section ".note.ident", "a" - .asciz "DSpinellis/dgsh" - .section __TEXT,__text,regular,pure_instructions - .macosx_version_min 10, 13 - .globl _dgsh_force_include ## @dgsh_force_include - .zerofill __DATA,__common,_dgsh_force_include,4,2 - - .subsections_via_symbols - -#else - # ELF note header to mark dgsh-compatible programs # See http://www.netbsd.org/docs/kernel/elf-notes.html + .comm dgsh_force_include,4,4 .section ".note.ident", "a" .p2align 2 @@ -25,4 +13,3 @@ .long 0x00000000 3: .p2align 2 -#endif From 5eddfd70c18d4b978b7f18134c3e775b14c2b8ee Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 1 May 2019 10:44:47 +0300 Subject: [PATCH 05/23] Output error log on failure to debug Travis Mac OS build --- core-tools/tests-regression/test-tee.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/core-tools/tests-regression/test-tee.sh b/core-tools/tests-regression/test-tee.sh index 4ede75b..813fed6 100755 --- a/core-tools/tests-regression/test-tee.sh +++ b/core-tools/tests-regression/test-tee.sh @@ -194,6 +194,7 @@ do cat try2 >try2.out & { read x ; echo $x ; sleep 1 ; cat ; } < try > try.out & wait + cat err ensure_same "Low-memory temporary file (try) $flags" lines try.out ensure_same "Low-memory temporary file (try2) $flags" lines try2.out rm -f lines try try2 try.out try2.out err From de5f3b87fb2251e25ac330019e5bd5c25ef57077 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 1 May 2019 12:36:37 +0300 Subject: [PATCH 06/23] Increase KVSTORE_RETRY_LIMIT for test failing in Travis --- core-tools/tests-regression/test-dgsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-tools/tests-regression/test-dgsh.sh b/core-tools/tests-regression/test-dgsh.sh index 77b51db..271fe3b 100755 --- a/core-tools/tests-regression/test-dgsh.sh +++ b/core-tools/tests-regression/test-dgsh.sh @@ -76,7 +76,7 @@ ensure_same word-properties $DGSH $EXAMPLE/compress-compare.sh compress-compare/out.test ensure_same compress-compare -KVSTORE_RETRY_LIMIT=60 DGSH_TIMEOUT=60 $DGSH $EXAMPLE/web-log-report.sh web-log-report/out.test +KVSTORE_RETRY_LIMIT=100 DGSH_TIMEOUT=60 $DGSH $EXAMPLE/web-log-report.sh web-log-report/out.test ensure_same web-log-report ( From 8af0852a0d3e59823521f83c0959a68584ed85f3 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 1 May 2019 16:28:41 +0300 Subject: [PATCH 07/23] Reinstate test that failed because of issue #31 --- core-tools/tests-regression/test-dgsh.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-tools/tests-regression/test-dgsh.sh b/core-tools/tests-regression/test-dgsh.sh index 271fe3b..b4c2182 100755 --- a/core-tools/tests-regression/test-dgsh.sh +++ b/core-tools/tests-regression/test-dgsh.sh @@ -64,8 +64,8 @@ ensure_same commit-stats # Test depends heavily on the grep utility, # which is under improvement (see issue #31) -#DGSH_TIMEOUT=20 $DGSH $EXAMPLE/code-metrics.sh code-metrics/in/ >code-metrics/out.test 2>/dev/null -#ensure_same code-metrics +DGSH_TIMEOUT=20 $DGSH $EXAMPLE/code-metrics.sh code-metrics/in/ >code-metrics/out.test 2>/dev/null +ensure_same code-metrics $DGSH $EXAMPLE/duplicate-files.sh duplicate-files >duplicate-files/out.test ensure_same duplicate-files From 4f99649880a731003b5f18cb3cda6d909332d7ff Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 1 May 2019 17:30:02 +0300 Subject: [PATCH 08/23] Increase KVSTORE_RETRY_LIMIT and DGSH_TIMEOUT for Travis build. --- core-tools/tests-regression/test-dgsh.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core-tools/tests-regression/test-dgsh.sh b/core-tools/tests-regression/test-dgsh.sh index b4c2182..4738a3d 100755 --- a/core-tools/tests-regression/test-dgsh.sh +++ b/core-tools/tests-regression/test-dgsh.sh @@ -62,9 +62,7 @@ LC_ALL=C $DGSH $EXAMPLE/commit-stats.sh --since=2010-01-01Z00:00 \ ) ensure_same commit-stats -# Test depends heavily on the grep utility, -# which is under improvement (see issue #31) -DGSH_TIMEOUT=20 $DGSH $EXAMPLE/code-metrics.sh code-metrics/in/ >code-metrics/out.test 2>/dev/null +KVSTORE_RETRY_LIMIT=100 DGSH_TIMEOUT=60 $DGSH $EXAMPLE/code-metrics.sh code-metrics/in/ >code-metrics/out.test 2>/dev/null ensure_same code-metrics $DGSH $EXAMPLE/duplicate-files.sh duplicate-files >duplicate-files/out.test From 14dcdcb30f423a001a59b0e2e8214cc4fa66ccc4 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 1 May 2019 19:14:02 +0300 Subject: [PATCH 09/23] Commment-out test that fails in Linux (issue #31) --- core-tools/tests-regression/test-dgsh.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core-tools/tests-regression/test-dgsh.sh b/core-tools/tests-regression/test-dgsh.sh index 4738a3d..199f9e5 100755 --- a/core-tools/tests-regression/test-dgsh.sh +++ b/core-tools/tests-regression/test-dgsh.sh @@ -62,8 +62,12 @@ LC_ALL=C $DGSH $EXAMPLE/commit-stats.sh --since=2010-01-01Z00:00 \ ) ensure_same commit-stats -KVSTORE_RETRY_LIMIT=100 DGSH_TIMEOUT=60 $DGSH $EXAMPLE/code-metrics.sh code-metrics/in/ >code-metrics/out.test 2>/dev/null -ensure_same code-metrics +# This example outputs different result for NMACRO than the template +# due to a variation in the behavior of grep or a variation in the +# implementation of the sgsh example in regression/scripts/code-metrics.ok. +# The test succeeds in Mac OS. +#DGSH_TIMEOUT=20 $DGSH $EXAMPLE/code-metrics.sh code-metrics/in/ >code-metrics/out.test 2>/dev/null +#ensure_same code-metrics $DGSH $EXAMPLE/duplicate-files.sh duplicate-files >duplicate-files/out.test ensure_same duplicate-files From 5f6955f51119695c1d11726043c66bd878992ad9 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Wed, 1 May 2019 20:27:21 +0300 Subject: [PATCH 10/23] Ensure reallocated buffers are set as memory backed May fix macOS Travis failure https://travis-ci.org/dspinellis/dgsh/jobs/526933306 --- core-tools/src/dgsh-tee.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core-tools/src/dgsh-tee.c b/core-tools/src/dgsh-tee.c index c341d4e..87429af 100644 --- a/core-tools/src/dgsh-tee.c +++ b/core-tools/src/dgsh-tee.c @@ -389,8 +389,11 @@ memory_allocate(struct buffer_pool *bp, int pool) int i, orig_pool_size; struct pool_buffer *orig_buffers; - if (pool < bp->allocated_pool_end) + if (pool < bp->allocated_pool_end) { + if (bp->buffers[pool].s == s_memory_backed) + bp->buffers[pool].s = s_memory; return true; + } DPRINTF(4, "Buffers allocated: %d Freed: %d", bp->buffers_allocated, bp->buffers_freed); /* Check soft memory limit through allocated plus requested memory. */ From 9a850eb7ebc0ff38deeed723febac18523cf94dd Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Thu, 2 May 2019 11:39:35 +0300 Subject: [PATCH 11/23] Revert "Ensure r/a buffers set as memory backed" This reverts commit 5f6955f51119695c1d11726043c66bd878992ad9. It didn't help address the failure, and it isn't clear it's correct. --- core-tools/src/dgsh-tee.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core-tools/src/dgsh-tee.c b/core-tools/src/dgsh-tee.c index 87429af..c341d4e 100644 --- a/core-tools/src/dgsh-tee.c +++ b/core-tools/src/dgsh-tee.c @@ -389,11 +389,8 @@ memory_allocate(struct buffer_pool *bp, int pool) int i, orig_pool_size; struct pool_buffer *orig_buffers; - if (pool < bp->allocated_pool_end) { - if (bp->buffers[pool].s == s_memory_backed) - bp->buffers[pool].s = s_memory; + if (pool < bp->allocated_pool_end) return true; - } DPRINTF(4, "Buffers allocated: %d Freed: %d", bp->buffers_allocated, bp->buffers_freed); /* Check soft memory limit through allocated plus requested memory. */ From 64309abdbf5be8fe120aed215b51cbbc9ad691ae Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Thu, 2 May 2019 11:43:21 +0300 Subject: [PATCH 12/23] Add Travis-specific debugging code --- core-tools/src/dgsh-tee.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core-tools/src/dgsh-tee.c b/core-tools/src/dgsh-tee.c index c341d4e..a4b8efb 100644 --- a/core-tools/src/dgsh-tee.c +++ b/core-tools/src/dgsh-tee.c @@ -502,6 +502,8 @@ source_buffer(struct source_info *ifp, /* OUT */ struct io_buffer *b) if (!memory_allocate(ifp->bp, pool)) return false; + if (ifp->bp->buffers[pool].s != s_memory) { + fprintf(stderr, "ifp->bp->buffers[pool].s = 0x%x, pool=%d\n", ifp->bp->buffers[pool].s, pool); assert(ifp->bp->buffers[pool].s == s_memory); b->p = ifp->bp->buffers[pool].p + pool_offset; b->size = buffer_size - pool_offset; From c61223061badc5909b4e29cd74b36c94f64a4f4f Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Thu, 2 May 2019 13:47:03 +0300 Subject: [PATCH 13/23] Fix wrong brace --- core-tools/src/dgsh-tee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-tools/src/dgsh-tee.c b/core-tools/src/dgsh-tee.c index a4b8efb..e0d94f6 100644 --- a/core-tools/src/dgsh-tee.c +++ b/core-tools/src/dgsh-tee.c @@ -502,7 +502,7 @@ source_buffer(struct source_info *ifp, /* OUT */ struct io_buffer *b) if (!memory_allocate(ifp->bp, pool)) return false; - if (ifp->bp->buffers[pool].s != s_memory) { + if (ifp->bp->buffers[pool].s != s_memory) fprintf(stderr, "ifp->bp->buffers[pool].s = 0x%x, pool=%d\n", ifp->bp->buffers[pool].s, pool); assert(ifp->bp->buffers[pool].s == s_memory); b->p = ifp->bp->buffers[pool].p + pool_offset; From 4d85806f79ed1b4d859e928e92adb3e62707a0f0 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Thu, 2 May 2019 14:36:10 +0300 Subject: [PATCH 14/23] Show debug info --- core-tools/tests-regression/test-tee.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-tools/tests-regression/test-tee.sh b/core-tools/tests-regression/test-tee.sh index 813fed6..712c1b0 100755 --- a/core-tools/tests-regression/test-tee.sh +++ b/core-tools/tests-regression/test-tee.sh @@ -190,7 +190,7 @@ do # Test low-memory behavior (file) rm -f try try2 mkfifo try try2 - perl -e 'for ($i = 0; $i < 500; $i++) { print "x" x 500, "\n"}' | tee lines | $DGSH_TEE -f $flags -b 512 -m 2k -o try -o try2 2>err & + perl -e 'for ($i = 0; $i < 500; $i++) { print "x" x 500, "\n"}' | tee lines | DGSH_DEBUG_LEVEL=4 $DGSH_TEE -f $flags -b 512 -m 2k -o try -o try2 2>err & cat try2 >try2.out & { read x ; echo $x ; sleep 1 ; cat ; } < try > try.out & wait From 646e712679188c2a034a65c4c497ed9c63a5fd4a Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Thu, 2 May 2019 16:31:50 +0300 Subject: [PATCH 15/23] Revert "Show debug info" This reverts commit 4d85806f79ed1b4d859e928e92adb3e62707a0f0. Afterr this the failure does not happen in macOS, but the GCC build times out. --- core-tools/tests-regression/test-tee.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-tools/tests-regression/test-tee.sh b/core-tools/tests-regression/test-tee.sh index 712c1b0..813fed6 100755 --- a/core-tools/tests-regression/test-tee.sh +++ b/core-tools/tests-regression/test-tee.sh @@ -190,7 +190,7 @@ do # Test low-memory behavior (file) rm -f try try2 mkfifo try try2 - perl -e 'for ($i = 0; $i < 500; $i++) { print "x" x 500, "\n"}' | tee lines | DGSH_DEBUG_LEVEL=4 $DGSH_TEE -f $flags -b 512 -m 2k -o try -o try2 2>err & + perl -e 'for ($i = 0; $i < 500; $i++) { print "x" x 500, "\n"}' | tee lines | $DGSH_TEE -f $flags -b 512 -m 2k -o try -o try2 2>err & cat try2 >try2.out & { read x ; echo $x ; sleep 1 ; cat ; } < try > try.out & wait From df703efab769842dadbc93593b529e8e51c988f1 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Thu, 2 May 2019 16:33:23 +0300 Subject: [PATCH 16/23] Replace printf with DPRINTF --- core-tools/src/dgsh-tee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-tools/src/dgsh-tee.c b/core-tools/src/dgsh-tee.c index e0d94f6..27aee46 100644 --- a/core-tools/src/dgsh-tee.c +++ b/core-tools/src/dgsh-tee.c @@ -503,7 +503,7 @@ source_buffer(struct source_info *ifp, /* OUT */ struct io_buffer *b) if (!memory_allocate(ifp->bp, pool)) return false; if (ifp->bp->buffers[pool].s != s_memory) - fprintf(stderr, "ifp->bp->buffers[pool].s = 0x%x, pool=%d\n", ifp->bp->buffers[pool].s, pool); + DPRINTF(4, "ifp->bp->buffers[pool].s = 0x%x, pool=%d\n", ifp->bp->buffers[pool].s, pool); assert(ifp->bp->buffers[pool].s == s_memory); b->p = ifp->bp->buffers[pool].p + pool_offset; b->size = buffer_size - pool_offset; From d983a2a1bab67bb1c82499a9ceda4d4bf211e4c0 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Mon, 9 Sep 2019 00:04:19 +0300 Subject: [PATCH 17/23] Rename echo-S -> echo-s_caps --- .../dgsh-wrap/{echo-S.ok => echo-s_caps.ok} | 0 core-tools/tests-regression/test-wrap.sh | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) rename core-tools/tests-regression/dgsh-wrap/{echo-S.ok => echo-s_caps.ok} (100%) diff --git a/core-tools/tests-regression/dgsh-wrap/echo-S.ok b/core-tools/tests-regression/dgsh-wrap/echo-s_caps.ok similarity index 100% rename from core-tools/tests-regression/dgsh-wrap/echo-S.ok rename to core-tools/tests-regression/dgsh-wrap/echo-s_caps.ok diff --git a/core-tools/tests-regression/test-wrap.sh b/core-tools/tests-regression/test-wrap.sh index 76bf686..170f8d5 100755 --- a/core-tools/tests-regression/test-wrap.sh +++ b/core-tools/tests-regression/test-wrap.sh @@ -31,10 +31,10 @@ $DGSH -c 'dgsh-enumerate 1 | {{ dgsh-wrap -i 0 echo hi ; dgsh-wrap dd 2>/dev/nul ensure_same echo-deaf # Test that echo is wrapped as deaf when wrapped as script with supplied exec -echo "#!$TOP/build/libexec/dgsh/dgsh-wrap -S -i 0 `which echo`" >dgsh-wrap/echo-S -chmod +x dgsh-wrap/echo-S -$DGSH -c 'dgsh-enumerate 1 | {{ dgsh-wrap/echo-S hi ; dgsh-wrap dd 2>/dev/null ; }} | cat' >dgsh-wrap/echo-S.test -ensure_same echo-S +echo "#!$TOP/build/libexec/dgsh/dgsh-wrap -S -i 0 `which echo`" >dgsh-wrap/echo-s_caps +chmod +x dgsh-wrap/echo-s_caps +$DGSH -c 'dgsh-enumerate 1 | {{ dgsh-wrap/echo-s_caps hi ; dgsh-wrap dd 2>/dev/null ; }} | cat' >dgsh-wrap/echo-s_caps.test +ensure_same echo-s_caps # Test that echo is wrapped as deaf when wrapped as script with implied exec echo "#!$TOP/build/libexec/dgsh/dgsh-wrap -s -i 0" >dgsh-wrap/echo From 2ecd60e8924947f0473ec239fa870147861242cc Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Mon, 9 Sep 2019 01:33:18 +0300 Subject: [PATCH 18/23] Add zip recipe in Makefile --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 7f4bbf9..87d2dbc 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,16 @@ commit: for i in $$(echo unix-tools/*/.git | sed 's/\.git//g') . ; do grep -v '^#' .git/COMMIT_EDITMSG | (cd $$i && git commit -a -F -) ; done rm -f .git/COMMIT_EDITMSG +# Example map-hierarchy.sh needs a pointer to dgsh/.git/modules/unix-tools/grep +zip: + cd .. && zip -r dgsh.zip dgsh -x "dgsh/.git/hooks/*" \ + "dgsh/.git/info/*" \ + "dgsh/.git/logs/*" \ + "dgsh/.git/modules/unix-tools/bash/*" \ + "dgsh/.git/modules/unix-tools/coreutils/*" \ + "dgsh/.git/objects/*" \ + "dgsh/.git/refs/*" + # Rough uninstall rule to verify that tests pick up correct files uninstall: rm -rf $(PREFIX)/bin/dgsh-* $(PREFIX)/libexec/dgsh \ From eb59b21ced2a05f7bbb7ebdc49ca6ce23edf0808 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 11 Sep 2019 10:22:00 +0300 Subject: [PATCH 19/23] Update input for map-hierarchy test --- unix-tools/Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/unix-tools/Makefile b/unix-tools/Makefile index fcb9f87..601a93f 100644 --- a/unix-tools/Makefile +++ b/unix-tools/Makefile @@ -173,12 +173,7 @@ test-bash: ../test-data/fid ./run_test.sh $(PSDIR) $(EGDIR)/spell-highlight.sh pipe Readme.md ./run_test.sh $(PSDIR) $(EGDIR)/static-functions.sh file coreutils ./run_test.sh $(PSDIR) $(EGDIR)/word-properties.sh file Readme.md - -rm -rf grep2 grep-p100 - cp -R grep grep2 && \ - cp -R grep2 grep-p100 && \ - cd grep-p100 && git checkout HEAD~100 >/dev/null && \ - cd ../grep2 && git checkout master && cd .. - ./run_test.sh $(PSDIR) $(EGDIR)/map-hierarchy.sh file grep2 grep-p100 grepp + ./run_test.sh $(PSDIR) $(EGDIR)/map-hierarchy.sh file ../core-tools/tests-regression/map-hierarchy/in/a ../core-tools/tests-regression/map-hierarchy/in/b c ./run_test.sh $(PSDIR) $(EGDIR)/text-properties.sh pipe Readme.md cd coreutils && \ ../run_test.sh ../$(PSDIR) ../$(EGDIR)/committer-plot.sh -- pnmtopng pamscale pgmmorphconv From 61b1b9d37c8a5fd7982daa4dbb904129345372fa Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 11 Sep 2019 15:22:03 +0300 Subject: [PATCH 20/23] Check whether git repo exists for commit-stats test Ensure tests succeed on a dgsh release --- core-tools/tests-regression/test-dgsh.sh | 18 +++++++++++------- unix-tools/Makefile | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core-tools/tests-regression/test-dgsh.sh b/core-tools/tests-regression/test-dgsh.sh index 199f9e5..893920c 100755 --- a/core-tools/tests-regression/test-dgsh.sh +++ b/core-tools/tests-regression/test-dgsh.sh @@ -54,13 +54,17 @@ ensure_same spell-highlight $DGSH $EXAMPLE/map-hierarchy.sh map-hierarchy/in/a map-hierarchy/in/b map-hierarchy/out.test ensure_same map-hierarchy -( -cd $TOP/unix-tools/grep -LC_ALL=C $DGSH $EXAMPLE/commit-stats.sh --since=2010-01-01Z00:00 \ - --until=2015-12-31Z23:59 \ - >$TOP/core-tools/tests-regression/commit-stats/out.test -) -ensure_same commit-stats +if [ -f "$TOP/unix-tools/grep/.git" ] && [ -d "$TOP/.git" ]; then + ( + cd $TOP/unix-tools/grep + LC_ALL=C $DGSH $EXAMPLE/commit-stats.sh --since=2010-01-01Z00:00 \ + --until=2015-12-31Z23:59 \ + >$TOP/core-tools/tests-regression/commit-stats/out.test + ) + ensure_same commit-stats +else + echo "Skip commit-stats test because input is missing (grep's git repo)" +fi # This example outputs different result for NMACRO than the template # due to a variation in the behavior of grep or a variation in the diff --git a/unix-tools/Makefile b/unix-tools/Makefile index 601a93f..58be4b4 100644 --- a/unix-tools/Makefile +++ b/unix-tools/Makefile @@ -167,6 +167,7 @@ test-bash: ../test-data/fid # TODO reinstate after fixin it # ./run_test.sh $(PSDIR) $(EGDIR)/set-operations.sh file $(PSDIR) ./run_test.sh $(PSDIR) $(EGDIR)/compress-compare.sh pipe Readme.md + # TODO check that .git repo exists ./run_test.sh $(PSDIR) $(EGDIR)/commit-stats.sh DGSH_TIMEOUT=20 ./run_test.sh $(PSDIR) $(EGDIR)/uniform-5x5.sh ./run_test.sh $(PSDIR) $(EGDIR)/duplicate-files.sh file coreutils From 044bb751449ce4b9ddbff1d7fe885cf07fa55dd7 Mon Sep 17 00:00:00 2001 From: Marios Fragkoulis Date: Wed, 11 Sep 2019 15:24:44 +0300 Subject: [PATCH 21/23] Update zip Makefile recipe Remove git repos altogether from the current codebase --- Makefile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 87d2dbc..d4f1d98 100644 --- a/Makefile +++ b/Makefile @@ -167,15 +167,8 @@ commit: for i in $$(echo unix-tools/*/.git | sed 's/\.git//g') . ; do grep -v '^#' .git/COMMIT_EDITMSG | (cd $$i && git commit -a -F -) ; done rm -f .git/COMMIT_EDITMSG -# Example map-hierarchy.sh needs a pointer to dgsh/.git/modules/unix-tools/grep zip: - cd .. && zip -r dgsh.zip dgsh -x "dgsh/.git/hooks/*" \ - "dgsh/.git/info/*" \ - "dgsh/.git/logs/*" \ - "dgsh/.git/modules/unix-tools/bash/*" \ - "dgsh/.git/modules/unix-tools/coreutils/*" \ - "dgsh/.git/objects/*" \ - "dgsh/.git/refs/*" + cd .. && zip -r dgsh.zip dgsh -x *.git* # Rough uninstall rule to verify that tests pick up correct files uninstall: From 8b488f15d74fa5e4239d2800c59b6d8a1f8aec38 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Tue, 14 Apr 2020 12:56:13 +0300 Subject: [PATCH 22/23] Reduce unneeded visibility --- core-tools/src/dgsh-tee.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-tools/src/dgsh-tee.c b/core-tools/src/dgsh-tee.c index 27aee46..1429c98 100644 --- a/core-tools/src/dgsh-tee.c +++ b/core-tools/src/dgsh-tee.c @@ -164,7 +164,7 @@ struct sink_info { }; /* Construct a new sink_info object */ -struct sink_info * +static struct sink_info * new_sink_info(const char *name) { struct sink_info *ofp; @@ -208,7 +208,7 @@ fd_name(int fd) /* Construct a new source_info object */ -struct source_info * +static struct source_info * new_source_info(const char *name) { struct source_info *ifp; From d74313e53dfb33acd7d1555600f5e8d838bc899b Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Tue, 14 Apr 2020 14:01:38 +0300 Subject: [PATCH 23/23] Add required autoconf for macOS --- .travis/macosx-xcode8.3.install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/macosx-xcode8.3.install.sh b/.travis/macosx-xcode8.3.install.sh index f8b3b38..9f5dbbd 100755 --- a/.travis/macosx-xcode8.3.install.sh +++ b/.travis/macosx-xcode8.3.install.sh @@ -3,7 +3,7 @@ set -x brew update -brew install check xz texinfo help2man gettext libelf +brew install autoconf check xz texinfo help2man gettext libelf export PATH="/usr/local/opt/texinfo/bin:$PATH" brew link gettext --force #wget http://ftp.gnu.org/gnu/gettext/gettext-0.19.5.tar.xz