Skip to content

scons launcher and scons dist don't rebuild #13372

Description

@mltony

TL;DR

scons launcher or scons dist commands don't seem to be able to pick up code changes after first execution. In other words, they can build successfully for the first time, but they cannot rebuild as they don't appear to see that code has changed.
As to why this can be useful, in my example, I have NVDA build environment on my personal laptop, but I am trying to debug an issue with MS WOrd, which is only installed on my work laptop. I cannot build NVDA on work laptop, nor can I install MS Word on my personal laptop. As a result I need to frequently repeat the cycle of making code change, rebuild and test on work laptop.

Steps to reproduce:

The following steps use scons launcher command but all the same applies to scons dist as well.

  1. Get a fresh copy of NVDA:
> git clone --recursive https://github.com/nvaccess/nvda.git
> ...
> cd nvda
  1. Build launcher:
> scons launcher
... many lines of actual building process omitted
scons: done building targets.
  1. Check that launcher was built successfully:
> output\nvda_snapshot_source-master-6310b86.exe
  1. Adding the following lines in core.py in def main right before app.MainLoop():
import tones
tones.beep(1000, 1000)
  1. Running NVDA from source to make sure beep can be heard:
> runnvda.bat
  1. Rebuild launcher:
> scons launcher
...
scons: `launcher' is up to date.
scons: done building targets.
  1. It appears scons didn't see any changes and didn't do anything, but let's try to run launcher again to see whether the beep can be heard:
$ output\nvda_snapshot_source-master-6310b86.exe

Actual behavior:

scons launcher doesn't see code changes and does not rebuild after code change. After my attempt to rebuild, no beep is heard when launching launcher.

Expected behavior:

scons launcher should be able to see code changes and rebuild launcher with code changes. Beep should be heard when launching launcher.

System configuration

NVDA installed/portable/running from source:

Running from source

NVDA version:

Commit 6310b86

Windows version:

Windows 11

Name and version of other software in use when reproducing the issue:

N/A

Other information about your system:

N/A

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

N/A

Activity

  1. mltony commented on Feb 21, 2022

    @mltony
    ContributorAuthor

    In the end I found a workaround to this issue (thanks @josephsl for suggesting this in #10833):

    1. Commit changes to a local commit.
    2. Run:
    scons --clean
    git reset --hard
    scons launcher
    

    Still it would be great if scons could work without manually cleaning the whole repository.
    cc: @lukaszgo1

  2. lukaszgo1 commented on Feb 21, 2022

    @lukaszgo1
    Contributor

    In fact it is unnecessary to clean the whole repository - you just need to delete the dist and output directories.

  3. mltony commented on Feb 21, 2022

    @mltony
    ContributorAuthor
  4. lukaszgo1 commented on Feb 21, 2022

    @lukaszgo1
    Contributor

    Nope, scons launcher fails after that.

    It does not fail for me. What error you get?

  5. mltony commented on Feb 26, 2022

    @mltony
    ContributorAuthor

    @lukaszgo1, Actually you're right, it appears to work. I was sure I tried that before though but must be in combination with scons --clean that apparently broke the build. So that is a valid work around. I would keep this issue open though, since I would expect a build system to track file changes and not require manual cleanup.

  6. added
    triagedHas been triaged, issue is waiting for implementation.
    on Feb 28, 2022
  7. hwf1324 commented on Dec 4, 2023

    @hwf1324
    Contributor

    I spent a whole day investigating this issue. I'm sorry, but I actually have very little knowledge about building systems, so I could only look through some official documentation to find possible solutions.

    Below are some of my survey results:

    In SCons, using the --tree parameter allows you to observe the reference to the dependency core.py.

    But in the result of the --debug=prepare parameter, it is missing again.

    I don't understand why SCons doesn't check for changes in these files, the scripts in this repo are too complex for me.

    Finally, I submitted a PR #15877, using the AlwaysBuild function to force the dist to be rebuilt every time the build is executed to solve this issue.

    But there are still some flaws, I don't know how to make py2exe only replace the modified parts during construction
    @LeonarddeR What is your opinion?

  8. added a commit that references this issue on Dec 7, 2023
    7402acd
  9. added this to the 2024.1 milestone on Dec 7, 2023
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

    audience/nvda-devPR or issue is relevant to NVDA / Add-on developerscomponent/buildtriagedHas been triaged, issue is waiting for implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions