Browse code

* fix various xcode related build bugs * mulle-bootstrap doesn't do kill 0 anymore

Nat! authored on 24-07-2017 12:08:41
Showing 7 changed files
... ...
@@ -1,9 +1,15 @@
1
+## 3.9.0
2
+
3
+* fix various xcode related build bugs
4
+* mulle-bootstrap doesn't do kill 0 anymore
5
+* add `mulle-bootstrap-core-options.sh` for external script users
6
+* `mulle-bootstrap -f build` now forces a rebuild, as one would expect
7
+
1 8
 ### 3.8.5
2 9
 
3 10
 * fix broken xcode build path
4 11
 * allow some plural synonmys for setting, config, expansion command
5 12
 
6
-
7 13
 ### 3.8.4
8 14
 
9 15
 * fix `Abort now (y/N) > y` not really aborting
... ...
@@ -22,7 +28,7 @@ in general
22 28
 
23 29
 * fix archive extraction on linux
24 30
 
25
-### 3.8.0
31
+## 3.8.0
26 32
 
27 33
 * new build setting `srcdir` where you can specify the subdirectory, that contains configure, CMakeLists et.c
28 34
 
... ...
@@ -41,7 +47,7 @@ dependencies relative to the original project.
41 47
 * when moving embedded directories around, mulle-bootstrap will now create
42 48
 missing target directories
43 49
 * renamed `clone_cache` to `git_mirror` because that's better. `refresh_cache` is now `refresh_git_mirror`.
44
-* added option `--no-git-mirror
50
+* added option `--no-git-mirror`
45 51
 * added `type` command to introspect the bootstrap topology easier
46 52
 * avoid superflous updating of mirrored git clones during one session, which
47 53
 speeds up things considerably, when mirroring
... ...
@@ -128,6 +134,7 @@ setting to list all scripts
128 134
 this reduces a lot of WTF moments.
129 135
 * `CMAKE_FLAGS` is now `CMAKEFLAGS
130 136
 
137
+
131 138
 ### 3.3.0
132 139
 
133 140
 * `mulle-bootstrap project-path` prints out what it thinks your project path is.
... ...
@@ -366,7 +373,7 @@ The idea behind that has been moved to `mulle-build`.
366 373
 * embedded repositories can now be placed at an arbitrary position within your
367 374
 project tree
368 375
 * allow build and fetch options to be passed to `bootstrap`
369
-* improved comments in repositories` and `embedded_repositories` templates
376
+* improved comments in `repositories` and `embedded_repositories` templates
370 377
 * pass ADDICTIONS_DIR to build systems
371 378
 * improve optimistic support, by memorizing if a fetch, refresh, build went
372 379
 thru successfully. The automatic refresh should run much less often now.
... ...
@@ -513,7 +520,7 @@ eliminated.
513 520
    You can now specify the default configurations to build with -c.
514 521
    e.g. `mulle-bootstrap -c "Debug"
515 522
 *  Improved library and frameworks searchpath generation.
516
-*  You can pass build a "-j <cores>" flag, for cmake/make to parallelize
523
+*  You can pass build a `-j <cores>` flag, for cmake/make to parallelize
517 524
    the build.
518 525
 *  Specify `ARCHS='${NATIVE_ARCH_ACTUAL}' mulle-bootstrap build`, when you
519 526
    want to override the ARCHS setting for an Xcode build. Kinda hackish.
... ...
@@ -661,12 +668,12 @@ eliminated.
661 668
 *  Fetch settings can be platform specific by using the `uname` as a file
662 669
    extension. e.g. repositories.Darwin. Other settings may follow, if the need
663 670
    arises. So far it hasn't.
664
-*  Added `embedded_repositories`` for those special moments, where you don't want
671
+*  Added `embedded_repositories` for those special moments, where you don't want
665 672
    to link another project, but just steal a few files. These gits are installed
666 673
    in your projects root and they are not built. You can not symlink them into
667 674
    your project, just clone them.
668 675
 *  Because I needed ancient and dying svn for MulleScion,  you can now remap
669
-   from the default git to svn, by creating a file <reponame>.scm. That contains
676
+   from the default git to svn, by creating a file `<reponame>.scm`. That contains
670 677
   the string "svn" then.
671 678
 *  *** Renamed "gits" to "repositories" ***
672 679
 *  Use mulle-bootstrap convert-pre.0.10 ~/src to convert all .bootstrap folders
... ...
@@ -708,7 +715,7 @@ eliminated.
708 715
 
709 716
 ## 0.9
710 717
 
711
-*  Specifying repos with mulle-bootstrap build <repos> was broken.
718
+*  Specifying repos with `mulle-bootstrap build <repos>` was broken.
712 719
 *  Added -y option, so everything is answered YES. I use this all the time.
713 720
 *  Log xcodebuild command line into logfile.
714 721
 *  Fix useless errors during dry run.
715 722
new file mode 100644
... ...
@@ -0,0 +1,71 @@
1
+# How to use the mulle-bootstrap bash function libraries in your code
2
+
3
+
4
+main()
5
+{
6
+   local MULLE_FLAG_EXEKUTOR_DRY_RUN="NO"
7
+   local MULLE_FLAG_LOG_DEBUG="NO"
8
+   local MULLE_FLAG_LOG_EXEKUTOR="NO"
9
+   local MULLE_FLAG_LOG_TERSE="NO"
10
+   local MULLE_TRACE
11
+   local MULLE_TRACE_POSTPONE="NO"
12
+
13
+   while [ $# -ne 0 ]
14
+   do
15
+      if core_technical_flags "$1"
16
+      then
17
+         shift
18
+         continue
19
+      fi
20
+
21
+      # your option handling
22
+      case "$1" in
23
+         -*)
24
+            fail "unknown option $1"
25
+         ;;
26
+
27
+         *)
28
+            break
29
+         ;;
30
+      esac
31
+
32
+      shift
33
+   done
34
+
35
+   core_setup_trace "${MULLE_TRACE}"
36
+
37
+   #####
38
+   ####
39
+   ### your code follows here
40
+   ##
41
+   #
42
+}
43
+
44
+
45
+_init()
46
+{
47
+   libexecpath="`mulle-bootstrap library-path 2> /dev/null`"
48
+   if [ -z "${libexecpath}" ]
49
+   then
50
+      echo "Fatal Error: Could not find mulle-bootstrap library for ${MULLE_EXECUTABLE}" >&2
51
+      exit 1
52
+   fi
53
+
54
+   . ${libexecpath}/mulle-bootstrap-logging.sh
55
+   . ${libexecpath}/mulle-bootstrap-functions.sh
56
+   . ${libexecpath}/mulle-bootstrap-core-options.sh
57
+}
58
+
59
+
60
+MULLE_EXECUTABLE="`basename -- "$0"`"
61
+MULLE_ARGUMENTS="$@"
62
+MULLE_EXECUTABLE_FAIL_PREFIX="${MULLE_EXECUTABLE}"
63
+MULLE_EXECUTABLE_PID="$$"
64
+
65
+MULLE_EXECUTABLE_FUNCTIONS_MIN="3.9"
66
+MULLE_EXECUTABLE_FUNCTIONS_MAX="4"
67
+
68
+
69
+_init "$@"
70
+
71
+main "$@"
0 72
\ No newline at end of file
... ...
@@ -30,11 +30,16 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33
-MULLE_EXECUTABLE_VERSION_MINOR=8
34
-MULLE_EXECUTABLE_VERSION_PATCH=5
33
+MULLE_EXECUTABLE_VERSION_MINOR=9
34
+MULLE_EXECUTABLE_VERSION_PATCH=0
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37
 
38
+
39
+MULLE_EXECUTABLE_FUNCTIONS_MIN="3.9"
40
+MULLE_EXECUTABLE_FUNCTIONS_MAX="4"
41
+
42
+
38 43
 #
39 44
 # This is the main user interface to mulle-bootstrap
40 45
 # sorta like git
... ...
@@ -278,10 +283,10 @@ bootstrap_init()
278 283
    . mulle-bootstrap-local-environment.sh || fail "not loaded"
279 284
 
280 285
    trap trap_fail INT
281
-
282
-   # source_environment
286
+   set -o pipefail
283 287
 }
284 288
 
289
+
285 290
 bootstrap_cd_projectpath()
286 291
 {
287 292
    local  orgpwd
... ...
@@ -648,9 +653,6 @@ MULLE_EXECUTABLE_FAIL_PREFIX="${MULLE_EXECUTABLE}"
648 653
 MULLE_EXECUTABLE_PID="$$"
649 654
 export MULLE_EXECUTABLE_PID
650 655
 
651
-MULLE_EXECUTABLE_FUNCTIONS_MIN="3.5"
652
-MULLE_EXECUTABLE_FUNCTIONS_MAX="4"
653
-
654 656
 
655 657
 bootstrap_init "$@" # needs params
656 658
 
... ...
@@ -1340,6 +1340,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1340 1340
 }
1341 1341
 
1342 1342
 
1343
+
1343 1344
 _xcode_get_setting()
1344 1345
 {
1345 1346
    eval_exekutor "xcodebuild -showBuildSettings $*" || fail "failed to read xcode settings"
... ...
@@ -1348,12 +1349,11 @@ _xcode_get_setting()
1348 1349
 
1349 1350
 xcode_get_setting()
1350 1351
 {
1351
-   local key
1352
-
1353
-   key="$1"
1354
-   shift
1352
+   local key=$1; shift
1355 1353
 
1356 1354
    _xcode_get_setting "$@" | egrep "^[ ]*${key}" | sed 's/^[^=]*=[ ]*\(.*\)/\1/'
1355
+
1356
+   return 0
1357 1357
 }
1358 1358
 
1359 1359
 
... ...
@@ -1364,18 +1364,14 @@ xcode_get_setting()
1364 1364
 #
1365 1365
 create_mangled_header_path()
1366 1366
 {
1367
-   local name
1368
-   local key
1369
-   local default
1370
-
1371
-   key="$1"
1372
-   name="$2"
1373
-   default="$3"
1367
+   local key="$1"
1368
+   local name="$2"
1369
+   local default="$3"
1374 1370
 
1375 1371
    local headers
1376 1372
 #   local prefix
1377 1373
 
1378
-   headers=`xcode_get_setting "${key}" $*` || exit 1
1374
+   headers="`xcode_get_setting "${key}" $*`"
1379 1375
    log_fluff "${key} read as \"${headers}\""
1380 1376
 
1381 1377
    case "${headers}" in
... ...
@@ -1692,7 +1688,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1692 1688
       #
1693 1689
       # TODO: need to figure out the correct mapping here
1694 1690
       #
1695
-      inherited="`xcode_get_setting HEADER_SEARCH_PATHS ${arguments}`" || exit 1
1691
+      inherited="`xcode_get_setting HEADER_SEARCH_PATHS ${arguments}`"
1696 1692
       path=`combined_escaped_search_path \
