Giter Site home page Giter Site logo

refack / gyp3 Goto Github PK

View Code? Open in Web Editor NEW
20.0 9.0 17.0 9.76 MB

Generate You Projects

Home Page: http://gyp3.org/

License: BSD 3-Clause "New" or "Revised" License

Python 95.03% C++ 1.59% Shell 0.66% Batchfile 0.03% C 1.47% Assembly 0.04% Objective-C 0.54% Objective-C++ 0.07% Swift 0.01% Emacs Lisp 0.53% PowerShell 0.03%
gyp build-automation meta-buildtool python

gyp3's Introduction

gyp3's People

Contributors

aarongable avatar bradn123 avatar bulldy80 avatar bungeman avatar cclauss avatar chhamilton avatar dpranke avatar jbarz avatar jeisinger avatar lindleyf avatar markmentovai avatar maruel avatar mblsha avatar nico avatar otherdaniel avatar pyrtsa avatar randomascii avatar refack avatar sdefresne avatar seawardt avatar sebmarchand avatar sgraham avatar shawwn avatar shishkander avatar targos avatar thefourtheye avatar tornewuff avatar yukawa avatar yury-s avatar zgl6yxnt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gyp3's Issues

adding compiler flag for windows / MSVC

to permit compiling umlaut chars like:

auto a = u'ü';

MSVC needs to be set the commandline switch

/UTF-8

I fail to work my way through the msbuild generator how I'd best achieve this; Anybody got a hint for me on this?

Gyp demands relative paths of source but doesn't enforce it

to generate source file lines, gyp needs paths relative to the gypfile itself.
i.e. :

      'sources': [
        '<(V8_ROOT)/base/trace_event/common/trace_event_common.h',
        '<(V8_ROOT)/include/libplatform/libplatform-export.h',
        '<(V8_ROOT)/include/libplatform/libplatform.h',
        '<(V8_ROOT)/include/libplatform/v8-tracing.h',
        '<(V8_ROOT)/src/libplatform/default-foreground-task-runner.cc', ....
      ],

works as long as V8_ROOT is a relative path. If its absolute, the produced make file fails to trigger the compilation of these files:

OBJS := \
	$(obj).target/$(TARGET)//home/willi/src/devel/3rdParty/V8/v7.1.302.28/src/libplatform/default-foreground-task-runner.o \
	$(obj).target/$(TARGET)//home/willi/src/devel/3rdParty/V8/v7.1.302.28/src/libplatform/default-platform.o \
	$(obj).target/$(TARGET)//home/willi/src/devel/3rdParty/V8/v7.1.302.28/src/libplatform/default-worker-threads-task-runner.o \

and make will error out when trying to link these files, that it doesn't know how to create them.

either this behaviour should be fixed, or gyp should error out on absolute files

Travis CI: Windows command "nvs add" requires a version parameter

3.45s$ nvs add 
Downloading bootstrap node from https://nodejs.org/dist/v10.12.0/node-v10.12.0-win-x64.7z
######################################################################## 100.0%
The command "nvs add " failed and exited with 1 during .
Your build has been stopped.
A version parameter is required.

Add default `knownRegions` key to silence a new Xcode 10.2 warning

What steps will reproduce the problem?

  1. In Xcode 10.2, a new warning is shown for all gyp-generated projects stating: "Enable Base Internationalization"
  2. This is because gyp has never generated the knownRegions key, and Xcode has always (previously) silently created it
  3. Clicking to "fix" the warning in Xcode will auto-generate the knownRegions key, but any time an xcodeproj file is regenerated (and Xcode rebooted) the warning will yet again show and need to be "fixed"

What is the expected output? What do you see instead?

One would hope that gyp would auto-generate a default key, but

What version of the product are you using? On what operating system?

macOS Mojave 10.14.4 using an up-to-date GYP as of April 1, 2019

Please provide any additional information below.

The fix proposed for this ticket is to add the following line to xcodeproj_file.py somewhere after line 2582 (the "_schema.update" line):

 'knownRegions':           [0, list,                 0, 1, ['en', 'Base']],

This will silence the error and have the same effect of the "Xcode fix."

However, it would probably be a good idea to have a key from within gyp that the user could configure since one could imagine adding "more languages" to the knownRegions, as well as it already being possible to change this key from within Xcode itself (and not possible to do this within the gyp file currently.)

filename handling for MSVC

The v8 torque transpiler expects filenames relative to -v8-root. This seems to work on linux with makefile target - "<(V8_ROOT)/src/builtins/array.tq", will become ../src/builtins/array.tq - all good.
However, the msbuild generator tries to make this path absolute when its put through:

          'inputs': [  # Order matters.
            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
            '<@(torque_files)',
          ],

I failed to get any solution working which would give me a working run_torque target.

I ended up patching that stupid behaviour out of torque by improving the error message, and making it attempt to simply directly opening the path instead of running it through its own vodoo:

void ReadAndParseTorqueFile(const std::string& path) {
  SourceId source_id = SourceFileMap::AddSource(path);
  CurrentSourceFile::Scope source_id_scope(source_id);

  // path might be either a normal file path or an encoded URI.
  auto fn = SourceFileMap::AbsolutePath(source_id);
  auto maybe_content = ReadFile(fn);
  std::string maybe_path;
  if (!maybe_content) {
    if (auto mmmaybe_path = FileUriDecode(path)) {
      maybe_path = *mmmaybe_path;
      maybe_content = ReadFile(maybe_path);
    }
  }
  if (!maybe_content) {
    maybe_content = ReadFile(path);
  }
  if (!maybe_content) {
    std::string allPaths = path + " - " + fn + " - " + maybe_path;
    Error("Cannot open file path/uri: ", allPaths).Throw();
  }

  ParseTorque(*maybe_content);
}

whats the best way ahead here? Find a fix for gyp3? Propose the torque fix upstream (if yes - is there somebody willing to do it? I hereby put my changes into public domain) ?

Consider using vswhere to find Visual Studio installation

Right now the code in MSVSVersion.py uses the registry to find the Visual Studio installation.
I re-installed my windows 10 recently and only installed the latest copy of Visual Studio 2019, as it turns out none of the registry keys being checked exist on my machine.

I suggest checking for the default location of vswhere.exe and downloading it if it's not there, so we use that to find the Visual Studio installation.

Is this something that makes sense here, I would be happy to implement this and submit a PR.

Support ARM64 Windows dual-toolchain MSVC cross-compilation

The simplest cross-compilation scenario is compiling source on one architecture for another. Currently, MSVC and GYP both support this for ARM64--that is, MSVC provides x64-arm64 and x86-arm64 toolchains, while GYP supports generating MSVC projects that use either of these.

If the project requires compiling and then running tools (such as v8's mksnapshot during the Node.js build), then both the ARM64 and x64 toolchains need to be invoked during the build. MSVC partially supports this--each project can contain multiple configurations--but currently GYP only supports using one toolchain at a time. See https://github.com/refack/GYP/blob/master/pylib/gyp/generator/msvs.py#L1849

The simplest solution would be to support emitting projects with two toolchain configurations, then letting the user invoke msbuild twice with two configurations.

The ideal solution would be to use msbuild magic to emit projects such that msbuild need only be invoked once, but I don't know if this is possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.