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

Mac: Fix universal binary build #2612

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

jnkvca
Copy link
Contributor

@jnkvca jnkvca commented Jan 29, 2024

My MacOS universal binary builds were corrupted when the C# project name contained some combination of letters. I went digging in and found the culprit. The TrimStart() method does not trim the specified parameter from the string start, but actually trims as much chars from the front of the string as possible as long as the given parameter contains all those chars (reference). This is used to trim the leading relative path of a file, so as a consequence the path gets corrupted.

For example, if my project name was MYPROJECT trimming bin/Debug/net6.0/osx-arm64/MYPROJECT.app/ from bin/Debug/net6.0/osx-arm64/MYPROJECT.app/Contents/MacOS/MYPROJECT would result in a corrupted path of cOS/MYPROJECT instead of the expected Contents/MacOS/MYPROJECT. Then my universal binary MYPROJECT.app would actually contain a subdirectory cOS with MYPROJECT binary.

@cwensley
Copy link
Member

Aha! Great find, thanks for digging into that and fixing the issue!

@cwensley cwensley added the bug label Jan 31, 2024
@cwensley cwensley added this to the 2.8.3 milestone Jan 31, 2024
@cwensley cwensley merged commit e5ec4de into picoe:develop Jan 31, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants