Skip to content

Conversation

@BalestraPatrick
Copy link
Member

After bumping our rules_swift version to d69bc40, we noticed some failures possibly related to the changes in 9a1073d.

About 10-20% of our builds started failing on CI and locally with errors such as:

ERROR: /path/to/repo/BUILD.bazel:9:14: output 'container/Wiring/ContainerWiring.swiftsourceinfo' was not created

Digging into the execution log, it seems like this file was in listed_outputs but not present in actual_outputs in some cases. We always build with sandbox on.

Basically in https://github.com/bazelbuild/rules_swift/pull/523/files we wanted to add support for swiftsourceinfo. Even though that PR wasn’t merged as far as I can see, the cherry-picked commit from upstream (#692) didn’t even contain the change to tools/worker/output_file_map.cc. The following patch fixes it for me on a local machine that previously was failing 100% of the builds with errors like the one above.

@google-cla google-cla bot added the cla: yes label Oct 7, 2021
@brentleyjones
Copy link
Collaborator

Thanks @BalestraPatrick! After reverting the one part, I can merge this.

@BalestraPatrick BalestraPatrick force-pushed the fix-swiftsourceinfo-failures branch from 1bfc72d to 40cf41d Compare October 7, 2021 14:35
@google-cla
Copy link

google-cla bot commented Oct 7, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Oct 7, 2021
@keith
Copy link
Member

keith commented Oct 7, 2021

From slack it sounds like the thought with not adding it here is that it's always emitted whether you ask for it or not. I think doing this will fix that error but likely produce empty files instead

@BalestraPatrick BalestraPatrick force-pushed the fix-swiftsourceinfo-failures branch from 40cf41d to c27edab Compare October 7, 2021 14:45
@google-cla google-cla bot added cla: yes and removed cla: no labels Oct 7, 2021
@brentleyjones
Copy link
Collaborator

I believe this fix is 100% correct. I'm not sure why the upstream change didn't have it.

@brentleyjones brentleyjones merged commit c3bf28c into bazelbuild:master Oct 7, 2021
@keith
Copy link
Member

keith commented Oct 7, 2021

@allevato

@allevato
Copy link
Member

allevato commented Oct 7, 2021

I believe this fix is 100% correct. I'm not sure why the upstream change didn't have it.

Because I have a pending change that adds it, along with a number of other incremental improvements, which I thought I would land by now. But other things got in the way 😅

We don't really use incremental mode internally (because historically it hasn't been well-tested and hasn't saved much when it has been used), so that would explain why we never experienced the issue.

@BalestraPatrick BalestraPatrick deleted the fix-swiftsourceinfo-failures branch October 7, 2021 15:36
@acecilia
Copy link

acecilia commented Nov 23, 2021

I am experiencing the same problem when building a mac CLI with bazel (using swift_library rule). Tried using the latest commit on master (which includes this PR), but did not help. I am not using incremental compilation.

EDIT:
I am using --compilation_mode opt. Changing to --compilation_mode fastbuild solves the problem

@keith
Copy link
Member

keith commented Nov 29, 2021

huh, can you file an issue with a repro case?

@acecilia
Copy link

acecilia commented Jan 5, 2022

Sorry for late reply. I was now trying to reproduce the problem and provide a reproducible case, but seems I cant anymore 😕 Maybe I was doing something wrong, or could be that during last month other changes in my project fixed the problem

tymurmustafaiev pushed a commit to tymurmustafaiev/rules_swift that referenced this pull request Jul 19, 2023
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.

5 participants