Announcement

Collapse
No announcement yet.

Building on linux , no install.log

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Building on linux , no install.log

    Hi All,
    We were building an NSIS installer on a linux container using the NSIS logging build(2.46). Everything was working fine till now with the installer generating an install.log file when it is run. We updated our base container image with new JDK and now the installer that is being built is no longer producing the install.log. I don't see how the JDK and NSIS are tied together. This is what I use to build the NSIS in the linux container.

    RUN mkdir /tmp/nsis &&\
    yum install -y ca-certificates &&\
    wget https://jaist.dl.sourceforge.net/pro...sis-3.02.1.zip -P /tmp/nsis/ &&\
    wget https://jaist.dl.sourceforge.net/pro....1-src.tar.bz2 -P /tmp/nsis/ &&\
    yum install -y scons glibc-devel glibc-devel.i686 &&\
    unzip /tmp/nsis/nsis-3.02.1.zip -d /usr/local/ &&\
    mv /usr/local/nsis-* /usr/local/nsis &&\
    tar -xvf /tmp/nsis/nsis-3.02.1-src.tar.bz2 -C /usr/local/src/ &&\
    mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
    cd /usr/local/src/nsis &&\
    echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
    scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
    ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
    yum clean all &&\
    rm -rf /var/cache/yum &&\
    rm -rf /tmp/*

    ### we basically add the custom dialogs and plugins from our NSIS logging build here.
    COPY 2.46.zip /tmp/
    RUN mkdir /usr/local/nsis/p4thirdparty &&\
    cd /usr/local/nsis/p4thirdparty &&\
    unzip /tmp/2.46.zip &&\
    cp -f Plugins/*.dll ../Plugins/x86-ansi/ &&\
    cp -f Plugins/x86-ansi/*.dll ../Plugins/x86-ansi/ &&\
    cp -rf Examples/* ../Examples/ &&\
    cp -rf Stubs/* ../Stubs/ &&\
    cp -rf Include/* ../Include/ &&\
    cp -rf Contrib/* ../Contrib/ &&\
    rm -rf /tmp/* &&\
    rm -rf /usr/local/nsis/p4thirdparty

  • #2
    The docs tell you to pass NSIS_CONFIG_LOG=yes to scons as a parameter.

    Anyway, we don't support mixing different versions. If you want NSIS 3 you also have to find stubs and plugins that match the exact version. If you don't care about Unicode you could compile 2.xx instead I guess.

    Not sure why the JDK would trigger this, we don't use Java at all.
    IntOp $PostCount $PostCount + 1

    Comment


    • #3
      Thank you Anders for the reply. This code has remained unchanged for over 2 years now. I am trying to debug why it wouldn't generate a log suddenly now. I will certainly try to pass that parameter and keep the NSIS versions similar and see how it goes.

      Comment


      • #4
        Error building the nsis src from 2.46

        Hi Anders,

        So I changed the code to use nsis 2.46, so this is what I am basically doing:
        The {docker_image_nsis_thirdparty_zip} is basically my nsis-2.46.zip with the logging build. the {docker_image_nsis_src_download_url} is the url for the nsis-2.46 source code that I get from here:


        COPY {{ docker_image_nsis_thirdparty_zip }} /tmp/
        RUN mkdir /tmp/nsis &&\
        yum install -y ca-certificates &&\
        wget {{ docker_image_nsis_src_download_url }} -P /tmp/nsis/ &&\
        yum install -y scons glibc-devel glibc-devel.i686 &&\
        unzip /tmp/{{ docker_image_nsis_thirdparty_zip }} -d /usr/local/nsis/ &&\
        tar -xvf /tmp/nsis/{{ docker_image_nsis_src_download_url|basename }} -C /usr/local/src/ &&\
        mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
        cd /usr/local/src/nsis &&\
        echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
        scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_LOG=yes NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
        ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
        yum clean all &&\
        rm -rf /var/cache/yum &&\
        rm -rf /tmp/*


        When I run this on RHEL, this is the error I get, when running the scons command:

        g++ -o Source/ResourceVersionInfo.o -c -Wno-non-virtual-dtor -Wall -O2 -m32 "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 -Ibuild/release/config Source/ResourceVersionInfo.cpp
        g++ -o Source/script.o -c -Wno-non-virtual-dtor -Wall -O2 -m32 "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 -Ibuild/release/config Source/script.cpp
        In file included from Source/script.cpp:22:0:
        Source/util.h: In instantiation of 'void __free_with_close:perator()(T&) [with T = int]':
        Source/util.h:114:32: required from 'ResourceManager<_RESOURCE, _FREE_RESOURCE>::~ResourceManager() [with _RESOURCE = int; _FREE_RESOURCE = __free_with_close]'
        Source/script.cpp:6460:1: required from here
        Source/util.h:128:59: error: 'close' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
        template <typename T> void operator()(T& x) { freefunc(x); } \
        ^
        Source/util.h:145:1: note: in expansion of macro 'RM_DEFINE_FREEFUNC'
        RM_DEFINE_FREEFUNC(close);
        ^
        In file included from Source/script.cpp:46:0:
        /usr/include/unistd.h:353:12: note: 'int close(int)' declared here, later in the translation unit
        extern int close (int __fd);
        ^
        scons: *** [Source/script.o] Error 1
        scons: building terminated because of errors.

        Comment


        • #5
          2.46 is 13 years old and not something we support nor recommend using, especially if you don't pair it with a compiler from the same era. I'll try to look at the code later but perhaps it's time to move to 3.x?
          IntOp $PostCount $PostCount + 1

          Comment


          • #6
            I will try to upgrade nsis to a newer version 3.x and retry the same scenario.

            Comment


            • #7
              Originally Posted by pkonduru View Post

              When I run this on RHEL, this is the error I get, when running the scons command:
              Try adding

              #include <unistd.h>

              near the top of /Source/util.h after the other #includes...
              IntOp $PostCount $PostCount + 1

              Comment


              • #8
                Thank you Anders, I tried that but it gave this error.
                First, here is my script:

                COPY {{ docker_image_nsis_thirdparty_zip }} /tmp/
                RUN mkdir /tmp/nsis &&\
                yum install -y ca-certificates &&\
                wget {{ docker_image_nsis_src_download_url }} -P /tmp/nsis/ &&\
                yum install -y scons glibc-devel glibc-devel.i686 &&\
                unzip /tmp/{{ docker_image_nsis_thirdparty_zip }} -d /usr/local/nsis/ &&\
                tar -xvf /tmp/nsis/{{ docker_image_nsis_src_download_url|basename }} -C /usr/local/src/ &&\
                mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
                cd /usr/local/src/nsis &&\
                echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
                echo "#include <unistd.h>" >> /usr/local/src/nsis/Source/util.h &&\
                scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_LOG=yes NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
                ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
                yum clean all &&\
                rm -rf /var/cache/yum &&\
                rm -rf /tmp/*


                This is the error I get:

                g++ -o Source/script.o -c -Wno-non-virtual-dtor -Wall -O2 -m32 "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 -Ibuild/release/config Source/script.cpp
                In file included from Source/script.cpp:22:0:
                Source/util.h: In instantiation of 'void __free_with_close:perator()(T&) [with T = int]':
                Source/util.h:114:32: required from 'ResourceManager<_RESOURCE, _FREE_RESOURCE>::~ResourceManager() [with _RESOURCE = int; _FREE_RESOURCE = __free_with_close]'
                Source/script.cpp:6460:1: required from here
                Source/util.h:128:59: error: 'close' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
                template <typename T> void operator()(T& x) { freefunc(x); } \
                ^
                Source/util.h:145:1: note: in expansion of macro 'RM_DEFINE_FREEFUNC'
                RM_DEFINE_FREEFUNC(close);
                ^
                In file included from Source/util.h:159:0,
                from Source/script.cpp:22:
                /usr/include/unistd.h:353:12: note: 'int close(int)' declared here, later in the translation unit
                extern int close (int __fd);
                ^
                scons: *** [Source/script.o] Error 1
                scons: building terminated because of errors.

                Comment


                • #9
                  Echo >> will append? It needs to be at the top of the file.
                  IntOp $PostCount $PostCount + 1

                  Comment


                  • #10
                    Thank you Anders, I will add it at the beginning and let you know how it goes

                    Comment


                    • #11
                      error log

                      I added the line at the beginning using this:

                      sed -i '17i#include <unistd.h>' /usr/local/src/nsis/Source/util.h

                      basically add at line 17 where the file starts after the comments.
                      This is the errors I got. I am attaching afile with the errors as it is not letting me post it as text.
                      Attached Files

                      Comment


                      • #12
                        Hi Anders,
                        I upgraded my nsis to 3.08 and everything went fine while building the source code on linux using scons. But when I am building my .nsi file on the linux machine this is the error that I see. Any pointers on what can be done?

                        $ makensis -V3 -DVERSION_MAJOR=$VERSION_MAJOR -DVERSION_MINOR=$VERSION_MINOR -DVERSION_RELEASE=$VERSION_RELEASE -DBUILD_NUMBER=$CI_PIPELINE_ID -DEXTERNAL_VER="$EXTERNAL_VER" -DINSTALLER_EXT_VER="$INSTALLER_EXT_VER" $CI_PROJECT_DIR/WI/FoundationSetup.nsi
                        Error: reading stub "/usr/local/nsis/Stubs/zlib-x86-unicode"
                        Error initalizing CEXEBuild: error setting default stub


                        By the way this what I have done to build nsis on linux:
                        Where {docker_image_nsis_thirdparty_zip } is the nsis-3.08 build with the logging components inside.
                        { docker_image_nsis_src_download_url } is where I get the source code for nsis-3.08 from:



                        COPY {{ docker_image_nsis_thirdparty_zip }} /tmp/
                        RUN mkdir /tmp/nsis &&\
                        yum install -y ca-certificates &&\
                        wget {{ docker_image_nsis_src_download_url }} -P /tmp/nsis/ &&\
                        yum install -y scons glibc-devel glibc-devel.i686 &&\
                        unzip /tmp/{{ docker_image_nsis_thirdparty_zip }} -d /usr/local/nsis/ &&\
                        tar -xvf /tmp/nsis/{{ docker_image_nsis_src_download_url|basename }} -C /usr/local/src/ &&\
                        mv /usr/local/src/nsis-* /usr/local/src/nsis &&\
                        cd /usr/local/src/nsis &&\
                        echo "#define NSIS_CONFIG_LOG" >> /usr/local/src/nsis/Source/exehead/config.h &&\
                        scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_LOG=yes NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/usr/local/nsis/bin install-compiler &&\
                        ln -s /usr/local/nsis/bin/makensis /usr/local/bin/makensis &&\
                        yum clean all &&\
                        rm -rf /var/cache/yum &&\
                        rm -rf /tmp/*
                        Last edited by pkonduru; 1 June 2022, 05:21.

                        Comment


                        • #13
                          To ask a stupid question, does "/usr/local/nsis/Stubs/zlib-x86-unicode" exist? If not then you need to grab those files from https://sourceforge.net/projects/nsi...-fra&download= (https://nsis.sourceforge.io/Special_Builds#)
                          IntOp $PostCount $PostCount + 1

                          Comment


                          • #14
                            aah, I see what you are saying, basically in the nsis-3.08-log.zip there is no separate folder zlib-x86-unicode. All the files are under Stubs. Should I create a folder zlib-x86-unicode and put all the unicode files in there?
                            or are you asking if that file exists? It does exist in my stubs folder.

                            Comment


                            • #15
                              Do you think I should add these to the SCONS command "build_static=1 build_dynamic=0 UNICODE=yes"?

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