Skip to content

DAOS-19906 build: keep libraft.a and tests_main between builds - #86

Open
OrHayat wants to merge 3 commits into
daos-stack:masterfrom
OrHayat:or/raft-file-targets
Open

OrHayat wants to merge 3 commits into
daos-stack:masterfrom
OrHayat:or/raft-file-targets

Conversation

@OrHayat

@OrHayat OrHayat commented Nov 3, 2026 •

Copy link
Copy Markdown

Stop rebuilding raft on every DAOS scons run when nothing changed.

  • static and tests_main in the Makefile now name the files they build, and tests_main compiles each file to its own object, so make skips what is up to date.
  • Replace VPATH with pattern rules: library objects build from src, and test objects build as $(BUILDDIR)/test-*.o.
  • Remove libraft.a before ar recreates it, so a source dropped from OBJECTS can't leave a stale member.
  • src/SConscript marks libraft.a and tests_main Precious, so scons no longer deletes them before running make.
  • Editing raft sources or headers still rebuilds.

@OrHayat
OrHayat requested a review from a team as a code owner November 3, 2026 11:39
The static and tests_main targets now name the files they build and tests_main compiles each file to its own object, so make skips what is up to date, and SConscript marks both Precious so scons no longer deletes them before running make.

Signed-off-by: Or Hayat <or.hayat@volumez.com>
@OrHayat
OrHayat force-pushed the or/raft-file-targets branch from 3a2c7b9 to aa8d42e Compare November 3, 2026 11:44

@liw liw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @OrHayat. A couple of naive questions...

Comment thread Makefile Resolved
Comment thread Makefile Resolved
Build test objects under $(BUILDDIR)/test/ with one pattern rule, and remove libraft.a before recreating it.

Signed-off-by: Or Hayat <or.hayat@volumez.com>
Build test objects as $(BUILDDIR)/test-*.o instead of under $(BUILDDIR)/test/.

Signed-off-by: Or Hayat <or.hayat@volumez.com>
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

Successfully merging this pull request may close these issues.

2 participants