-
Notifications
You must be signed in to change notification settings - Fork 515
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
[dotnet] Compute relative paths using absolute paths. #20374
Conversation
The 'MSBuild::MakeRelative' path takes the current directory into account. Given the following example: $([MSBuild]::MakeRelative('/Users/rolf/testproject/','Info.plist')) returns: 1. `/Info.plist` if the current directory is the root directory (`/`). 2. `Info.plist` otherwise. This is a problem, because we specifically look for "Info.plist" during the build, and if we don't find it, we may end up with this error: > A bundle identifier is required. Either add an 'ApplicationId' property in the project file, or add a 'CFBundleIdentifier' entry in the project's Info.plist file. The fix is to instead of use the relative `Info.plist` path in the call to `[MSBuild]::MakeRelative`, use the full path instead: $([MSBuild]::MakeRelative('/Users/rolf/testproject/','/Users/rolf/testproject/Info.plist')) and that always yields the expected "Info.plist" result.
I've seen multiple cases of the following error: > A bundle identifier is required. Either add an 'ApplicationId' property in the project file, or add a 'CFBundleIdentifier' entry in the project's Info.plist file. In all cases this has been been because the build fails to find Info.plist, when it's actually there. One source of this problem was found and fixed with xamarin#20374, but that's not the problem in other scenarios. So I'm adding a bit more diagnostic output to the FindItemWithLogicalName task, to try to track down why the task fails to find `Info.plist`.
💻 [PR Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
📚 [PR Build] Artifacts 📚Packages generatedView packagesPipeline on Agent |
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 170 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
) I've seen multiple cases of the following error: > A bundle identifier is required. Either add an 'ApplicationId' property in the project file, or add a 'CFBundleIdentifier' entry in the project's Info.plist file. In all cases this has been been because the build fails to find Info.plist, when it's actually there. One source of this problem was found and fixed with #20374, but that's not the problem in other scenarios. So I'm adding a bit more diagnostic output to the FindItemWithLogicalName task, to try to track down why the task fails to find `Info.plist`.
The 'MSBuild::MakeRelative' path takes the current directory into account.
Given the following example:
returns:
/Info.plist
if the current directory is the root directory (/
).Info.plist
otherwise.This is a problem, because we specifically look for "Info.plist" during the
build, and if we don't find it, we may end up with this error:
The fix is to instead of use the relative
Info.plist
path in the call to[MSBuild]::MakeRelative
, use the full path instead:and that always yields the expected "Info.plist" result.