Merge: Fix light FFI in interpreter on OS X
authorJean Privat <jean@pryen.org>
Thu, 20 Aug 2015 02:30:39 +0000 (22:30 -0400)
committerJean Privat <jean@pryen.org>
Thu, 20 Aug 2015 02:30:39 +0000 (22:30 -0400)
Fix #1623 by removing the soname declaration (the soname was more of a placeholder at this time anyway). Also take this opportunity to remove the `-g` flag.

The fixes to the md5 modules update it to the latest style and use the nity/native pattern to avoid callbacks so it is light FFI compatible. This was used to test the interpreter on OS X.

Pull-Request: #1642
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

misc/jenkins/check_contrib.sh
misc/jenkins/checklicense.sh
misc/jenkins/checksignedoffby.sh
misc/jenkins/checkwhitespaces.sh [new file with mode: 0755]
misc/jenkins/nitester-wrapper.sh
misc/jenkins/unitrun.sh

index d43f7f5..320dac8 100755 (executable)
@@ -25,11 +25,11 @@ for p in $projects; do
        dir=`dirname "$p"`
        name=`basename "$dir"`
        echo "*** make $dir ***"
-       if misc/jenkins/unitrun.sh "run-$name-make" make -C "$dir"; then
+       if misc/jenkins/unitrun.sh "cmd-$name-make" make -C "$dir"; then
                # Make OK, is there a `check` rule?
                make -C "$dir" check -n 2>/dev/null || continue
                echo "*** makecheck $dir ***"
-               if misc/jenkins/unitrun.sh "run-$name-makecheck" make -C "$dir" check; then
+               if misc/jenkins/unitrun.sh "cmd-$name-makecheck" make -C "$dir" check; then
                        :
                else
                        failed="$failed $name-check"
index 3fcd8af..16f5260 100755 (executable)
 # limitations under the License.
 
 # Check missing "This file is part of NIT…" comment in committed scripts.
+#
+# Usage: checklicense.sh from to
 
-if test "$#" -lt 2; then
-       echo "Usage: checklicense from to"
-       echo ""
-       exit
-fi
+set -e
 
-from=$1
-to=$2
+from=${1:-origin/master}
+to=${2:-HEAD}
 
 err=0
 
+cd `git rev-parse --show-toplevel`
+
+echo "checklicense $from (`git rev-parse "$from"`) .. $to (`git rev-parse "$to"`)"
 git diff --name-status $from..$to -- "*.nit" "*.sh" | sed -n 's/^A\s*//p' > checklicense_new_files.out
-test -s checklicense_new_files.out || exit 0
-grep -L '\(^\|\b\)# [Tt]his file is part of NIT ' `cat checklicense_new_files.out` 2>/dev/null | tee checklicense_missing.out
-test \! -s checklicense_missing.out
+if test \! -s checklicense_new_files.out; then
+       echo "No new files"
+       exit 0
+fi
+grep -L '\(^\|\b\)# [Tt]his file is part of NIT ' `cat checklicense_new_files.out` 2>/dev/null > checklicense_missing.out || true
+if test -s checklicense_missing.out; then
+       echo "These files are missing their licence:"
+       echo ""
+       cat checklicense_missing.out
+       echo ""
+       echo "Please double check that the licence text (i.e. \`This file is part of NIT...\`) is included at the begin of these files."
+       exit 1
+else
+       echo "All `cat checklicense_new_files.out | wc -l` checked new files have a correct license."
+       exit 0
+fi
index bebd200..9a5c27f 100755 (executable)
 # limitations under the License.
 
 # Check missing signed-off-by in commits
+# Usage: checksignedoffby from to
 
-if test "$#" -lt 2; then
-       echo "Usage: checksignedoffby from to"
-       echo ""
-       exit
-fi
+set -e
 
-from=$1
-to=$2
+from=${1:-origin/master}
+to=${2:-HEAD}
 
 err=0
 
+cd `git rev-parse --show-toplevel`
+
+echo "checksignedoffby $from (`git rev-parse "$from"`) .. $to (`git rev-parse "$to"`)"
 for ref in `git rev-list --no-merges "$from".."$to"`; do
        # What is the expected?
        sig=`git --no-pager show -s --format='Signed-off-by: %an <%ae>' $ref`
        # Do we found some signed-off-by?
        git --no-pager show -s --format="%b" $ref | grep "^Signed-off-by:" > check_signedoff_list.out || {
+               echo ""
+               echo "Missing $sig for commit"
                git --no-pager show -s --oneline $ref
-               echo "Missing $sig"
                err=1
                continue
        }
        # Do we found the expected thing?
        cat check_signedoff_list.out | grep -q "^$sig\$" && continue
+       echo ""
+       echo "Bad or missing Signed-off-by for commit"
        git --no-pager show -s --oneline $ref
-       echo "Bad or missing $sig; got:"
+       echo "Expected (from local git config):"
+       echo "$sig"
+       echo "Got:"
        cat check_signedoff_list.out
        err=1
 done
 
 rm check_signedoff_list.out 2> /dev/null
 
+if test "$err" = 1; then
+       echo ""
+       echo "Please check that each commit contains a \`Signed-off-by:\` statement that matches the author's name and email."
+       echo "Note that existing commits should be amended; pushing new commit is not sufficient."
+fi
+
 exit $err
diff --git a/misc/jenkins/checkwhitespaces.sh b/misc/jenkins/checkwhitespaces.sh
new file mode 100755 (executable)
index 0000000..32a9aab
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Check whitespace errors in commits
+# Usage: checkwhitespaces from to
+#
+# This script is in fact a more friendly version of `git log --check`
+
+set -e
+
+from=${1:-origin/master}
+to=${2:-HEAD}
+
+err=0
+
+cd `git rev-parse --show-toplevel`
+
+echo "checkwhitespaces $from (`git rev-parse "$from"`) .. $to (`git rev-parse "$to"`)"
+for ref in `git rev-list --no-merges "$from".."$to"`; do
+       # Show nothing if no error
+       if git --no-pager show --check --oneline $ref > /dev/null; then
+               continue
+       fi
+
+       # Run the command again to display things
+       echo ""
+       echo "Found whitespace errors in commit"
+       git --no-pager show --check --oneline $ref || true
+       err=1
+done
+
+if test "$err" = 1; then
+       echo ""
+       echo "Please check that each file in each commit does not contain whitespace errors."
+       echo "Note that existing commits should be amended; pushing new commit is not sufficient."
+       echo "Hint: use \"git log --check\" to see whitespace errors."
+fi
+
+exit $err
index 902cd4a..70f086b 100755 (executable)
@@ -35,14 +35,14 @@ if ! git checkout $hash; then
 fi
 
 # Make basic bootstrap
-$tools_dir/unitrun.sh "run-make-csrc" make -C c_src
-$tools_dir/unitrun.sh "run-make-version" src/git-gen-version.sh
-$tools_dir/unitrun.sh "run-make-nitc_0" c_src/nitc -o bin/nitc_0 src/nitc.nit
-$tools_dir/unitrun.sh "run-make-nitc" bin/nitc_0 --dir bin/ src/nitc.nit
-$tools_dir/unitrun.sh "run-make-nit-and-nitvm" bin/nitc --dir bin/ src/nit.nit src/nitvm.nit
+$tools_dir/unitrun.sh "cmd-make-csrc" make -C c_src
+$tools_dir/unitrun.sh "cmd-make-version" src/git-gen-version.sh
+$tools_dir/unitrun.sh "cmd-make-nitc_0" c_src/nitc -o bin/nitc_0 src/nitc.nit
+$tools_dir/unitrun.sh "cmd-make-nitc" bin/nitc_0 --dir bin/ src/nitc.nit
+$tools_dir/unitrun.sh "cmd-make-nit-and-nitvm" bin/nitc --dir bin/ src/nit.nit src/nitvm.nit
 
 # Make nitester
-$tools_dir/unitrun.sh "run-make-nitester" make -C contrib/nitester/
+$tools_dir/unitrun.sh "cmd-make-nitester" make -C contrib/nitester/
 
 # Run tests
 cd tests
index 6b1c7f5..1c3d39f 100755 (executable)
@@ -63,13 +63,21 @@ if test "$res" != "0"; then
 echo >> "${name}.xml" "<error message='Command returned $res'/>"
 echo "+ Command returned $res" >&2
 fi
+if test -s "${name}.out"; then
 cat >> "${name}.xml"<<END
 <system-out><![CDATA[
 `cat -v ${name}.out`
 ]]></system-out>
+END
+fi
+if test -s "${name}.2.out"; then
+cat >> "${name}.xml"<<END
 <system-err><![CDATA[
 `cat -v ${name}.2.out`
 ]]></system-err>
+END
+fi
+cat >> "${name}.xml"<<END
 </testcase>
 </testsuite></testsuites>
 END