Skip to content

Makefile dependency tree is incomplete, makefiles do not build only as necessary #25135

Open
@sam-github

Description

@sam-github

The makefiles generated by gyp are not working for development (they work better for single-shot CI builds). Perhaps I'm missing something, please tell me if I am, but I've done some asking around to people who know the gyp system, and have some agreement on these points.

  • make node; make node Make should do nothing if no source code has been changed, but make node relinks both node and cctest (!?) every time it is run.

  • make -C out node is faster, but and builds just node, not cctest, but it does it even if no source has changed. However, its build/dependency tree is incomplete! It doesn't run js2c so if any js source files are changed they will not be built-in with js2c. Fast and wrong is worse than slow.

  • make -C out/Release node as above

  • make -j4 node; make -j1 test often required. parallel make is not working for test. Various symptoms of brokenness occur (irc has some discussion). Sounds like this could be related to the dependency relationships not being correctly specified, causing build rules to run in parallel when they cannot, and thus be racy.

  • ./configure --shared-openssl-includes will cause openssl include paths to be passed to dependencies that don't use openssl. This might appear harmless, but it (for example) causes ccache to rebuild icu, even though icu doesn't use openssl. Possible fix:

    node/common.gypi

    Lines 549 to 560 in eef6504

    ['node_shared_openssl!="true"', {
    # `OPENSSL_THREADS` is defined via GYP for openSSL for all architectures.
    'defines': [
    'OPENSSL_THREADS',
    ],
    }],
    ['node_shared_openssl!="true" and openssl_no_asm==1', {
    'defines': [
    'OPENSSL_NO_ASM',
    ],
    }],
    ],
    , add OPENSSL_THREADS to the else clause (I haven't tried yet).

Ninja notes:

Ninja (./configure --ninja) doesn't have the above problems for building, its dependency tree is correct (it builds nothing when nothing has changed, and it reruns js2c when js files have changed).

However, it is either incomplete or not integrated with the rest of the build (I'm not sure how its intended to work). It doesn't make the top-level node symlink (at least test-doc relies on this), so a ln -s out/Release/node node is required for make test-doc. As for make test, it won't use the ninja build output, because it relies on .PHONY targets, so it always (effectively) does a make -C out all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions