• 
      

    Restore symlinks in .npm-workspaces after the build completes.

    Review Request #14984 — Created March 31, 2026 and submitted

    Information

    buildthings
    master

    Reviewers

    When performing a build with NPM enabled and Python-based NPM modules
    set, symlinks in .npm-workspaces would get set to the location within
    the newly-installed module. That would become a dangling symlink, since
    that module was installed in the isolated build environment, and if
    there was an existing symlink pointing to a dev tree, it would be lost.

    Now, any symlinks in .npm-workspaces that will be overridden will be
    restored after a build, whether it completes successfully or errors out.
    This should help to avoid confusing runtime and build issues after a new
    build.

    Tested a build with Review Board and watched the symlinks in the directory.
    Verified that the symlinks were changed during the build and restored
    after.

    Summary ID
    Restore symlinks in .npm-workspaces after the build completes.
    When performing a build with NPM enabled and Python-based NPM modules set, symlinks in `.npm-workspaces` would get set to the location within the newly-installed module. That would become a dangling symlink, since that module was installed in the isolated build environment, and if there was an existing symlink pointing to a dev tree, it would be lost. Now, any symlinks in `.npm-workspaces` that will be overridden will be restored after a build, whether it completes successfully or errors out. This should help to avoid confusing runtime and build issues after a new build.
    86ba91a7ba4aafcc704c8d55d4f62f2bdc499883
    Description From Last Updated

    Instead of a global, how about if we return the dict from _rebuild_npm_workspaces?

    daviddavid
    david
    1. 
        
    2. buildthings/backend.py (Diff revision 1)
       
       
       
       
       
       
      Show all issues

      Instead of a global, how about if we return the dict from _rebuild_npm_workspaces?

    3. 
        
    chipx86
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (316f83e)