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: Resolve Xcode stale files warnings #1496

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Oct 8, 2024

Platforms affected

iOS

Motivation and Context

Closes GH-1372.

Description

To get output app/ipa files in the expected places, we were overriding the SYMROOT value for command-line builds. However, this doesn't get applied when building in Xcode, and then it complains about "Stale files" in the Derived Data folder due to some things having been compiled with one SYMROOT value and others with a different one.

Setting SYMROOT is a hack anyways, what we really want to do is set an install path and force the app bundles to be installed into the destination folders after they are built. This allows Xcode to use the same Derived Data path for all builds, and avoids cluttering the Cordova destination folders with intermediate build artifacts.

Except, that we can't do this for iOS app bundles because changing the install path corrupts the xcarchives that are produced as part of exporting an ipa bundle. So we need to make all this INSTALL_PATH and DEPLOYMENT_ROOT stuff conditional based on whether we're building for a Simulator, Catalyst/macOS, or for a real iOS device.

Testing

Alternated building a project in both Xcode and command-line and ensured that there were no warnings about stale files.

(Note if you are trying this yourself, it needs to be a new project that has not been built already, otherwise you need to clean it to remove any existing stale files pre-dating this change)

Checklist

  • I've run the tests to see all new and existing tests pass
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)

@dpogue dpogue added this to the 8.0.0 milestone Oct 8, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.89%. Comparing base (92df3b7) to head (472d6bf).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1496   +/-   ##
=======================================
  Coverage   80.89%   80.89%           
=======================================
  Files          16       16           
  Lines        1842     1842           
=======================================
  Hits         1490     1490           
  Misses        352      352           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  • Cleared out DerivedData.
  • Created new project
  • Built app in CLI and confirmed no stale output
  • Built app in Xcode. Didn't notice stale output in build report tab.

@dpogue dpogue merged commit 2f0e19e into apache:master Oct 8, 2024
10 checks passed
@dpogue dpogue deleted the stale-attempt2 branch October 8, 2024 08:28
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.

cordova creating hundreds of Xcode 14 "stale files outside root paths" warnings
3 participants