Skip to content
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

Module compiles on Windows #4

Merged
merged 9 commits into from
Sep 28, 2014
Merged

Conversation

richorama
Copy link
Contributor

Assuming you have Visual Studio (msbuild). A post install script will compile the .NET solution and copy the binaries to the lib folder.

The pre-compiled binaries have been deleted.

Not sure how to support this on mono :¬/

@richorama
Copy link
Contributor Author

I have started shaving the yak for mono support. This may take some time!

@glennblock
Copy link
Contributor

Awesome!

On Tuesday, September 23, 2014, Richard Astbury notifications@github.com
wrote:

I have started shaving the yak for mono support. This may take some time!


Reply to this email directly or view it on GitHub
#4 (comment)
.

@glennblock
Copy link
Contributor

I was thinking to have the binaries installed via Nuget

On Tuesday, September 23, 2014, Richard Astbury notifications@github.com
wrote:

Assuming you have Visual Studio (msbuild). A post install script will
compile the .NET solution and copy the binaries to the lib folder.

The pre-compiled binaries have been deleted.

Not sure how to support this on mono :¬/

You can merge this Pull Request by running

git pull https://github.com/richorama/edge-scs master

Or view, comment on, or merge it at:

#4
Commit Summary

  • added nuget install
  • add a build step
  • copy files after install

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#4.

@glennblock
Copy link
Contributor

What do you think about the script using nuget.exe to download the packages
and pull out the binaries?

On Tuesday, September 23, 2014, Richard Astbury notifications@github.com
wrote:

Assuming you have Visual Studio (msbuild). A post install script will
compile the .NET solution and copy the binaries to the lib folder.

The pre-compiled binaries have been deleted.

Not sure how to support this on mono :¬/

You can merge this Pull Request by running

git pull https://github.com/richorama/edge-scs master

Or view, comment on, or merge it at:

#4
Commit Summary

  • added nuget install
  • add a build step
  • copy files after install

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#4.

@glennblock
Copy link
Contributor

Thanks for the effort here....

On Tuesday, September 23, 2014, Richard Astbury notifications@github.com
wrote:

Assuming you have Visual Studio (msbuild). A post install script will
compile the .NET solution and copy the binaries to the lib folder.

The pre-compiled binaries have been deleted.

Not sure how to support this on mono :¬/

You can merge this Pull Request by running

git pull https://github.com/richorama/edge-scs master

Or view, comment on, or merge it at:

#4
Commit Summary

  • added nuget install
  • add a build step
  • copy files after install

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#4.

@glennblock
Copy link
Contributor

Actually you can download the chocolatey pkg and open it up and all the
binaries are there.

On Tuesday, September 23, 2014, Richard Astbury notifications@github.com
wrote:

Assuming you have Visual Studio (msbuild). A post install script will
compile the .NET solution and copy the binaries to the lib folder.

The pre-compiled binaries have been deleted.

Not sure how to support this on mono :¬/

You can merge this Pull Request by running

git pull https://github.com/richorama/edge-scs master

Or view, comment on, or merge it at:

#4
Commit Summary

  • added nuget install
  • add a build step
  • copy files after install

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#4.

@richorama
Copy link
Contributor Author

Thanks Glenn,

I started off on the nuget.exe approach, but to my surprise msbuild sorted out the nuget dependencies for me. xbuild on linux did not.

I guess there are a few options here, and I'm not sure which is the best:

1. Put all binaries in nuget

If we compiled the module and made that a nuget package too, we don't take a dependency on msbuild. The question is how do you get the nuget packages down?

  • Assume that nuget.exe is on the path? (probably not)
  • Bundle nuget.exe in the npm package?
  • Write a node script to download nuget.exe?
  • Write a node script to download the packages (a node version of nuget.exe)? (too much work!)
  • Write a node script to download the chocolatey package?

2. Put all the binaries in the npm package

We could just ship all the binaries in the npm package. This seems like the most simple solution, but it feels like the wrong approach.

3. Compile the module, download the dependencies

This is the current approach, and is in keeping with how native modules generally work in npm. The problem is that msbuild has moved out of .NET, and into Visual Studio. Which is an annoying dependency to have. The story is better on mono, as xbuild ships with the framework.

Ideally there should be a repository for node binaries. Which is something I've mentioned before: https://groups.google.com/d/msg/nodejs/Ckfw2DmUqKE/EDqllcodIDsJ

@glennblock
Copy link
Contributor

Nope, there is a fourth option ;-) You can get the binaries off chocolatey,
there is no need for binaries in nuget. You can curl Chocolatey to get the
package which is just a zip. If you rip it open the binaries are there.

See the binaries section here:
https://github.com/scriptcs/scriptcs/wiki/Installing-on-Mac-and-Linux

This has our chocolatey daily build, but you can also use a URL against the
main chocolatey feed.

On Wednesday, September 24, 2014, Richard Astbury notifications@github.com
wrote:

Thanks Glenn,

I started off on the nuget.exe approach, but to my surprise msbuild sorted
out the nuget dependencies for me. xbuild on linux did not.

I guess there are a few options here, and I'm not sure which is the best:

  1. Put all binaries in nuget

If we compiled the module and made that a nuget package too, we don't take
a dependency on msbuild. The question is how do you get the nuget packages
down?

  • Assume that nuget.exe is on the path? (probably not)
  • Bundle nuget.exe in the npm package?
  • Write a node script to download nuget.exe?
  • Write a node script to download the packages (a node version of
    nuget.exe)? (too much work!)
  • Write a node script to download the chocolatey package?
  1. Put all the binaries in the npm package

We could just ship all the binaries in the npm package. This seems like
the most simple solution, but it feels like the wrong approach.
3. Compile the module, download the dependencies

This is the current approach, and is in keeping with how native modules
generally work in npm. The problem is that msbuild has moved out of .NET,
and into Visual Studio. Which is an annoying dependency to have. The story
is better on mono, as xbuild ships with the framework.

Ideally there should be a repository for node binaries. Which is something
I've mentioned before:
https://groups.google.com/d/msg/nodejs/Ckfw2DmUqKE/EDqllcodIDsJ


Reply to this email directly or view it on GitHub
#4 (comment)
.

@richorama
Copy link
Contributor Author

Sounds good. What about the edge-scs binary? Build it?

@glennblock
Copy link
Contributor

I would just include it as Tomek did for edge proper

On Wednesday, September 24, 2014, Richard Astbury notifications@github.com
wrote:

Sounds good. What about the edge-scs binary? Build it?


Reply to this email directly or view it on GitHub
#4 (comment)
.

@richorama
Copy link
Contributor Author

Super. I'll make it so.

@richorama richorama changed the title Modules compiles on Windows Module compiles on Windows Sep 24, 2014
@richorama
Copy link
Contributor Author

Right, the install script now downloads the package from myget.

Unfortunately it doesn't really contribute a great deal, as most of the dependencies are already included in the bin folder of the scs project.

It does get these though:

lib/ICSharpCode.NRefactory.CSharp.dll
lib/ICSharpCode.NRefactory.dll
lib/Mono.CSharp.dll
lib/Mono.Cecil.dll
lib/Newtonsoft.Json.dll
lib/PowerArgs.dll
lib/ScriptCs.Engine.Mono.dll
lib/scriptcs.exe
lib/scriptcs.exe.config

@glennblock
Copy link
Contributor

Hi Richard

Great.

Let's rip the dependencies and only include the JS file and the dll. The
dependences can all be delivered via the install script. Thoughts?

On Wed, Sep 24, 2014 at 5:39 AM, Richard Astbury notifications@github.com
wrote:

Right, the install script now downloads the package from myget.

Unfortunately it doesn't really contribute a great deal, as most of the
dependencies are already included in the bin folder of the scs project.

It does get these though:

lib/ICSharpCode.NRefactory.CSharp.dll
lib/ICSharpCode.NRefactory.dll
lib/Mono.CSharp.dll
lib/Mono.Cecil.dll
lib/Newtonsoft.Json.dll
lib/PowerArgs.dll
lib/ScriptCs.Engine.Mono.dll
lib/scriptcs.exe
lib/scriptcs.exe.config


Reply to this email directly or view it on GitHub
#4 (comment)
.

@richorama
Copy link
Contributor Author

Gah, I've broken something.

Stack overflow exceptions...

@richorama
Copy link
Contributor Author

I've got it working, but I've had to keep scriptcs to 0.8.1.

Attempts to upgrade to 0.10.2 result in errors (key missing from a dictionary).

Ready to merge. I'll re-attempt an upgrade on another PR.

@glennblock
Copy link
Contributor

This is probably because you need to configure the engine. Let me take your
PR and upgrade it.

On Thursday, September 25, 2014, Richard Astbury notifications@github.com
wrote:

I've got it working, but I've had to keep scriptcs to 0.8.1.

Attempts to upgrade to 0.10.2 result in errors (key missing from a
dictionary).

Ready to merge. I'll re-attempt an upgrade on another PR.


Reply to this email directly or view it on GitHub
#4 (comment)
.

@glennblock
Copy link
Contributor

Hi @richorama I am testing this out now. I am getting a StackOverFlowException when I try to get edge to load edge-scs.

This after doing an npm install using the source folder and installing into a temp dir. Debugging now....

@glennblock
Copy link
Contributor

@richorama weird, if I recompile the dll in VS it worked...stay tuned.

@glennblock
Copy link
Contributor

OK @richorama not sure why that failed, but I am going to take the PR and then upgrade to work with the latest scriptcs.

Thanks a ton for this!

glennblock added a commit that referenced this pull request Sep 28, 2014
Module compiles on Windows
@glennblock glennblock merged commit e0361e9 into scriptcs-contrib:master Sep 28, 2014
@glennblock
Copy link
Contributor

@richorama looks like the dll that is included for edge-scs is messed up. If i recompile it's fine. I am going to push an update and see if that fixes.

@glennblock
Copy link
Contributor

OK so that fixed it, but now I have a periodic error I am seeing related to Zlib.

I have only seen it periodically but it is troubling. I wonder if it has to do with long-name paths. When it happens if I install again it works.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Chocolatey\\lib\\nodist.0.3.12-beta\\tools\\nodist-master\\bin\\\\node.exe" "C:\\Chocolatey\\lib\\nodist.0.3.12-beta\\tools\\nodist-master\\bin\\node_modules\\npm\\cli.js" "install" "https://github.com/scriptcs-contrib/edge-scs/tarball/master"
npm ERR! cwd C:\src\test
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.15
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\src\test\npm-debug.log
npm ERR! not ok code 0

@glennblock
Copy link
Contributor

The plot thickens. So it turns out the installs script was not grabbing "enough", it needed to grab the Roslyn packages as well. I updated the script to now do that, and it works. You can test by doing: npm install https://github.com/scriptcs-contrib/edge-scs/tarball/master and then running this simple hello world below taken from the README:

var edge = require('edge');
var hello = edge.func('scs', function() {/*
static object Invoke(string s) {
    return s;
}
*/});

hello("Hello from scriptcs", function(error,result) {
    if (error) throw error;
    console.log(result);
}); 

It should output:

C:\src\test> node test.js
Hello from scriptcs

Now to upgrade to the latest bits and see what happens!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants