~gl-az/percona-xtrabackup/2.0-valgrind

« back to all changes in this revision

Viewing changes to utils/build.sh

  • Committer: George Lorch
  • Date: 2013-05-29 22:14:12 UTC
  • Revision ID: gl_az@yahoo.com-20130529221412-f364a3ugpgodt5zg
Added new environment variables to control build:
  MAKE_ONLY - Set this to 1 to only re 'make' the server and xtrabackup. Nothing will be downloaded, unpacked or patched. This is not advised if any compiler or other flags are being changed from previous builds.
  RELWITHDEBINFO - Set this to 1 to eliminate optimizations by changing C/CXXFLAGS to -g -O0 and pass CMAKE_BUILD_TYPE=RelWithDebInfo to PS or MySQL 5.5+ cmake.
  WITH_VALGRIND - Set this to 1 to perform Valgrind compatible build. Eliminates optimizations just like RELWITHDEBINFO and also passes WITH_VALGRIND=ON to PS or MySQL 5.5+ cmake.
Added innobackupex option --use-valgrind which will prefix backup and apply-log calls to xtrabackup with "valgrind".
The valgrind binary must be within path and valgrind options may be set by either using the ~/.valgrindrc file or setting the environment variable VALGRIND_OPTS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        ;;
37
37
esac
38
38
 
 
39
if [ -n "$WITH_VALGRIND" ]; then
 
40
    export CFLAGS="$CFLAGS -g -O0"
 
41
    export CXXFLAGS="$CXXFLAGS -g -O0"
 
42
    extra_config_51=
 
43
    extra_config_55plus="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_VALGRIND=ON"
 
44
elif [ -n "$RELWITHDEBINFO" ]; then
 
45
    export CFLAGS="$CFLAGS -g -O0"
 
46
    export CXXFLAGS="$CXXFLAGS -g -O0"
 
47
    extra_config_51=
 
48
    extra_config_55plus="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
39
49
# Percona Server 5.5 does not build with -Werror, so ignore DEBUG for now
40
 
if [ -n "$DEBUG" -a "$type" != "xtradb55" -a "$type" != "xtradb51" ]
 
50
elif [ -n "$DEBUG" -a "$type" != "xtradb55" -a "$type" != "xtradb51" ]
41
51
then
42
52
    # InnoDB extra debug flags
43
53
    innodb_extra_debug="-DUNIV_DEBUG -DUNIV_SYNC_DEBUG -DUNIV_MEM_DEBUG \
208
218
    server_tarball=mysql-$mysql_version.tar.gz
209
219
    innodb_dir=$server_dir/storage/$innodb_name
210
220
 
211
 
    echo "Downloading sources"
212
 
    auto_download $server_tarball
213
 
 
214
 
    test -d $server_dir && rm -r $server_dir
215
 
 
216
 
    echo "Preparing sources"
217
 
    unpack_and_patch $server_tarball $server_patch
218
 
    mv $top_dir/mysql-$mysql_version $server_dir
 
221
    if [ -z "$MAKE_ONLY" ]
 
222
    then
 
223
        echo "Downloading sources"
 
224
        auto_download $server_tarball
 
225
 
 
226
        test -d $server_dir && rm -r $server_dir
 
227
 
 
228
        echo "Preparing sources"
 
229
        unpack_and_patch $server_tarball $server_patch
 
230
        mv $top_dir/mysql-$mysql_version $server_dir
 
231
    fi
219
232
 
220
233
    build_server $type
221
234
 
309
322
        fi
310
323
 
311
324
 
312
 
        echo "Downloading sources"
 
325
        if [ -z "$MAKE_ONLY" ]
 
326
        then
 
327
                echo "Downloading sources"
313
328
        
314
 
        # Get Percona Server
315
 
        if [ -d $branch_dir ]
316
 
        then
317
 
            rm -rf $branch_dir
318
 
        fi
319
 
        if [ -d $branch_dir ]
320
 
        then
321
 
            cd $branch_dir
322
 
            (bzr upgrade || true)
323
 
            bzr clean-tree --force --ignored
324
 
            bzr revert
325
 
            bzr pull --overwrite
 
329
                # Get Percona Server
 
330
                if [ -d $branch_dir ]
 
331
                then
 
332
                    rm -rf $branch_dir
 
333
                fi
 
334
                if [ -d $branch_dir ]
 
335
                then
 
336
                    cd $branch_dir
 
337
                    (bzr upgrade || true)
 
338
                    bzr clean-tree --force --ignored
 
339
                    bzr revert
 
340
                    bzr pull --overwrite
 
341
                else
 
342
                    bzr branch -r tag:Percona-Server-$PS_51_VERSION \
 
343
                        lp:percona-server/5.1 $branch_dir
 
344
                    cd $branch_dir
 
345
                fi
 
346
 
 
347
                $MAKE_CMD main
 
348
                cd $top_dir
 
349
                rm -rf $server_dir
 
350
                ln -s $branch_dir/Percona-Server $server_dir
 
351
 
 
352
                # Patch Percona Server
 
353
                cd $server_dir
 
354
                patch -p1 < $top_dir/patches/xtradb51.patch
 
355
 
 
356
                build_server $type
 
357
 
 
358
                build_xtrabackup
326
359
        else
327
 
            bzr branch -r tag:Percona-Server-$PS_51_VERSION \
328
 
                lp:percona-server/5.1 $branch_dir
329
 
            cd $branch_dir
 
360
                cd $server_dir
 
361
 
 
362
                build_server $type
 
363
 
 
364
                build_xtrabackup
330
365
        fi
331
 
 
332
 
        $MAKE_CMD main
333
 
        cd $top_dir
334
 
        rm -rf $server_dir
335
 
        ln -s $branch_dir/Percona-Server $server_dir
336
 
 
337
 
        # Patch Percona Server
338
 
        cd $server_dir
339
 
        patch -p1 < $top_dir/patches/xtradb51.patch
340
 
 
341
 
        build_server $type
342
 
 
343
 
        build_xtrabackup
344
 
 
345
366
        ;;
346
367
"xtradb55" )
347
368
        server_dir=$top_dir/Percona-Server-5.5
362
383
        fi
363
384
 
364
385
 
365
 
        echo "Downloading sources"
 
386
        if [ -z "$MAKE_ONLY" ]
 
387
        then
 
388
                echo "Downloading sources"
366
389
        
367
 
        # Get Percona Server
368
 
        if [ -d $branch_dir ]
369
 
        then
370
 
            rm -rf $branch_dir
371
 
        fi
372
 
        if [ -d $branch_dir ]
373
 
        then
374
 
            cd $branch_dir
375
 
            yes | bzr break-lock
376
 
            (bzr upgrade || true)
377
 
            bzr clean-tree --force --ignored
378
 
            bzr revert
379
 
            bzr pull --overwrite
 
390
                # Get Percona Server
 
391
                if [ -d $branch_dir ]
 
392
                then
 
393
                    rm -rf $branch_dir
 
394
                fi
 
395
                if [ -d $branch_dir ]
 
396
                then
 
397
                    cd $branch_dir
 
398
                    yes | bzr break-lock
 
399
                    (bzr upgrade || true)
 
400
                    bzr clean-tree --force --ignored
 
401
                    bzr revert
 
402
                    bzr pull --overwrite
 
403
                else
 
404
                    bzr branch -r tag:Percona-Server-$PS_55_VERSION \
 
405
                        lp:percona-server $branch_dir
 
406
                    cd $branch_dir
 
407
                fi
 
408
 
 
409
                $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
 
410
                cd $top_dir
 
411
                rm -rf $server_dir
 
412
                ln -s $branch_dir/Percona-Server $server_dir
 
413
 
 
414
                # Patch Percona Server
 
415
                cd $server_dir
 
416
                patch -p1 < $top_dir/patches/xtradb55.patch
 
417
 
 
418
                build_server $type
 
419
 
 
420
                build_xtrabackup
380
421
        else
381
 
            bzr branch -r tag:Percona-Server-$PS_55_VERSION \
382
 
                lp:percona-server $branch_dir
383
 
            cd $branch_dir
 
422
                cd $server_dir
 
423
 
 
424
                build_server $type
 
425
 
 
426
                build_xtrabackup
384
427
        fi
385
 
 
386
 
        $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
387
 
        cd $top_dir
388
 
        rm -rf $server_dir
389
 
        ln -s $branch_dir/Percona-Server $server_dir
390
 
 
391
 
        # Patch Percona Server
392
 
        cd $server_dir
393
 
        patch -p1 < $top_dir/patches/xtradb55.patch
394
 
 
395
 
        build_server $type
396
 
 
397
 
        build_xtrabackup
398
 
 
399
428
        ;;
400
429
*)
401
430
        usage