Bug 34687 - strip depends on xcode-select path
Summary: strip depends on xcode-select path
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: master
Hardware: PC Mac OS
: Normal minor
Target Milestone: Untriaged
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2015-10-08 11:47 UTC by Rodrigo Kumpera
Modified: 2016-05-11 11:07 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Rodrigo Kumpera 2015-10-08 11:47:27 UTC
While trying to get the tvos template building I hit the following compilation failure:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/TVOS/Xamarin.iOS.Common.targets: error : Tool exited with code: 1. Output: /Applications/Xcode7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: object: /Users/kumpera/Projects/bitcode.me.up/bitcode.me.up/bin/iPhone/Release/bitcode.me.up.app/bitcode.me.up malformed object (unknown load command 9)

This was due to xcode-select pointing to Xcode 7 (and not 7.1 beta 3).

Other parts of the build process don't depend on its path to find the right tools to invoke.

I assume we want to make our toolchain independent of xcode-select. If that's the case, this is a bug.
Comment 1 Sebastien Pouliot 2015-10-08 15:39:17 UTC
Yes, other tools (from mtouch or msbuild) all respect XS settings - and `strip` should do the same.
Comment 2 Jeffrey Stedfast 2015-10-08 15:42:19 UTC
Don't we just use /usr/bin/strip?
Comment 3 Sebastien Pouliot 2015-10-08 15:56:14 UTC
@Jeff, no (at least we should not). That can get you to the situation above (we have a similar issue with lipo in the past).
Comment 4 Jeffrey Stedfast 2015-10-08 16:05:15 UTC
No, I'm saying the code *already* uses /usr/bin/strip
Comment 5 Jeffrey Stedfast 2015-10-08 16:06:57 UTC
Anyway, fixed:

commit 37adaa865d4c963073391c3dce8e1b88f84f0d6b
Author: Jeffrey Stedfast <jeff@xamarin.com>
Date:   Thu Oct 8 16:05:28 2015 -0400

    [msbuild] Use the strip from within the configured Xcode.app bundle
    Fixes bug #34687?
Comment 6 Sebastien Pouliot 2015-10-08 16:15:50 UTC
@Jeff thanks. My _at least we should not_ meant it is wrong (and it was not what mtouch was doing before) for the reason Rodrigo filed this bug report.

/usr/bin/strip is a small wrapper that calls the `strip` command from the `xcode-select`ed directory, which might not be the right one (as specified in XS preferences). If you select a newer Xcode (in XS) then the current `strip` (or other tools like `lipo`) might not understand the new formats.
Comment 7 Vincent Dondain [MSFT] 2016-05-11 11:07:26 UTC
Regression test added in:

commit eeebd80f6ba834b992086612d13a86630af37d0a
Author: VincentDondain <vincent.dondain@xamarin.com>
Date:   Fri Apr 8 19:23:01 2016 +0100

    [msbuild/tests] Add SymbolStripTaskTests