Menu

Major regression with the build of a whole source repository

wpkg
2016-05-01
2016-06-07
  • Mathieu SCHROETER

    Hello,

    With the current HEAD, there is a major regression with the build of a source repository.

    The -src packages are no longer removed if at least one package was already installed in the --root.

    I've hacked the sample7 in order to reproduce the problem. It's easy.. see the attached archive.

    The main script:

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    #!/bin/sh
    #
    # Name: build.linux
    #
    # The build.linux script is likely to work in other Unices although
    # it was not tested.
    #
    
    ############################################################################
    echo "***"
    echo "*** Prepare environment from scratch"
    echo "***"
    
    ###
    # You probably want to edit these variables if you think they do not
    # match your system installation
    export SOURCE=`pwd`
    export PATH=$PATH:`pwd`/../../../BUILD/dist/usr/bin
    export LD_LIBRARY_PATH=`pwd`/../../../BUILD/dist/usr/lib
    export VERSION=1.2.8
    export ARCH=amd64
    export REPOSITORY_PATH=$(pwd)/repo
    
    ###
    # The script always starts from the beginning, just comment out
    # parts if you do not want to lose all and rebuild all, although
    # compile the z library is generally fast
    rm -rf BUILD
    
    ###
    # This rm is commented out by default because it should not be in
    # effect; we use it when we use the --debug 0100 to keep the temporary
    # files and thus to avoid seeing entries from older runs
    rm -rf /tmp/wpkg-*
    
    ###
    # Create a BUILD directory with:
    #   install -- installation directory to install the source to compile
    #              and its dependencies
    mkdir -p BUILD/install/var/lib/wpkg
    
    ###
    
    # Create an empty repository
    mkdir "$REPOSITORY_PATH"
    
    ###
    # Create an installation environment, used to do the build and test the
    # installation.
    # 
    wpkg --root $SOURCE/BUILD/install --create-admindir admindir.control
    
    ############################################################################
    echo "***"
    echo "*** Build source package (a .deb with the source tarball)"
    echo "***"
    
    ###
    # Create a source package with wpkg; change the PATH at the top
    # to include the location where you have wpkg compiled unless
    # you installed it and it already is in your path.
    #
    # Use "--build" without a directory or .deb filename to build source.
    #
    # Add "--debug 0100" to keep the temporary files when wpkg exists.
    #
    cd zlib
    wpkg --field-variables VERSION=$VERSION --build --output-repository-dir "$REPOSITORY_PATH"
    cd ..
    
    ############################################################################
    echo "***"
    echo "*** Build binary package"
    echo "***"
    
    ###
    # Create a binary package with wpkg
    wpkg --build ./toto --output-repository-dir "$REPOSITORY_PATH"
    
    ############################################################################
    echo "***"
    echo "*** Install binary package (using the .deb file)"
    echo "***"
    wpkg --root $SOURCE/BUILD/install --install "$REPOSITORY_PATH/wpkg/toto_0.1.0_linux-amd64.deb"
    
    ############################################################################
    echo "***"
    echo "*** Build binary package (a .deb using the source .deb file)"
    echo "***"
    
    ###
    # Now build the package by compiling all the sources in the repository.
    #
    # We could also build just that one package by specify the source .deb
    # file as in:
    #
    #    wpkg --build "$$REPOSITORY_PATH/sources/zlib-src_1.2.8.deb"
    #
    # You would also need to specify the --output-repository-dir option in
    # this case.
    #
    # Add "--debug 0100" to keep the temporary files when wpkg exists.
    #
    wpkg --build "$REPOSITORY_PATH" --root $SOURCE/BUILD/install
    

    And the result (last lines of log):

    -- Install configuration: ""
    -- Installing: /tmp/wpkg-31061/install/runtime/lib/libz.so.1.2
    -- Installing: /tmp/wpkg-31061/install/runtime/lib/libz.so.1
    -- Installing: /tmp/wpkg-31061/install/runtime/lib/libz.so
    -- Install configuration: ""
    -- Installing: /tmp/wpkg-31061/install/documentation/share/man/zlib.3
    -- Installing: /tmp/wpkg-31061/install/documentation/share/doc/zlib/zlib.3.pdf
    -- Installing: /tmp/wpkg-31061/install/documentation/share/doc/zlib/README
    -- Installing: /tmp/wpkg-31061/install/documentation/share/doc/zlib/FAQ
    -- Install configuration: ""
    -- Installing: /tmp/wpkg-31061/install/development/include/zconf.h
    -- Installing: /tmp/wpkg-31061/install/development/include/zlib.h
    -- Installing: /tmp/wpkg-31061/install/development/share/pkgconfig/zlib.pc
    wpkg:info: 2016/05/01 16:18:09: [package:zlib] building package "zlib" (build-package)
    wpkg:info: 2016/05/01 16:18:09: [package:zlib-doc] building package "zlib-doc" (build-package)
    wpkg:info: 2016/05/01 16:18:09: [package:zlib-dev] building package "zlib-dev" (build-package)
    wpkg:error: 2016/05/01 16:18:09: [package:zlib-src] package "zlib-src" is not installed and thus it cannot be removed, purged, or deconfigured. (2) (validate-removal)
    wpkg:error: 2016/05/01 16:18:09: [package:zlib-src] package "zlib-src" is not installed and thus it cannot be removed, purged, or deconfigured. (2) (validate-removal)
    wpkg --create-index /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo/index.tar.gz --recursive --repository /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo
    wpkg:info: 2016/05/01 16:18:09: add package "sources/zlib-src_1.2.8.ctrl" to this repository index file. (repository)
    wpkg:info: 2016/05/01 16:18:09: add package "wpkg/zlib_1.2.8_amd64.ctrl" to this repository index file. (repository)
    wpkg:info: 2016/05/01 16:18:09: add package "wpkg/zlib-doc_1.2.8_amd64.ctrl" to this repository index file. (repository)
    wpkg:info: 2016/05/01 16:18:09: add package "wpkg/toto_0.1.0_linux-amd64.ctrl" to this repository index file. (repository)
    wpkg:info: 2016/05/01 16:18:09: add package "wpkg/zlib-dev_1.2.8_amd64.ctrl" to this repository index file. (repository)
    wpkg:info: 2016/05/01 16:18:09: finalizing output file. (repository)
    wpkg:error: 2016/05/01 16:18:09: [package:zlib-src] system("wpkg  --root /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/BUILD/install --instdir /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/BUILD/install --admindir /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/BUILD/install/var/lib/wpkg --build /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo/sources/zlib-src_1.2.8.deb --output-repository-dir /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo --repository /home/schroeterm/devel/unigw-master/wpkg/samples/sample7/repo --create-index index.tar.gz --force-file-info --run-unit-tests --make-tool make --debug 0") called returned 256 (run-script)
    
     
  • Mathieu SCHROETER

    Juste decompress this archive in unigw-master/wpkg/samples/ then run ./build.linux,

     
  • Mathieu SCHROETER

    IMHO it's broken since cbaf9ef36252d99d96e53836a60ca930d643026a but I'm not 100% sure.

     
  • Alexis Wilke

    Alexis Wilke - 2016-05-02

    Hi Matthieu,

    I have something else I'm trying to finish and will come back to this later. Many things went on at some point last year and many things may not work exactly as before. Also quite a few things were fixed too.

    Thank you for your reports.

     
  • Mathieu SCHROETER

    Note that I use every days (on win, linux and darwin) the version 1.0.2. It's the best one. I've problems only since the version 1.0.3.

     

Log in to post a comment.