Title: fix(ios): let the app's xcconfig win over a plugin's, and warn on discarded settings by edusperoni · Pull Request #6091 · NativeScript/nativescript-cli · GitHub
Open Graph Title: fix(ios): let the app's xcconfig win over a plugin's, and warn on discarded settings by edusperoni · Pull Request #6091 · NativeScript/nativescript-cli
X Title: fix(ios): let the app's xcconfig win over a plugin's, and warn on discarded settings by edusperoni · Pull Request #6091 · NativeScript/nativescript-cli
Description: An app currently has no way to override a build setting that a plugin declares, and no way to find out that it failed to. The app's xcconfig never wins XcconfigService.mergeFiles keeps whichever value is already in the destination and deletes the incoming one: userConfig.attributes.each do |key,| existingConfig.attributes.delete(key) if (userConfig.attributes.key?(key) && existingConfig.attributes.key?(key)) end userConfig.merge(existingConfig) First writer wins — and mergeProjectXcconfigFiles merged every plugin's platforms/ios/build.xcconfig before the app's App_Resources/iOS/build.xcconfig. So for any key a plugin set, the app's value was discarded outright. Not "sometimes lost": never applied. Among plugins the winner was whichever came first in dependency-resolution order, which nobody controls. This PR merges the app's file first. Plugins still supply every key the app says nothing about; they just stop overriding the ones it does. Where this bites today: V8 14.9 (NativeScript iOS 9) made v8config.h reject C++17 outright — #if __cplusplus <= 201703L #error "C++20 or later required." #endif — while several plugins pin CLANG_CXX_LANGUAGE_STANDARD = c++17, which sat exactly on the old floor. One stale transitive plugin holds the whole app below the floor, and the app cannot lift it. The resulting error points at the runtime's headers rather than at the plugin that pinned the standard. Discarded settings are now reported The merge dropped keys in silence, so a discarded setting was indistinguishable from one that was never written. That's the reason the case above is hard to diagnose: nothing tells you which plugin pinned the value, and the failure surfaces somewhere else entirely. mergeFiles now reports what it dropped: Ignoring CLANG_CXX_LANGUAGE_STANDARD = c++17 from node_modules/some-plugin/platforms/ios/build.xcconfig: already set to c++20 by a higher precedence xcconfig. The app's App_Resources xcconfig wins over any plugin's. Only conflicts whose values genuinely differ are reported — two files agreeing on a key is not worth a warning, and that keeps this quiet on normal projects. Reporting is also fully isolated from the merge: an unparseable result is traced and ignored, never thrown. Compatibility The precedence change is behavioural. An app that sets a key a plugin also sets now gets its own value where it previously got the plugin's. That is the intent, but it can surface a latent misconfiguration — a value set long ago that silently never applied and now does. The new warning makes those visible rather than mysterious. Conflicts between plugins are unchanged: still resolved by dependency order, still arbitrary. xcconfig can't express "highest wins" for an ordered value like a language standard, so warning is the practical ceiling; this PR at least makes them audible. Tests npm test — 1514 passing, 9 pending, 0 failures. Added The app's build.xcconfig wins over a plugin's, which sets CLANG_CXX_LANGUAGE_STANDARD in both an app and a plugin xcconfig and asserts the app's value survives while a plugin-only key still lands. It runs the real xcodeproj merge rather than a stub, so it also covers the modified Ruby. test/xcconfig-service.ts gains a logger registration for the new dependency. Summary by CodeRabbit Bug Fixes Updated iOS xcconfig merging so app App_Resources settings are authoritative over plugin-provided values when conflicts occur. Added warnings for detected xcconfig key conflicts, while continuing to preserve the higher-priority (app) values. Tests Added a merge test covering precedence for conflicting CLANG_CXX_LANGUAGE_STANDARD, ensuring app-pinned values win while unrelated plugin settings (e.g., GCC_C_LANGUAGE_STANDARD) are retained.
Open Graph Description: An app currently has no way to override a build setting that a plugin declares, and no way to find out that it failed to. The app's xcconfig never wins XcconfigService.mergeFiles keeps whicheve...
X Description: An app currently has no way to override a build setting that a plugin declares, and no way to find out that it failed to. The app's xcconfig never wins XcconfigService.mergeFiles keeps whic...
Opengraph URL: https://github.com/NativeScript/nativescript-cli/pull/6091
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c979ec53-ef21-c7c6-802f-b56b6a172598 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8B20:38C5CF:34CC466:42F4AF9:6B01C1A9 |
| html-safe-nonce | da06535eef31e97bf4dbc95d66b75762e76bb850327d9ae3b0114723fb08b00b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjIwOjM4QzVDRjozNENDNDY2OjQyRjRBRjk6NkIwMUMxQTkiLCJ2aXNpdG9yX2lkIjoiMjYxNTA1NjMyOTYyNjIwNjYzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0b5918eb6da6f589c7fcb2e57156b240fe1f8b582a8d5279b46e9a0986ce374d |
| hovercard-subject-tag | pull_request:4154633061 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NativeScript/nativescript-cli/pull/6091/files |
| twitter:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| og:image:alt | An app currently has no way to override a build setting that a plugin declares, and no way to find out that it failed to. The app's xcconfig never wins XcconfigService.mergeFiles keeps whicheve... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 21347346 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21347346 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width