Announcement

Collapse
No announcement yet.

scons build on debian

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

  • scons build on debian

    scons (0.96.1-1) build result on debian is below. Seems scons treats errors as warnings on debian, is there a way to disable this?

    [email protected]:~/devel/debian/nsis/NSIS$ scons -j4 MINGWPREFIX=i586-mingw32msvc CPPPATH=/usr/i586-mingw32msvc/include LIBPATH=/usr/i586-mingw32msvc/lib/
    scons: Reading SConscript files ...
    Using GNU tools configuration
    Checking for main() in C library gdi32... no
    Checking for main() in C library user32... no
    Checking for main() in C library version... no
    Checking for main() in C library pthread... no
    Checking for main() in C library stdc++... no
    Checking for main() in C library iconv... no
    Checking for main() in C library libiconv... no
    scons: done reading SConscript files.
    scons: Building targets ...
    i586-mingw32msvc-g++ -O2 -Wall -I/usr/i586-mingw32msvc/include -c -o build/release/Library/LibraryLocal/LibraryLocal.o Contrib/Library/LibraryLocal/LibraryLocal.cpp
    i586-mingw32msvc-g++ -O2 -Wall -I/usr/i586-mingw32msvc/include -c -o build/release/MakeLangId/MakeLangId.o Contrib/MakeLangId/MakeLangId.cpp
    scons: *** [build/release/MakeLangId/resource.o] Exception
    Traceback (most recent call last):
    File "/usr/lib/scons/SCons/Taskmaster.py", line 101, in execute
    self.targets[0].build()
    File "/usr/lib/scons/SCons/Node/__init__.py", line 201, in build
    apply(executor, (self, errfunc), kw)
    File "/usr/lib/scons/SCons/Executor.py", line 115, in __call__
    apply(action, (self.targets, self.sources, env, errfunc), kw)
    File "/usr/lib/scons/SCons/Action.py", line 239, in __call__
    s = self.strfunction(target, source, env)
    TypeError: 'str' object is not callable
    Contrib/MakeLangId/MakeLangId.cpp: In function `BOOL DialogProc(HWND__*, UINT, WPARAM, LPARAM)':
    Contrib/MakeLangId/MakeLangId.cpp:191: warning: comparison between signed and unsigned integer expressions
    Contrib/MakeLangId/MakeLangId.cpp:193: warning: comparison between signed and unsigned integer expressions
    Contrib/MakeLangId/MakeLangId.cpp:241:2: warning: no newline at end of file
    scons: building terminated because of errors.
    bye,
    pabs

  • #2
    SCons doesn't treat warnings as errors. An error is raised when a tool returns a value different than 0. In your case, the error is a few lines above. The printing might get a little mixed if you use -j.

    As for the error itself, mind runing scons with --debug=pdb and seeing what string it tries to call there?
    NSIS FAQ | NSIS Home Page | Donate $
    "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

    Comment


    • #3
      Hmm, now I'm getting this:

      [email protected]:~/devel/debian/nsis/NSIS$ scons MINGWPREFIX=i586-mingw32msvc CPPPATH=/usr/i586-mingw32msvc/include LIBPATH=/usr/i586-mingw32msvc/lib/
      <snip>
      i586-mingw32msvc-ld -s -mwindows -Wl,--file-alignment,512 -Wl,-Map,LibraryLocal.map -o build/release/Library/LibraryLocal/LibraryLocal build/release/Library/LibraryLocal/LibraryLocal.o -L/usr/i586-mingw32msvc/lib -lkernel32 -loleaut32 -lversion
      i586-mingw32msvc-ld: unrecognised emulation mode: windows
      Supported emulations: i386pe
      scons: *** [build/release/Library/LibraryLocal/LibraryLocal] Error 1
      scons: building terminated because of errors.

      Using i586-mingw32msvc-g++ for linking fixes this.

      Printing the value of self.strfunction in Action.py gives "$RCCOMSTR". Either way, I don't think strings can be called in python.

      Also, does scons have an equivalent of make clean?
      bye,
      pabs

      Comment


      • #4
        I've fixed the configuration to use g++ for linking instead of ld. In SCons/Config/gnu change line number 24.

        As for RCCOMSTR, I have no idea where SCons creates it. It uses it, but no where it seems to create it. Try removing the parameter using it in SCons/Config/gnu on line 15 and let me know if it works.

        To clean using SCons, use -c. To see all available command line options, use -H.
        NSIS FAQ | NSIS Home Page | Donate $
        "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

        Comment


        • #5
          I submitted a patch to fix building Contrib stuff.

          The problem I come up against now, is that halibut is built with the include path specified in CPPPATH. I'm not sure how to solve this, but I think the stuff targeted at windows would use MINGW32CPPPATH, and the stuff targeted at the build os can use CPPPATH. It would be nice if CPPPATH could default to /usr/include on linux too.
          bye,
          pabs

          Comment


          • #6
            CPPPATH defauls to nothing which allows scons or gcc to use whatever it thinks that's required. Does it not find the right header files when you don't use CPPPATH?
            NSIS FAQ | NSIS Home Page | Donate $
            "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

            Comment


            • #7
              [email protected]:~/devel/debian/nsis/NSIS$ scons MINGWPREFIX=i586-mingw32msvc PREFIX=/usr/local
              scons: Reading SConscript files ...

              scons: *** Path does not exist for option CPPPATH:
              File "SConstruct", line 69, in ?

              I get a similar thing when ommiting PREFIX
              bye,
              pabs

              Comment


              • #8
                Options with an empty default value is a new feature of 0.96.90. Upgrade and those should disappear.
                NSIS FAQ | NSIS Home Page | Donate $
                "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

                Comment


                • #9
                  Ah, ok. Installed the deb, fixed that.

                  Now I have problems with halibut:

                  * _MAX_PATH isn't defined for bk_xhtml.c

                  * for some reason, the standard libs don't get linked into the binary, preventing linking due to unresolved symbols - fixed by emptying defenv['NODEFLIBS_FLAG'] in NSIS/SCons/Config/gnu

                  * the __main entry point isn't found - commenting lines 113/114 in NSIS/SCons/Config/gnu:
                  #ctx.env.Append(LINKFLAGS = '$NODEFLIBS_FLAG')
                  #ctx.env.Append(LINKFLAGS = '-Wl,-e,___main')

                  * it segfaults during building the docs - I'll work on this

                  * I get this error during building InstallOptions.dll:

                  [email protected]:~/devel/debian/nsis/NSIS$ scons MINGWPREFIX=i586-mingw32msvc
                  scons: Reading SConscript files ...
                  Using GNU tools configuration
                  Checking for memcpy requirement... (cached) yes
                  Checking for memset requirement... (cached) yes
                  Checking for main() in C library gdi32... (cached) no
                  <snip>
                  Contrib/InstallOptions/../ExDLL/exdll.h:103: warning: 'char* getuservariable(int)' defined but not used
                  Contrib/InstallOptions/../ExDLL/exdll.h:109: warning: 'void setuservariable(int, const char*)' defined but not used
                  i586-mingw32msvc-windres --include-dir Contrib/InstallOptions -i Contrib/InstallOptions/ioptdll.rc -o build/release/InstallOptions/ioptdll.o
                  scons: *** Source file: build/release/InstallOptions/ioptdll.o is static and is not compatible with shared target: build/release/InstallOptions/libInstallOptions.so
                  scons: building terminated because of errors.
                  (not that the windres call didn't actually fail, just scons doesn't like it)

                  * same with LangDLL, StartMenu

                  * Makensisw can't be built - undefined symbols: TBN_DROPDOWN , TBDDRET_DEFAULT, TBDDRET_NODEFAULT. _WIN32_IE needs defining as 0x0500 before commctrl.h is included in Contrib/Makensisw/makensisw.h

                  * Contrib/Math/Source/MyMath.c DBL_MAX_EXP, HUGE_VAL not defined. I placed a copy of the mingw math.h here: http://bonedaddy.net/pabs3/files/tmp/math.h

                  * Contrib/System: build errors:
                  586-mingw32msvc-gcc -Os -Wall -fPIC -DSYSTEM_EXPORTS -c -o build/release/System/Source/Buffers.os Contrib/System/Source/Buffers.c
                  Contrib/System/Source/Buffers.c:1: warning: -fPIC ignored for target (all code is position independent)
                  In file included from Contrib/System/Source/Buffers.c:1:
                  Contrib/System/Source/stdafx.h:13:27: warning: no newline at end of file
                  In file included from Contrib/System/Source/Buffers.c:3:
                  Contrib/System/Source/System.h:94: error: redefinition of typedef 'SystemProc'
                  Contrib/System/Source/System.h:75: error: previous declaration of 'SystemProc' was here
                  Contrib/System/Source/Buffers.c:11: error: redefinition of typedef 'TempStack'
                  Contrib/System/Source/Buffers.c:6: error: previous declaration of 'TempStack' was here
                  Contrib/System/Source/Buffers.c: In function `Copy':
                  Contrib/System/Source/Buffers.c:40: warning: cast to pointer from integer of different size
                  Contrib/System/Source/Buffers.c:49: warning: passing arg 1 of `pushint' makes integer from pointer without a cast
                  Contrib/System/Source/Buffers.c:110:18: warning: no newline at end of file
                  scons: *** [build/release/System/Source/Buffers.os] Error 1

                  * linking makensis:

                  gcc -O2 -Wall -c -o build/release/makensis/zlib/trees.o Source/zlib/trees.c
                  g++ -s -Wl,--file-alignment,512 -Wl,-Map,makensis.map -o build/release/makensis/makensis build/release/makensis/build.o build/release/makensis/clzma.o build/release/makensis/crc32.o build/release/makensis/DialogTemplate.o build/release/makensis/dirreader.o build/release/makensis/growbuf.o build/release/makensis/lang.o build/release/makensis/lineparse.o build/release/makensis/makenssi.o build/release/makensis/mmap.o build/release/makensis/Plugins.o build/release/makensis/ResourceEditor.o build/release/makensis/ResourceVersionInfo.o build/release/makensis/script.o build/release/makensis/ShConstants.o build/release/makensis/strlist.o build/release/makensis/tokens.o build/release/makensis/util.o build/release/makensis/bzip2/blocksort.o build/release/makensis/bzip2/bzlib.o build/release/makensis/bzip2/compress.o build/release/makensis/bzip2/huffman.o build/release/makensis/7zip/7zGuids.o build/release/makensis/7zip/Common/CRC.o build/release/makensis/7zip/7zip/Compress/LZ/LZInWindow.o build/release/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o build/release/makensis/7zip/7zip/Common/OutBuffer.o build/release/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o build/release/makensis/7zip/Common/Alloc.o build/release/makensis/zlib/deflate.o build/release/makensis/zlib/trees.o
                  /usr/bin/ld: unrecognized option '--file-alignment'
                  /usr/bin/ld: use the --help option for usage information
                  collect2: ld returned 1 exit status
                  scons: *** [build/release/makensis/makensis] Error 1
                  removing the --file-alignment thing fixes the build error
                  bye,
                  pabs

                  Comment


                  • #10
                    • _MAX_PATH usage removed from bk_xhtml.c
                    • The standard libraries don't get linked to get smaller file sizes. Emptying NODEFLIBS_FLAG beats the purpose. If GCC requires some more CRT functions other than memcpy and memset, those should be added in the configuration step. NODEFLIBS_FLAG should stay as is.
                    • Commenting the two LINKFLAGS additions in the configuration test beats the purpose of the test. It'll never find if memcpy is needed with no CRT this way... Even if it doesn't find __main in the test, it'll just include memcpy and memset. It won't fail compiling anything but the tests.
                    • Try playing with RCFLAGS to get rid of the error about the compiled resources. It might work if the input and output format are specified like they were in the Makefile.
                    • TBN_DROPDOWN itself requires _WIN32_IE 0x0300, but its return values require 0x0400. Weird... I've added #define _WIN32_IE 0x0400 on the top of makensis.cpp.
                    • DBL_MAX_EXP and HUGE_VAL are both defined in mathcrt.h. It probably couldn't find them because mathcrt.h was included with wrong capatilization.
                    • I've removed the double typedef in System.h and Buffers.c.
                    • Which gcc version are using that doesn't support --file-alignment?
                    NSIS FAQ | NSIS Home Page | Donate $
                    "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

                    Comment


                    • #11
                      $ gcc --version
                      gcc (GCC) 3.3.6 (Debian 1:3.3.6-3)
                      $ ld --version
                      GNU ld version 2.15

                      <snip>
                      gcc -c -o build/release/halibut/version.o Docs/src/bin/halibut/version.c
                      gcc -nostdlib -Wl,--exclude-libs,msvcrt.a -Wl,-e,___main -nostdlib -Wl,--exclude-libs,msvcrt.a -Wl,-e,___main -o build/release/halibut/halibut build/release/halibut/biblio.o build/release/halibut/bk_xhtml.o build/release/halibut/contents.o build/release/halibut/error.o build/release/halibut/help.o build/release/halibut/index.o build/release/halibut/input.o build/release/halibut/keywords.o build/release/halibut/licence.o build/release/halibut/main.o build/release/halibut/malloc.o build/release/halibut/misc.o build/release/halibut/style.o build/release/halibut/tree234.o build/release/halibut/ustring.o build/release/halibut/version.o
                      /usr/bin/ld: unrecognized option '--exclude-libs'
                      /usr/bin/ld: use the --help option for usage information
                      collect2: ld returned 1 exit status
                      scons: *** [build/release/halibut/halibut] Error 1
                      scons: building terminated because of errors.

                      Then I removed "-Wl,--exclude-libs,msvcrt.a" from NODEFLIBS_FLAG.

                      <snip>
                      gcc -nostdlib -Wl,-e,___main -nostdlib -Wl,-e,___main -o build/release/halibut/halibut build/release/halibut/biblio.o build/release/halibut/bk_xhtml.o build/release/halib
                      ut/contents.o build/release/halibut/error.o build/release/halibut/help.o build/release/halibut/index.o build/release/halibut/input.o build/release/halibut/keywords.o buil
                      d/release/halibut/licence.o build/release/halibut/main.o build/release/halibut/malloc.o build/release/halibut/misc.o build/release/halibut/style.o build/release/halibut/t
                      ree234.o build/release/halibut/ustring.o build/release/halibut/version.o
                      /usr/bin/ld: warning: cannot find entry symbol ___main; defaulting to 0000000008048094
                      This gives these undefined symbols:
                      __assert_fail
                      exit
                      fclose
                      fopen
                      fprintf
                      fputs
                      free
                      _IO_getc
                      localtime
                      malloc
                      memset
                      printf
                      putchar
                      puts
                      sprintf
                      stderr
                      strcmp
                      strcpy
                      strftime
                      strlen
                      time
                      vsprintf

                      Then I removed "-nostdlib" from NODEFLIBS_FLAG. After that, halibut linked fine.

                      As far as the RCFLAGS things go, I note that the output is complaining about build/release/InstallOptions/libInstallOptions.so rather than build/release/InstallOptions/InstallOptions.dll, or build/release/InstallOptions/InstallOptions.os, so I think perhaps that the link target is using non-mingw stuff, when it shouldn't be.

                      This looks like a similar problem to the RC issue:
                      i586-mingw32msvc-gcc -Os -Wall -x c++ -fPIC -c -o build/release/Math/Source/plugin.os Contrib/Math/Source/plugin.c
                      Contrib/Math/Source/plugin.c:1: warning: -fPIC ignored for target (all code is position independent)
                      In file included from Contrib/Math/Source/plugin.c:2:
                      Contrib/Math/Source/MyMath.h:163:51: warning: no newline at end of file
                      Contrib/Math/Source/plugin.c:136:2: warning: no newline at end of file
                      scons: *** Source file: Contrib/Math/Source/mathcrt.lib is static and is not compatible with shared target: build/release/Math/libMath.so
                      scons: building terminated because of errors.

                      Here, it looks like C++ plugins need to be linked with the standard libs:
                      i586-mingw32msvc-g++ -Os -Wall -fPIC -c -o build/release/NSISdl/util.os Contrib/NSISdl/util.cpp
                      Contrib/NSISdl/util.cpp:1: warning: -fPIC ignored for target (all code is position independent)
                      Contrib/NSISdl/util.cpp:39:2: warning: no newline at end of file
                      i586-mingw32msvc-g++ -s -Wl,--file-alignment,512 -Wl,-e,[email protected] -nostdlib -Wl,--exclude-libs,msvcrt.a -Wl,-Map,NSISdl.map -shared -o build/release/NSISdl/libNSISdl.so build/release/NSISdl/asyncdns.os build/release/NSISdl/connection.os build/release/NSISdl/httpget.os build/release/NSISdl/nsisdl.os build/release/NSISdl/util.os .sconf_temp/funcs.os -lkernel32 -luser32 -ladvapi32 -lws2_32
                      build/release/NSISdl/connection.os:connection.cpp.text+0x1c): undefined reference to `___gxx_personality_sj0'
                      build/release/NSISdl/connection.os:connection.cpp.text+0x32): undefined reference to `__Unwind_SjLj_Register'
                      build/release/NSISdl/connection.os:connection.cpp.text+0xa5): undefined reference to `__Unwind_SjLj_Resume'
                      build/release/NSISdl/connection.os:connection.cpp.text+0xdc): undefined reference to `operator new[](unsigned int)'
                      build/release/NSISdl/connection.os:connection.cpp.text+0x13e): undefined reference to `__Unwind_SjLj_Unregister'
                      <snip>
                      collect2: ld returned 1 exit status
                      scons: *** [build/release/NSISdl/libNSISdl.so] Error 1
                      scons: building terminated because of errors.

                      Contrib/System/Source/System.c contains lots of Microsoft assembly, which GCC doesn't understand. I'll probably disable building this in the debian version corresponding to 2.07, as I did for 2.06.

                      _WIN32_IE needs to be 0x0500 for these (best to put it in makensisw.h, because more than 1 cpp file use it):
                      Contrib/Makensisw/toolbar.cpp:58: error: `TBSTYLE_DROPDOWN' undeclared (first use this function)
                      Contrib/Makensisw/toolbar.cpp:58: error: (Each undeclared identifier is reported only once for each function it appears in.)
                      Contrib/Makensisw/toolbar.cpp:70: error: `TBSTYLE_TRANSPARENT' undeclared (first use this function)
                      Contrib/Makensisw/toolbar.cpp:70: error: `TBSTYLE_FLAT' undeclared (first use this function)
                      Contrib/Makensisw/toolbar.cpp:90: error: `TB_SETIMAGELIST' undeclared (first use this function)
                      Contrib/Makensisw/toolbar.cpp:91: error: `TB_SETDISABLEDIMAGELIST' undeclared (first use this function)
                      Contrib/Makensisw/toolbar.cpp:92: error: `TB_SETHOTIMAGELIST' undeclared (first use this function)
                      Contrib/Makensisw/toolbar.cpp:96: error: `TB_SETEXTENDEDSTYLE' undeclared (first use this function)
                      Contrib/Makensisw/toolbar.cpp:96: error: `TBSTYLE_EX_DRAWDDARROWS' undeclared (first use this function)

                      Case problem in Contrib/Makensisw/resource.rc:
                      i586-mingw32msvc-windres --include-dir Contrib/Makensisw --input-format rc --output-format coff -i Contrib/Makensisw/resource.rc -o build/release/Makensisw/resource.o
                      i586-mingw32msvc-windres: can't open icon file `..\..\contrib\graphics\icons\modern-install-blue-full.ico': No such file or directory
                      Using this line helped:
                      IDI_ICON ICON "../Graphics/Icons/modern-install-blue-full.ico"

                      I also get a syntax error on line 162 of Contrib/Makensisw/resource.rc - didn't seem to have some of these defined: TCS_HOTTRACK, TCS_BUTTONS, TCS_RAGGEDRIGHT, TCS_OWNERDRAWFIXED, TCS_MULTISELECT. This requires "#define _WIN32_IE 0x0300" before the afxres.h include.
                      bye,
                      pabs

                      Comment


                      • #12
                        To fix the Contrib/Makensisw/resource.rc syntax error, you can also pass --define _WIN32_IE=0x0300 to windres.
                        bye,
                        pabs

                        Comment


                        • #13
                          Hmmm, this halibut segfault is a heisenbug that sometimes hides itself from gdb (GNU debugger). The backtrace looks something like the following. The parameters to fprintf are all fine, so I've no idea whats going on.

                          <internal libc functions>
                          vfprintf (vfprintf.c:1260)
                          fprintf (fprintf.c:32)
                          xhtml_add_contents_entry (bk_xhtml.c:1214)
                          xhtml_do_contents_section_limit (bk_xhtml.c:1183)
                          xhtml_do_contents_limit (bk_xhtml.c:1144)
                          xhtml_do_naked_contents (bk_xhtml.c:1122)
                          xhtml_do_file (bk_xhtml.c:955)
                          xhtml_do_files (bk_xhtml.c:684)
                          xhtml_backend (bk_xhtml.c:748)
                          main (main.c:229)
                          bye,
                          pabs

                          Comment


                          • #14
                            chm_toc might seem to have a valid value, but unless it's used in xhtml_do_top_file or in a function xhtml_do_top_file calls, it's closed. I've made xhtml_do_top_file set both chm_toc and chm_ind to NULL after they're closed. Let me know if a segfault is still raised.

                            I've removed --file-alignment from makensis' configuration as it seems to be MinGW specific. I've also made the tests reset the LINKFLAGS so halibut will be compiled with proper flags.

                            All of the weird errors related to MinGW are probably raised because I haven't copied all of the tool specification. I shuold just copy mingw.py from SCons and modify it to properly search for MinGW, instead of just adding the prefix to gcc, g++, ld and friends.

                            I'll take a look at the other problems later.
                            NSIS FAQ | NSIS Home Page | Donate $
                            "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

                            Comment


                            • #15
                              No more segfaults, yay! Thanks for that, now Docs buildage fails due to no hhc - one day I'll get around to finishing hhm. How about making the hhc run optional and not block the rest of the build if it fails? Hmmm, or I might just add a patch for the debian package to not run it.
                              bye,
                              pabs

                              Comment

                              Working...
                              X