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

Fix compiler warnings in example projects #506

Merged

Conversation

simonjbeaumont
Copy link
Collaborator

@simonjbeaumont simonjbeaumont commented Jan 16, 2024

Motivation

A recent example project was added that had a compiler warning which wasn't caught by CI. We can have our example code free of warnings and ensure they remain so by compiling them with -warnings-as-errors in CI.

On further investigation, we cannot enable -warnings-as-errors in the examples Ci pipeline because we're reusing the shared build/cache directories which produces its own warnings for left over unused modules.

Modifications

  • Fix compiler warnings in example.
  • Build with -warnings-as-errors in examples CI pipeline.

Result

Example projects compile without warnings.

Test Plan

CI updated.

@simonjbeaumont
Copy link
Collaborator Author

Oh, this is annoying:

[16/19] Compiling HelloWorldURLSessionClient Client.swift
/tmp/test-examples.sh.mM8MYEM7LH/swift-openapi-example-cache/x86_64-unknown-linux-gnu/debug/CBacktrace.build/module.modulemap:2:14: error: umbrella directory '/tmp/test-examples.sh.mM8MYEM7LH/swift-openapi-example-cache/checkouts/swift-backtrace/Sources/CBacktrace/include' not found
    umbrella "/tmp/test-examples.sh.mM8MYEM7LH/swift-openapi-example-cache/checkouts/swift-backtrace/Sources/CBacktrace/include"

This is leftover because we're using the shared cache/build dirs, which produces a warning. I guess we cannot enable -warnings-as-errors in CI then.

Will update PR to just fix the code to remove the compiler warning instead.

@simonjbeaumont simonjbeaumont marked this pull request as ready for review January 22, 2024 16:25
@simonjbeaumont simonjbeaumont merged commit 7bd8dad into apple:main Jan 22, 2024
9 checks passed
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