Skip to content
⌘ NSIS Forum Archive

Building CVS with scons

40 posts

Comm@nder21#
well, it now compiles (with -k) but has lots of troubles.
it always tries to run
"E:\Programme\Microsoft Platform SDK\\bin\Win64\link.exe"
which of course doesn't exist.

1. theres a \ too much
2. i'm running win32 not 64.

is there ANYONE out there who has a WORKING script?
Comm@nder21#
found the link.exe after some searching:
it's not provided with the psdk.
it's provided with the vc-toolkit:
E:\Programme\Microsoft Visual C++ Toolkit 2003\bin\link.exe

why does scons use that ****** paths?
kichik#
Install the PSDK for Windows 2003 server and it should work. See this thread for more information.
Comm@nder21#
finally got it working.
some more problems:
the environment vars still don't work.
with latest cvs (updated today) it still does not find the vc++ toolkit itself, even if the vars are set correctly.
the environment code for scons is simply wrong, there were already solutions posted, you may also find one at this link:

plz update the sconstruct file in cvs.

also, theres still the wrong registry path set in the mstoolkit.py:
SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir
this is your one. its wrong. i tried it both with the xpsp2 sdk and the 2003sp1 one.
for the 2003sp1 one (the only one really working) it must be:
SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3\Install Dir
pls fix that too.
thanks.
kichik#
mstoolkit.py adds the bin directory of the toolkit to the path, there's no need to add the entire os path to scons' path. I have updated it to give up if it can't find VCToolkitInstallDir in the environment instead of trying "C:\Program Files\Microsoft Visual C++ Toolkit 2003".

I have tried installing a fresh copy of PSDK on a fresh computer and indeed the registry key read in mstoolkit.py was not there. Seems like they're removed it in one of the latest versions. I have updated mstoolkit.py to look in the MSSDK environment variable. I have also made it search that registry key with the GUID, even though it's probably a bad idea. It doesn't exist on the older versions, so it'll probably change in the future.

So now you must have two envrionment variables:
  • MSSDK should point to the Platform SDK installation directory. It's created automatically, if you choose Register Environment Variables during installation of the PSDK.
  • VCToolkitInstallDir should point to the Visual C++ Toolkit installation directory. It's also created automatically during installation.


Thanks for the information.
kichik#
I have tried building on another with system which has just the toolkit and the Platform SDK and I got an error resulting from this bug. It can be easily identified by the last place in the stack trace which is intelc.py.

This bug has already been fixed in the latest CVS version of SCons. However, no versions were released since 0.96.90. Until version 0.97 is released you can use this build I made from CVS today. Note that unlike 0.96.*, it doesn't install scons.bat in the main Python directory but in a subdirectory called Scripts. So if you want to change your PATH environment variable so you can just type 'scons' and not C:\Python\Scripts\scons.bat, don't forget to add C:\Python\Scripts.
JasonFriday13#
This is very off topic but it is nice to see LIGHTING UK! on the forums after the fall of dvd decrypter.
iceman_k#
Kickhik:
Any idea about what could be causing this problem:
C:\projects\NSIS\Development>scons MSTOOLKIT=yes
scons: Reading SConscript files ...
Delete("nsis-27-Jul-2005.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for main() in C library gdi32... (cached) yes
Checking for main() in C library user32... (cached) yes
Checking for main() in C library version... (cached) yes
Checking for main() in C library pthread... (cached) no
Checking for main() in C library stdc++... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library libiconv... (cached) no
Checking for main() in C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
Copy("C:\projects\NSIS\Development\build\release\Docs\chm", "Docs\src/../style.css")
scons: *** [build\release\Docs\chm\NSIS.chm] Permission denied
scons: building terminated because of errors.
I don't get it with a clean build, but I still get it when I try rebuilding. Is there some verbose mode I can enable to get more details?
iceman_k#
It works fine if I do a clean build- it builds the CHM and everything. However, if I delete build\release\Docs\chm\NSIS.chm and run Scons again, it fails.
The reason it fails is that the Copy() commands below do not change the readonly attribute of the files.

chm_builder = Builder(
action = [
Copy(build_dir, '${SOURCE.dir}/../style.css'),
Copy(build_dir, '${SOURCE.dir}/chmlink.js'),
Copy(build_dir, '${SOURCE.dir}/nsis.hhp'),
Action('cd "%s" && "%s" ${SOURCES.abspath}' % (build_dir, halibut[0].abspath)),
hhc_action
]
)
Since I have configured my CVS with watch/edit enabled, non-edited files have the readonly attribute set. If the build directory is empty, these are copied over without a problem.
However, the next time I run Scons, the copy fails because the target files are readonly.
This is in spite of the _copy_func definition ostensibly changing the status to writeable:

def _copy_func(src, dest):
shutil.copy2(src, dest)
st=os.stat(src)
os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
So, eventually, my work around was to create a build.bat file which fixes the readonly attribute for me:

setlocal
set MSSDK=C:\Program Files\Microsoft SDK
set VCToolkitInstallDir=C:\Program Files\Microsoft Visual C++ Toolkit 2003
path %path%;c:\python;c:\Program Files\HTML Help Workshop
call scons MSTOOLKIT=yes > build.log 2>&1
if exist build\release\Docs\chm (
pushd build\release\Docs\chm
if exist style.css attrib -r -s -h -a style.css
if exist chmlink.js attrib -r -s -h -a chmlink.js
if exist nsis.hhp attrib -r -s -h -a nsis.hhp
popd
)
if exist build\release\Docs\html (
pushd build\release\Docs\html
if exist style.css attrib -r -s -h -a style.css
popd
)
call scons MSTOOLKIT=yes PREFIX="C:\Projects\NSIS" install >> build.log 2>&1
endlocal