-
Notifications
You must be signed in to change notification settings - Fork 132
Building in Windows with VS2015, how to make static build? #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@altbdoor, I am unable to reproduce this error as we are already compiling libsass statically in VCR builds. On the contrary, I wanted to add the dll shared lib / DLL configuration in addition to static one that we already have. :) I have verified with the following steps using command line: :: on my system running Windows 10 x86 Enterprise, changed directory to c:\temp
cd \temp
:: cloned LibSass
git clone https://github.com/sass/libsass
cd libsass
:: cloned SassC inside LibSass dir
git clone https://github.com/sass/sassc
:: compiled using MSBuild 14.0 (that ships with VS 2015):
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild" sassc\win\sassc.sln /p:Configuration=Release
:: created a test Sass file, test.scss
echo a{b:c} > test.scss
:: compiled with SassC
sassc\bin\sassc test.scss
:: resulted in:
a {
b: c; } Opened RDC and logged into a Azure VM running Windows Server 2012 R2 x64 Datacenter edition and copied sassc.exe and test.scss in a directory and ran Is your source and target OSes have same bitness (x86_64 or x86_32)? |
If the bitness is same, then I think you might need to have at least VS2015 Redistributable package installed on your target machine (as we have full blown VS2015 installed on our VM). |
@mgreter, @xzyfer, assuming bitness of target and source were same in the copy/pasta 🍝 of binaries scenario that @altbdoor has specified (which I am inkling on), is it OK to declare in readme that the redistributed runtime package is a prerequisite of sassc for Windows? Alternatively, we can inline or static compile the required pieces of runtime using The redistributable package is ~13 MBs. Before: 920 KB in Release configuration. Here is the diff that we would need to apply in diff --git a/win/sassc.vcxproj b/win/sassc.vcxproj
index ea3032e..7cead31 100644
--- a/win/sassc.vcxproj
+++ b/win/sassc.vcxproj
@@ -113,6 +113,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -141,6 +142,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem> |
Odd, I myself was not able to reproduce the error. I think I might have messed up in between all the binaries I made, apologies for the trouble.
This bit did help. After recompiling sassc, it did complain that But as recommended by @am11, it would be nice to inline or static compile the dependencies into a single executable. |
Thanks for the confirmation @altbdoor!
I have opened a PR #201 and changed Release and Debug configurations to inline the runtime. Also added The recommendation from vendor in their redistribution docs is to not static compile the binaries or distilling them against specific runtime as the next patch update of redistributable package may fix some potential bug. Also folks in some Stack Overflow answers have also recommended the same. But we are issuing the warning "the recommended config is shared, use static at your own risk"! :) |
In reference to the docs on building on Windows, I have successfully built a
sassc.exe
by following the steps with VS2015. But when I copy the builtsassc.exe
to another computer, it complains that sassc was unable to find a shared folder.I would assume that the library in question here is
libsass.dll
. I noticed that the.travis.yml
settings have a setting forBUILD
, where it can bestatic
orshared
. But guides on building sassc (in both Unix and Windows) did not mention anything about this.So question is, is it possible to make a sassc static build? If yes, how do I proceed with VS2015?
The text was updated successfully, but these errors were encountered: