Skip to content

[build-script] Clean submodules where applicable #4553

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

Merged
merged 1 commit into from
Aug 30, 2016
Merged

[build-script] Clean submodules where applicable #4553

merged 1 commit into from
Aug 30, 2016

Conversation

alblue
Copy link
Contributor

@alblue alblue commented Aug 30, 2016

When updating the project with the clean option, ensure that sub modules are cleaned as well. This issue can be tested by adding a line to swift-corelibs-libdispatch/libkqueue/README.md - if this file is changed then the reset hard on the libdispatch project will fail silently before this fix. As a result the libdispatch project checkout can become out of date.

Resolves SR-2524.

When building Swift from a non-clean checkout, the git reset that
occurs on subprojects that include submodules may fail if the submodule
is deemed to have been changed (for example, by running the autoconf
scripts).

When cleaning the projects, ensure that git submodule is used to clean
submodules and reset them to their original state as well, so that the
project can be reset successfully.

Issue: SR-2524

When building Swift from a non-clean checkout, the `git reset` that
occurs on subprojects that include submodules may fail if the submodule
is deemed to have been changed (for example, by running the autoconf
scripts).

When cleaning the projects, ensure that `git submodule` is used to clean
submodules and reset them to their original state as well, so that the
project can be reset successfully.

Issue: SR-2524
@jrose-apple
Copy link
Contributor

Is it possible to just not build those dependencies in-tree? The intent is that all build products and intermediates end up in build/.

@alblue
Copy link
Contributor Author

alblue commented Aug 30, 2016

The problem is that the libdispatch project includes those modules as git submodules; and if one of those files is inadvertently changed then it prevents the parent project from being "git reset" to head. So it's not actually about the binaries or whether these should be rebuilt or not, but whether it prevents the libdispatch project from being correctly updated with the right code.

Note that the problem occurs when running the "update-checkout" script and is before the build occurs.

You can see the problem in action by doing:

(cd swift-corelibs-dispatch; git reset --hard HEAD^)
echo "Prevent dispatch from being updated" >> swift-corelibs-dispatch/libkqueue/README.md
utils/update-checkout --clone --clean

The problem is that after this step the swift-corelibs-dispatch is still pointing to HEAD^ and isn't updated, because a change to the source files in the submodule results in the git reset failing (silently).

@jrose-apple
Copy link
Contributor

Ah, sorry. I thought this was just about building because of the "build-script" in the title.

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor

@swift-ci Please smoke test Linux platform

@jrose-apple jrose-apple merged commit b120535 into swiftlang:master Aug 30, 2016
@jrose-apple
Copy link
Contributor

Thanks, Alex!

aaditya-chandrasekhar pushed a commit to val-verde/swift that referenced this pull request Sep 30, 2022
[pull] swiftwasm-release/5.7 from release/5.7
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