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

Generated NAIX headers trigger a full source rebuild #200

Open
lhearachel opened this issue May 9, 2024 · 4 comments
Open

Generated NAIX headers trigger a full source rebuild #200

lhearachel opened this issue May 9, 2024 · 4 comments

Comments

@lhearachel
Copy link
Collaborator

Introduced by #198

Steps to Reproduce

Assuming a freshly-cloned repository up-to-date with main:

  1. Run ./build.sh.
  2. Open res/battle/scripts/subscripts/subscript_mimic.s
  3. Make the following change:
-    WaitButtonABTime 30
+    WaitButtonABTime 15
  1. Run ./build.sh. Observe that the NARC only requests subscript_mimic to be rebuilt, but all source-code files are rebuilt afterwards due to the dependency on the generated NAIX.

Expected Behavior

Only the following source-code files which explicitly include battle/scripts/sub_seq.naix should be rebuilt:

include/data/move_side_effect_subscripts.h
src/battle/battle_controller.c
src/battle/battle_lib.c
src/battle/battle_script.c
@mid-kid
Copy link
Member

mid-kid commented May 9, 2024

I assume this happens due to the header being updated whenever a naix file changes? What about the header depends directly on the contents of naix files?

@lhearachel
Copy link
Collaborator Author

lhearachel commented May 9, 2024

For clarity on terminology, a NAIX header is built by knarc during the process of packing a NARC. We use such headers in the source files to refer to files within a particular NARC. For an example, refer to src/battle/battle_controller.c and search for instances of subscript_.

From what I can tell, the core issue is that global.pch is being rebuilt, or detected as dependent on that NAIX header. I'm not sure why that is, but it is the clearest explanation that I can think of for why the full source tree is rebuilt.

@mid-kid
Copy link
Member

mid-kid commented May 9, 2024

In that case my question would be: When does the file layout of a NARC change? If it can only be changed by editing the build system, maybe it shouldn't be generated as a by-product of actually packing the files into a NARC. Instead it could be generated while setting up the build system (as a configure_file() with a command), or simply without depending on the files to be packed into the NARC.

I'm not sure how precompiled headers work, but even if it's excluded, I wonder how much of the codebase would be rebuilt after changing the contents of a NARC.

@lhearachel
Copy link
Collaborator Author

Unfortunately, moving the NARC file layout declaration to configuration time doesn't really solve the underlying issue. The full source tree would still be rebuilt if a user added a new file to that NARC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants