You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 25, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 25, 2018. It is now read-only.
What about writing a build system that uses node.js. I know that it was discussed and it's a bad idea in sense to build node itself, however, I thought about it after years of using cmake and gyp. I think a completely new build system that is not based on an archaic language like cmake and that doesn't need python would be really nice to have. If I think of node it's a perfect dependency for a build system, because nearly everybody has it installed and JS is a language most people understand. As a bonus, the build system itself can contain extensions that can automatically download dependencies like npm does, etc.
Just my 2 cents, would really love build system for C++ based on node that "just works". I would definitely contribute to such project, but I would not be able to write the whole thing myself right now.
I really don't understand why cmake authors invented such a crappy language. I don't think its success is because of the language itself, it's because it provided pretty good detection and integration with IDEs and build systems. I personally use it, but because there is no alternative, I hate the syntax and spent a lot of time writing my cmake files.
Here. What I was doing before was going through every file and checking what needed to be changed. There hadn't been much that node-gyp does that javascript can't do so we can go through each and figure out what can be changed. Before I ended up trying to do it in regex because I got tired of rewriting manually, but honestly this would be much nicer crowd sourced than alone. Its pretty tedious. Heres a start
#!/usr/bin/env python# Copyright (c) 2009 Google Inc. All rights reserved.# Use of this source code is governed by a BSD-style license that can be# found in the LICENSE file.importosimportsys# Make sure we're using the version of pylib in this repo, not one installed# elsewhere on the system.sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
importgypif__name__=='__main__':
sys.exit(gyp.script_main())
gyp/gyp_main.js
#!/usr/bin/env nodejs
// Copyright (c) 2009 Google Inc. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.varos=require('os');varpath=require('path');//below is not necessary// sys.path.insert(0, path.join(path.dirname(process.argv[0]), 'pylib'))vargyp=require('./jslib/gyp');if(!module.parent){gyp.script_main()process.exit();}
Have a look at https://github.com/bkaradzic/genie (forked from premake). Produces project files for xcode + make + visual studio. Based on LUA. Binaries small.
Giving the v8 might dump gyp in the feature, continue to use gyp on nodejs really has some risk of incompatibility in feature v8 version, which gyp.js isn't going to solve. Instead of doing gyp.js, I wonder why not doing gn.js, which will solve both problems.
Bunch of Lua ones, but IIRC none of them are really "big", as in "have been tested on a major project".
Shake, but it requires Haskell (which is a bigger dependency than Python), and the only C/C++ rule set library doesn't yet support MSVC.
Premake, but you'd still need something like autoconf on top for the more serious configuration.
Cons, though it's pretty outdated at this point and a pain in the butt to google...
...
TBH there just aren't too many non-Python build systems around. I mean, Python comes on around every Unix-y system out there anyway...
(That being said, does anybody actually like using Gyp? IMO if you're going the route of using a configuration system and Gyp, there are better options...)
Activity
mikeal commentedon Oct 27, 2015
+1000
kobalicek commentedon Oct 27, 2015
What about writing a build system that uses node.js. I know that it was discussed and it's a bad idea in sense to build node itself, however, I thought about it after years of using cmake and gyp. I think a completely new build system that is not based on an archaic language like cmake and that doesn't need python would be really nice to have. If I think of node it's a perfect dependency for a build system, because nearly everybody has it installed and JS is a language most people understand. As a bonus, the build system itself can contain extensions that can automatically download dependencies like npm does, etc.
Just my 2 cents, would really love build system for C++ based on node that "just works". I would definitely contribute to such project, but I would not be able to write the whole thing myself right now.
kobalicek commentedon Jan 24, 2016
I really don't understand why cmake authors invented such a crappy language. I don't think its success is because of the language itself, it's because it provided pretty good detection and integration with IDEs and build systems. I personally use it, but because there is no alternative, I hate the syntax and spent a lot of time writing my cmake files.
formula1 commentedon Jan 25, 2016
Here. What I was doing before was going through every file and checking what needed to be changed. There hadn't been much that node-gyp does that javascript can't do so we can go through each and figure out what can be changed. Before I ended up trying to do it in regex because I got tired of rewriting manually, but honestly this would be much nicer crowd sourced than alone. Its pretty tedious. Heres a start
Heres another dirty one that I just did https://gist.github.com/formula1/eeba31bd42d9edbb94dd
This is completely untested and I am confident made some mistakes but its something to consider. Our options are
I'm assuming we'll twiddle our thumbs some more
Below is the easiest of what we can expect
gyp/gyp_main.pygyp/gyp_main.jsjeduden commentedon Jun 15, 2016
Have a look at https://github.com/bkaradzic/genie (forked from premake). Produces project files for xcode + make + visual studio. Based on LUA. Binaries small.
i5ting commentedon Jul 6, 2016
nice job with https://github.com/indutny/gyp.js
john-yan commentedon Feb 16, 2017
Giving the v8 might dump gyp in the feature, continue to use gyp on nodejs really has some risk of incompatibility in feature v8 version, which gyp.js isn't going to solve. Instead of doing gyp.js, I wonder why not doing gn.js, which will solve both problems.
refi64 commentedon Feb 16, 2017
@john-yan Does GN even require Python? IIRC the binaries don't.
However, to build pretty much anything, you need Python, since GN only allows you to execute Python scripts.
kobalicek commentedon Feb 16, 2017
WAF, GYP, GN, what would be next?
john-yan commentedon Feb 16, 2017
@kirbyfan64 GN doesn't require python to run.
jbergstroem commentedon Feb 16, 2017
I'm hoping that gyp.js can grow into a good-enough replacement. Seeing how it's written in javascript we also avoid any other dependencies.
refi64 commentedon Feb 16, 2017
@john-yan No, but it requires Python to do anything other than building code. From the docs:
@kobalicek
TBH there just aren't too many non-Python build systems around. I mean, Python comes on around every Unix-y system out there anyway...
(That being said, does anybody actually like using Gyp? IMO if you're going the route of using a configuration system and Gyp, there are better options...)
piranna commentedon Feb 16, 2017
MicroPython has some inital support of being compiled with Emscripten, and also there's PyPy.js...
joshgav commentedon Feb 16, 2017
nodejs/CTC#2 was re-opened to discuss this yesterday, you all should chime in there too.
i5ting commentedon Feb 16, 2017
@indutny
SCLeoX commentedon Jun 24, 2017
Ok I know saying this is meaningless, but...
+10000000000000000000000000000000000000000000000000000000000000000000000000000000
lev-kazakov commentedon Jul 30, 2017
FYI, I've created CMakeLists.txt compatible with master 637819b.
bnoordhuis commentedon Jul 30, 2017
FWIW, I have a similar approach in my cmake branch.