Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCons: Fix incremental builds breaking when querying the dependency tree from a SCsub #88025

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

shana
Copy link
Contributor

@shana shana commented Feb 6, 2024

I'm querying the scons dependency tree to calculate some build information in a SCsub, via SCons.Node.FS.File.children(). This call causes scons to access the .sconsign database, to lookup the build information up to that point. When this happens on an SCsub invoked via a Sconscript() call, the path to the .sconsign file is interpreted as being relative to the current executing SCsub, not to the top-level SConstruct file.

When this happens, it completely breaks incremental builds, because scons can't find build information in the "local" sconsign file (which is created on the spot with only the local SCsub build information), so scons decides to rebuild everything.

I don't know why scons is doing this, given that all other build information is recorded on the top level sconsign file, including the build information related to the executing SCsub, but it is happening. Possibly a scons bug?

This PR sets an absolute path for SConsignFile, so any queries to the dependency database use the same database file, regardless of local executing SCsub context.

Contributed by W4Games ❤️

/cc @akien-mga @mhilbrunner

@shana shana marked this pull request as ready for review February 6, 2024 18:34
@shana shana requested a review from a team as a code owner February 6, 2024 18:34
@AThousandShips AThousandShips added this to the 4.3 milestone Feb 6, 2024
…hare the same database

SConscript("some SCsub path") calls create a new context where a relative path
to the .sconsign file is interpreted as being next to the currently executing
SCsub, and not the one at the root. This breaks incremental build detection
because scons can't find the build information of dependent files outside of the
SCsub directory and just rebuilds everything every time.
@shana shana force-pushed the fix-incremental-builds branch from 3c0c583 to 0b43b01 Compare February 6, 2024 18:52
@akien-mga akien-mga added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Feb 6, 2024
@akien-mga akien-mga changed the title Fix incremental builds breaking when querying the scons dependency tree from a SCsub SCons: Fix incremental builds breaking when querying the dependency tree from a SCsub Feb 7, 2024
@akien-mga akien-mga merged commit 6b1e50b into godotengine:master Feb 7, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@shana shana deleted the fix-incremental-builds branch February 8, 2024 09:19
@akien-mga akien-mga added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Mar 9, 2024
@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.
Cherry-picked for 4.1.4.

@akien-mga akien-mga removed cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants