Quantcast
Channel: Package Manager - Swift Forums
Viewing all articles
Browse latest Browse all 166

Warnings as errors in sub packages

$
0
0

Hello,

We're having some problems with using warnings-as-errors in new Xcode versions. I've searched online and no-one is talking about this issue so here goes...

Our project is split up into multiple sub packages and at the top we have an Xcode workspace which contains the iOS application Xcode project.

We use warnings-as-errors in ALL of our modules, in every sub package, via .unsafeFlags(["-warnings-as-errors"]) SwiftSetting defined on each module. Treat warnings as errors is also enabled in the app Xcode project.

Day to day workflow for engineers is to work directly inside a sub package rather than in the workspace, for obvious reasons. Sub packages themselves can depend on other, lower level, sub packages. So something like:

Core - no dependencies
Feature A - depends on Core sub package
App - depends on both Core and Feature A sub packages

Starting in Xcode 15.2, when working in Feature A we started seeing "ghost" errors produces by Xcode saying `Conflicting options '-warnings-as-errors' and '-suppress-warnings' (in target 'X' from project 'Core'). By ghost errors I mean they were reported as errors but did not produce a nonzero exit code, so the build passed. That changed in Xcode 15.3 where these now do fail the build.

Inspecting the Xcode build log the -suppress-warnings is indeed added automatically. Strangely this is NOT an issue when working in the main workspace - there Xcode does not add -suppress-warnings automatically - but only when working in a package directly in Xcode.

Is there a way to prevent Xcode from adding -suppress-warnings automatically when building local sub package modules? A bit surprised noone is having these issues, is using warnings-as-errors not a common practice?

Thanks for any help in advance

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 166

Trending Articles