Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Don't force a shader/style rebuild if they haven't changed #151

Closed

Description

@kkaefer

gyp currently always executes the build_shader and build_stylesheet actions, regardless of whether the input files actually changed. You can observe this by looking at the

LD_LIBRARY_PATH=/Users/kkaefer/Code/llmr/native/build/Debug/lib.host:/Users/kkaefer/Code/llmr/native/build/Debug/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../../.; mkdir -p include/llmr/style src/style; node bin/build-style.js
LD_LIBRARY_PATH=/Users/kkaefer/Code/llmr/native/build/Debug/lib.host:/Users/kkaefer/Code/llmr/native/build/Debug/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../../.; mkdir -p src/shader include/llmr/shader; node bin/build-shaders.js

lines at the top of ever build.

@springmeyer, can we instruct gyp to not execute the action if the input files haven't changed and the output file exists (i.e. minimum mtime of all output files is newer than maximum mtime of all input files)?

Activity

  1. springmeyer commented on Apr 16, 2014

    @springmeyer
    Contributor

    yeah, should be doable. I'll take a look when I have a moment.

  2. kkaefer commented on Apr 16, 2014

    @kkaefer
    MemberAuthor

    Yeah, not urgent. Thanks!

  3. springmeyer commented on Apr 23, 2014

    @springmeyer
    Contributor

    The trick here is to let gyp manage the results of build actions by placing the ouputs of action in <(SHARED_INTERMEDIATE_DIR). This way gyp then knows about the generated files and automatically stops recreating them unless the inputs have changed. The drawback is that then includes are stored in a second spot and defines/cflags need to add this path as well. See 5b694d5 for a commit against master that gets this working for just os x and just shaders. I propose we hold on this until the uv branch is merged since the uv branch already started along this track.

  4. kkaefer commented on Apr 24, 2014

    @kkaefer
    MemberAuthor

    Thanks for looking at this! The only drawback to this approach I'm seeing is that this makes it difficult in IDEs to get correct autocompletion since the include file isn't present.

    I'm not sure that I'll ever merge the uv branch; I'm probably going to continue to port parts of it to the master branch as we need them.

  5. springmeyer commented on May 12, 2014

    @springmeyer
    Contributor

    Noting to look into more: make llmr is failing first run still on travis (https://magnum.travis-ci.com/mapbox/llmr-native/jobs/5284450#L361):

    ar: ../Release/obj.target/llmr-x86/src/style/resources.o: No such file or directory
    make[1]: *** [../Release/obj.target/libllmr-x86.a] Error 1
    make[1]: Leaving directory `/home/travis/build/mapbox/llmr-native/build/llmr'
    make: *** [llmr] Error 2
    
  6. added 2 commits that reference this issue on May 23, 2014
  7. springmeyer commented on May 24, 2014

    @springmeyer
    Contributor

    @kkaefer - can you take a look at #245? It should include the headers for autocompletion as well - so there should be no drawback. But would be good for you to confirm.

  8. springmeyer commented on May 27, 2014

    @springmeyer
    Contributor

    #245 is merged, closing. If any remaining issues come up we can create new issues.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions