Skip to content

Tests on Windows take forever to start #179

Description

@seishun

For some reason, whenever I run vcbuild test nosign, msbuild decides to rebuild node_javascript.cc and subsequently re-link node.lib, which for some reason takes several minutes on a Core i7 machine (many times longer than in Visual Studio). This behavior has been observed on two different machines.

I'm going to attempt to figure out what's causing this and how to fix it, but perhaps someone can give me some pointers.

In case it matters, I'm using Visual Studio Express 2013 for Windows Desktop.

/cc @piscisaureus @rvagg

Activity

  1. piscisaureus commented on Dec 17, 2014

    @piscisaureus
    Contributor

    @seishun I have no idea, the same issue is bugging me. A patch (or an explanation) would be very welcome.

  2. bnoordhuis commented on Dec 18, 2014

    @bnoordhuis
    Member

    Does src/node.js or the files in lib/ have timestamps in the future? Or maybe the generated node_natives.h ends up with a timestamp that is in the past somehow? That's the only thing I can think of.

  3. piscisaureus commented on Dec 18, 2014

    @piscisaureus
    Contributor

    I think I know what happens: vcbuild.bat re-generates the .sln/.vcxproj files which makes msbuild re-run the js2c "custom build step".

    A workaround is to call vcbuild noprojgen nosign test. A nicer solution I think would be to split the configuration and build steps into separate batch files, e.g. configure.bat and make.bat.

  4. seishun commented on Dec 19, 2014

    @seishun
    ContributorAuthor

    Actually, config.gypi is the culprit here. Its modification date gets bumped during the project generation, and it's listed as an input to the node_js2c target. Now I'm trying to find answers to the following questions:

    • What is the magic that prevents the .sln/.vcxproj files from getting re-generated if no change is required, and can we apply the same magic to config.gypi?
    • Why is config.gypi even required for js2c?
  5. seishun commented on Dec 19, 2014

    @seishun
    ContributorAuthor

    Looks like config.gypi was added to the inputs in 95fd517. And there is no explanation. sigh

    /cc @TooTallNate

  6. bnoordhuis commented on Dec 19, 2014

    @bnoordhuis
    Member

    @seishun It becomes the process.config variable:

    $ out/x64.release/node -p process.config
    { target_defaults: 
       { cflags: [],
         default_configuration: 'Release',
         defines: [ 'OPENSSL_NO_SSL2=1' ],
         include_dirs: [],
         libraries: [] },
      variables: 
       { clang: 0,
         gcc_version: 49,
         host_arch: 'x64',
         icu_small: false,
         node_install_npm: true,
         node_prefix: '/home/bnoordhuis/opt/node',
         node_shared_http_parser: false,
         node_shared_libuv: false,
         node_shared_openssl: false,
         node_shared_v8: false,
         node_shared_zlib: false,
         node_tag: '',
         node_use_dtrace: false,
         node_use_etw: false,
         node_use_mdb: false,
         node_use_openssl: true,
         node_use_perfctr: false,
         openssl_no_asm: 0,
         python: '/usr/bin/python',
         target_arch: 'x64',
         uv_library: 'static_library',
         uv_parent_path: '/deps/uv/',
         uv_use_dtrace: false,
         v8_enable_gdbjit: 0,
         v8_enable_i18n_support: 0,
         v8_no_strict_aliasing: 1,
         v8_optimized_debug: 0,
         v8_random_seed: 0,
         v8_use_snapshot: true,
         want_separate_host_toolset: 0 } }
    
  7. seishun commented on Dec 19, 2014

    @seishun
    ContributorAuthor

    I've found the magic! It's in WriteOnDiff for .sln files and WriteXmlIfChanged for .vcxproj files. Perhaps we could do something similar for config.gypi? Admittedly, it feels kinda hacky.

    A nicer solution I think would be to split the configuration and build steps into separate batch files, e.g. configure.bat and make.bat.

    I'm not sure how this would help. It would just shift the burden of deciding whether to regenerate project files to the user.

  8. added
    windowsIssues and PRs related to the Windows platform.
    on Jan 23, 2015
  9. piscisaureus commented on Jan 23, 2015

    @piscisaureus
    Contributor

    I've found the magic! It's in WriteOnDiff for .sln files and WriteXmlIfChanged for .vcxproj files. Perhaps we could do something similar for config.gypi? Admittedly, it feels kinda hacky.

    So this is your chance to make a PR :)

  10. self-assigned this
    on Feb 1, 2015
  11. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Feb 1, 2015
  12. seishun commented on Feb 1, 2015

    @seishun
    ContributorAuthor

    I've discovered that Makefile errors if config.gypi is older than configure.py. If my understanding is correct, this means that if we add WriteOnDiff magic to configure.py, re-running it will not always fix the make error. Sounds bad.

    This original issue doesn't affect Linux because it doesn't run configure.py when running make. However, if the project structure (and thus node.gyp) has changed, the Makefile automatically runs gyp_node.py. That doesn't happen when building the VS solution (which is actually one of the selling points of gn - "GN supports automatically re-running itself as needed by Ninja as part of the build").

    I'm not sure how to fix this properly.

  13. removed their assignment
    on Feb 1, 2015
  14. piscisaureus commented on Feb 2, 2015

    @piscisaureus
    Contributor

    @seishun

    In the long run I would like to change the windows build scripts to make configure and make independent steps. But first I have to figure out #530.

    If it's not possible to fix it now, feel free to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions