More Build Issues

Mar 14, 2013 at 1:59 AM
I really wish there were pre-compiled binaries for this project. I could really use some 32 bit .NET version 4.0 builds of this. Yeah I know only 4.5 is officially "supported".

The project looks great. But can we get a Nuget package up in here? :)

From a Visual Studio CMD prompt I tried I got this:
>V8Update.cmd Release
Build mode: Release
V8 revision: Latest
Removing old build directory ...
Creating build directory ...
Downloading V8 ...
Patching V8 ...
Downloading GYP ...
Downloading Python ...
Downloading Cygwin ...
Building 32-bit V8 ...
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "build\gyp_v8", line 33, in <module>
    import glob
  File "C:\Python27\lib\glob.py", line 4, in <module>
    import os
  File "C:\Python27\lib\os.py", line 398, in <module>
    import UserDict
  File "C:\Python27\lib\UserDict.py", line 84, in <module>
    _abcoll.MutableMapping.register(IterableUserDict)
  File "C:\Python27\lib\abc.py", line 109, in register
    if issubclass(subclass, cls):
  File "C:\Python27\lib\abc.py", line 184, in __subclasscheck__
    cls._abc_negative_cache.add(subclass)
  File "C:\Python27\lib\_weakrefset.py", line 84, in add
    self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to 'classobj' object
*** THE PREVIOUS STEP FAILED ***
Any ideas?
Coordinator
Mar 14, 2013 at 2:47 AM
Hello jbperry! Hmm, V8Update should be using the Python it downloaded, not the one you have installed at C:\Python27. We'll try to reproduce this ASAP.
Coordinator
Mar 14, 2013 at 3:44 AM
Please remove any Python-related environment variables and run V8Update again. For example:
> set PYTHONHOME=
> V8Update /n
Let us know if that works for you! BTW, if you have ClearScript 5.1.2 or earlier, you'll have to omit the /n switch. V8Update should still work; it'll just have to download everything again.
Mar 14, 2013 at 6:26 AM
Thanks, that got me part of the way.

That particular machine has VS 2010 but not VS 2012 and it still failed.

I tried again with a machine with VS 2012 and it succeeded.

I also, recompiled under .NET 4.0 and things seemed to work as well.

Thanks for the help!
Coordinator
Mar 14, 2013 at 1:35 PM
Thanks jbperry! We'll add a PYTHONHOME workaround to V8Update.
May 2, 2013 at 6:45 AM
Well, it looks like I spoke too soon with it working with .NET 4.0. I does and it doesn't.

Maybe it has to do with how .NET 4.5 really replaces a lot of the .NET 4.0 DLLs. I'm not completely sure. But this is what I'm seeing.

As I discussed above, I compiled ClearScript for .NET 4.0 and for .NET 4.5. And, on a machine that has 4.5, I can create a .NET 4.0 project and using the 4.0 versions of the DLL files, it will run on it.

But if I take the same results. For example the Release or Debug folder and just move it to a 4.0 machine, I get:

Cannot load V8 proxy implementation type; verify that the following files are installed with your application: ClearScriptV8-32.dll, ClearScriptV8-64.dll, v8-ia32.dll, v8-x64.dll

Now, remember, it's exactly the same files, in a 4.0 project, moved to a 4.0 machine. It baffles me, but there must be something that is using 4.5 to dynamically load the files.

It's sort of heartbreaking. I'm not sure I can sell management on forcing everyone to load 4.5 on their machines.

I know that 4.5 is the only thing specifically supported. But if anyone has any ideas, I would appreciate it.
Coordinator
May 2, 2013 at 2:32 PM
Hi jbperry!

Could you please describe the procedure you used to build ClearScript for .NET 4.0? What changes did you make to the project files and/or configuration settings?

We haven't been testing ClearScript with .NET 4.0 lately, but we'd like to get your issue resolved ASAP.

Thanks!
May 2, 2013 at 4:58 PM
I'm probably doing something wrong. I did all of this back in March and have been using those same assemblies. But I double checked today.

The only changes I think I made was going in and changing the target properties of each project. On the ClearScriptV8-32.dll and 64.dll projects, I didn't see how I could change them from Visual Studio, so I opened the project files in notepad++ and changed them to 4.0 by hand. I didn't see anything I could change like that in the v8-ia32 or x64 projects.

Obviously I'm missing something.

Thanks for all your help,

