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

Place build.db under the scratch directory #7471

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kateinoigakukun
Copy link
Member

Motivation:

The build database should be shared between different triple builds to re-generate the build manifest correctly.

With the current implementation, the following build command sequence fails:

# 1st iteration: They both do not trigger "PackageStructure" build
$ swift build --experimental-swift-sdk wasm32-unknown-wasi
$ swift build

# 2nd iteration: They both trigger "PackageStructure" build because there is description.json and debug.yaml
$ swift build --experimental-swift-sdk wasm32-unknown-wasi
$ swift build

# 3rd iteration: Manifest cache entry in .build/wasm32-unknown-wasi/build.db created by 2nd iteration hits,
# so do not update debug.yaml. <--- Incorrect
$ swift build --experimental-swift-sdk wasm32-unknown-wasi

Modifications:

This changes the llbuild build database to be placed under .build/build.db instead of .build/<product triple>/build.db.
Also this change splits llbuild target names for each triple to avoid cache invalidation when switching triple.

Result:

build.db will be shared across product target triples, and SwiftPM will keep consistent cache state when switching triples.

The build database should be shared between different triple builds to
re-generate the build manifest correctly.
Also this change splits llbuild target names for each triple to avoid cache
invalidation when switching triple.
@kateinoigakukun
Copy link
Member Author

@swift-ci test

@kateinoigakukun kateinoigakukun marked this pull request as ready for review April 22, 2024 15:45
@MaxDesiatov MaxDesiatov added enhancement build system Changes to interactions with build systems labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system Changes to interactions with build systems enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants