annotate Applications/Samples/WebAssembly/docker-build.sh @ 1619:4c9e68291467

Added code to remove the wheel callback in dtor, to prevent access to dead object
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 02 Nov 2020 17:55:35 +0100
parents 8c5f9864545f
children 9ac2a65d4172
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/bin/bash
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
1589
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
3 # Stone of Orthanc
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
5 # Department, University Hospital of Liege, Belgium
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
6 # Copyright (C) 2017-2020 Osimis S.A., Belgium
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
7 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
8 # This program is free software: you can redistribute it and/or
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
9 # modify it under the terms of the GNU Affero General Public License
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
10 # as published by the Free Software Foundation, either version 3 of
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
11 # the License, or (at your option) any later version.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
12 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
13 # This program is distributed in the hope that it will be useful, but
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
16 # Affero General Public License for more details.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
17 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
20
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
21
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 set -ex
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 IMAGE=jodogne/wasm-builder:1.39.17-upstream
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 if [ "$1" != "Debug" -a "$1" != "Release" ]; then
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 echo "Please provide build type: Debug or Release"
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 exit -1
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 fi
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 if [ -t 1 ]; then
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 # TTY is available => use interactive mode
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 DOCKER_FLAGS='-i'
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 fi
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
1513
24068dd8c445 fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
36 ROOT_DIR=`dirname $(readlink -f $0)`/../../..
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 mkdir -p ${ROOT_DIR}/wasm-binaries
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 docker run -t ${DOCKER_FLAGS} --rm \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 --user $(id -u):$(id -g) \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 -v ${ROOT_DIR}:/source:ro \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 -v ${ROOT_DIR}/wasm-binaries:/target:rw ${IMAGE} \
1542
6e0da8370270 fixing paths
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1538
diff changeset
44 bash /source/Applications/Samples/WebAssembly/docker-internal.sh $1
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 ls -lR ${ROOT_DIR}/wasm-binaries/