Jason Perry
Coordinator
May 2, 2013 at 6:58 PM
Changing the target framework version in all the projects should be all that's required, yet we're also seeing the issue after copying the binaries to a clean Windows 7 PC with .NET 4.0 installed. We're investigating.
May 2, 2013 at 7:05 PM
I couldn't believe it either and tested on multiple machines.

It's good to know that I'm not going insane. Well, at least not in this case. :)

Thanks for looking into it.
Coordinator
May 2, 2013 at 7:52 PM
Jason, we've been able to resolve the issue by installing the Visual C++ Redistributable for Visual Studio 2012, available here. Could you please give it a try? Note that there are separate downloads for the x64 and x86 versions of the redistributable.

BTW, we've discovered that ClearScript 5.2 is no longer source-compatible with .NET 4.0. There are only a couple of incompatibilities, and we'll fix them shortly; in the meantime, it's probably best not to upgrade :)
May 2, 2013 at 8:21 PM
Edited May 2, 2013 at 8:22 PM
Thanks!

Interesting. The C++ Redistributable does seem to fix the issue.

I can run the non-V8 portions of ClearScript without this. For instance, I've tested the ClearScript.Windows.VBScriptEngine portion without needing this redistributable. So it must just be the V8 engine that needs it.

Now I'm curious, if you run ClearScript with V8ScriptEngine on a clean Windows 7 box with .NET 4.5 (no visual studio install, no c++ redistributable), does it work?

I guess I'm asking, "Is the V8ScriptEngine dependent on either C++ Redistributable or Visual Studio 2012 being installed?"

It looks like it is for .NET 4.0, so I'm assuming it is for .NET 4.5.
Coordinator
May 2, 2013 at 9:55 PM
Edited Aug 21, 2013 at 7:21 PM
I can run the non-V8 portions of ClearScript without this. For instance, I've tested the ClearScript.Windows.VBScriptEngine portion without needing this redistributable. So it must just be the V8 engine that needs it.

That's correct. The V8 interface (ClearScriptV8-*.dll) is the only part of ClearScript that's coded in C++. It's likely that V8 itself (v8-[ia32|x64].dll) also requires the C++ redistributable as it too is coded in C++ and built by the same toolset.

Now I'm curious, if you run ClearScript with V8ScriptEngine on a clean Windows 7 box with .NET 4.5 (no visual studio install, no c++ redistributable), does it work?

It does not. Apparently the standalone .NET 4.5 installation package does not include the C++ redistributable. This was news to us!

I guess I'm asking, "Is the V8ScriptEngine dependent on either C++ Redistributable or Visual Studio 2012 being installed?"

Yes; unfortunately, one of those must be installed. Because the redistributable contains core C++ libraries, most C++ software built by Visual Studio 2012 will require it. Thanks for making us aware of this requirement. We'll be sure to document it!
Coordinator
May 2, 2013 at 10:23 PM
To clarify further, the .NET framework and the C++ libraries are two separate and unrelated requirements. ClearScript can work with .NET 4.0 or 4.5, but either way it requires the 2012 C++ libraries. Because they implement the recently updated C++ standard, the 2012 C++ libraries have a lot of new functionality, and we'll be relying on them further as we gradually make ClearScript's C++ codebase more portable.
May 3, 2013 at 12:08 AM
As usual, you are providing great support for this project.

Just thinking: Probably should update the readme or somewhere with the C++ Redistributable Requirements.

Thanks for all the help on this, and I look forward to the updates that get ClearScript source-compatible with .NET 4.0. . . . not pushing or anything ;-)

Great work.
Coordinator
May 3, 2013 at 1:42 PM
Thanks, Jason. We've posted Version 5.2.1, which updates the Readme and restores .NET 4.0 source compatibility.
May 22, 2013 at 4:26 PM
Thanks so much for maintaining ClearScript!
Coming back to the original post, what are your thoughts on providing a NuGet package?
Coordinator
May 23, 2013 at 1:37 PM
Hello reubenbond!

We currently have no plans to release ClearScript in binary form. Please see our comments in this thread.

That said, there's nothing stopping someone else from doing so :-)
Aug 21, 2013 at 6:32 PM
The issue with PYTHONHOME applies to PYTHONPATH as well, I have msysgit installed and that was part of the installation. You may want to bake this into your V8Update as well.
Coordinator
Aug 21, 2013 at 9:17 PM
Thank you lolboxen! We'll take care of that.
Sep 20, 2013 at 5:49 AM