1697 1693
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}/${HEADER_DIR_NAME}" \
1698 1694
 "${owd}/${REFERENCE_ADDICTIONS_DIR}/${HEADER_DIR_NAME}"`
... ...
@@ -1703,7 +1699,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1703 1699
          dependencies_header_search_path="${path} ${inherited}"
1704 1700
       fi
1705 1701
 
1706
-      inherited="`xcode_get_setting LIBRARY_SEARCH_PATHS ${arguments}`" || exit 1
1702
+      inherited="`xcode_get_setting LIBRARY_SEARCH_PATHS ${arguments}`"
1707 1703
       path=`combined_escaped_search_path_if_exists \
1708 1704
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}" \
1709 1705
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}" \
... ...
@@ -1727,7 +1723,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1727 1723
          dependencies_lib_search_path="${path} ${USR_LOCAL_LIB}"
1728 1724
       fi
1729 1725
 
1730
-      inherited="`xcode_get_setting FRAMEWORK_SEARCH_PATHS ${arguments}`" || exit 1
1726
+      inherited="`xcode_get_setting FRAMEWORK_SEARCH_PATHS ${arguments}`"
1731 1727
       path=`combined_escaped_search_path_if_exists \
1732 1728
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}" \
1733 1729
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}" \
... ...
@@ -2200,6 +2196,8 @@ build_wrapper()
2200 2196
    then
2201 2197
       log_fluff "Remove \"${BUILD_DEPENDENCIES_DIR}\""
2202 2198
       rmdir_safer "${BUILD_DEPENDENCIES_DIR}"
2199
+   else
2200
+      log_fluff "Not removing \"${BUILD_DEPENDENCIES_DIR}\" because of \"${COMMAND}\""
2203 2201
    fi
2204 2202
 
2205 2203
    DEPENDENCIES_DIR="${REFERENCE_DEPENDENCIES_DIR}"
... ...
@@ -2231,6 +2229,12 @@ force_rebuild()
2231 2229
       return
2232 2230
    fi
2233 2231
 
2232
+   if [ -z "${from}" -a -z "${to}" ]
2233
+   then
2234
+      remove_file_if_present "${REPOS_DIR}/.build_done"
2235
+      return
2236
+   fi
2237
+
2234 2238
    #
2235 2239
    # keep entries above parameter
2236 2240
    # os x doesn't have 'Q'
... ...
@@ -2564,7 +2568,8 @@ build_main()
2564 2568
       log_fluff "Cleaning dependencies directory as \"${DEPENDENCIES_DIR}\""
2565 2569
       rmdir_safer "${DEPENDENCIES_DIR}"
2566 2570
    else
2567
-      if [ ! -z "${OPTION_FROM}" -o ! -z "${OPTION_TO}" ]
2571
+      if [ "${MULLE_FLAG_MAGNUM_FORCE}" != "NONE" ] || \
2572
+         [ ! -z "${OPTION_FROM}" -o ! -z "${OPTION_TO}" ]
2568 2573
       then
2569 2574
          force_rebuild "${OPTION_FROM}" "${OPTION_TO}"
2570 2575
       fi
... ...
@@ -66,7 +66,7 @@ core_setup_trace()
66 66
          MULLE_FLAG_LOG_EXEKUTOR="YES"
67 67
          MULLE_FLAG_LOG_FLUFF="YES"
68 68
          MULLE_FLAG_LOG_VERBOSE="YES"
69
-         bootstrap_dump_env
69
+         core_dump_env
70 70
       ;;
71 71
 
72 72
       1848)
... ...
@@ -75,9 +75,9 @@ core_setup_trace()
75 75
          MULLE_FLAG_LOG_VERBOSE="YES"
76 76
          MULLE_FLAG_VERBOSE_BUILD="YES"
77 77
 
78
-         bootstrap_dump_env
78
+         core_dump_env
79 79
 
80
-         if [ "${MULLE_TRACE_POSTPONE}" = "NO" ]
80
+         if [ "${MULLE_TRACE_POSTPONE}" != "YES" ]
81 81
          then
82 82
             log_trace "1848 trace (set -x) started"
83 83
             set -x
... ...
@@ -34,8 +34,8 @@
34 34
 
35 35
 MULLE_BOOTSTRAP_FUNCTIONS_SH="included"
36 36
 
37
-MULLE_BOOTSTRAP_FUNCTIONS_VERSION_MINOR="5"
38 37
 MULLE_BOOTSTRAP_FUNCTIONS_VERSION_MAJOR="3"
38
+MULLE_BOOTSTRAP_FUNCTIONS_VERSION_MINOR="9"
39 39
 
40 40
 MULLE_BOOTSTRAP_FUNCTIONS_VERSION="${MULLE_BOOTSTRAP_FUNCTIONS_VERSION_MAJOR}.${MULLE_BOOTSTRAP_FUNCTIONS_VERSION_MINOR}"
41 41
 
... ...
@@ -1392,3 +1392,5 @@ functions_initialize()
1392 1392
 
1393 1393
 
1394 1394
 functions_initialize
1395
+
1396
+:
... ...
@@ -154,8 +154,9 @@ stacktrace()
154 154
 
155 155
 _bail()
156 156
 {
157
-   # should kill process group...
158
-   kill 0
157
+#   should kill process group...
158
+#   kills calling shell too though
159
+#   kill 0
159 160
 
160 161
 #   if [ ! -z "${MULLE_EXECUTABLE_PID}" ]
161 162
 #   then
... ...
@@ -166,8 +167,7 @@ _bail()
166 167
 #      fi
167 168
 #   fi
168 169
 
169
-   exit 1        # paranoia
170
-   # don't ask me why the fail message is printed twice
170
+   exit 1
171 171
 }
172 172
 
173 173
 
... ...
@@ -274,3 +274,5 @@ logging_initialize()
274 274
 }
275 275
 
276 276
 logging_initialize "$@"
277
+
278
+: