Ticket #17610 (closed defect: fixed)
xcodebuild: unknown option: -sdk
| Reported by: | ryandesign@… | Owned by: | pguyot@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts 1.7.0 |
| Component: | base | Version: | 1.7.0 |
| Keywords: | Cc: | skl@… | |
| Port: | sleepwatcher |
Description
I successfully built sleepwatcher @2.0.5_0+universal on Mac OS X 10.4.11 Intel with Xcode 2.5 on June 29, 2008. But I can't build it on the same Mac with the same OS and Xcode version today. It says:
$ port -nfd upgrade sleepwatcher
DEBUG: Found port in file:///Users/rschmidt/macports/dports/sysutils/sleepwatcher
DEBUG: epoch: in tree: 0 installed: 0
DEBUG: sleepwatcher 2.0.5_0 exists in the ports tree
DEBUG: sleepwatcher 2.0.5_0 is installed
DEBUG: Not following dependencies
DEBUG: variants to install {} universal
DEBUG: available variants are : universal server
DEBUG: variant universal is present in sleepwatcher 2.0.5_0
DEBUG: new portvariants: universal +
DEBUG: Changing to port directory: /Users/rschmidt/macports/dports/sysutils/sleepwatcher
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: Using group file /Users/rschmidt/macports/dports/_resources/port1.0/group/xcode-1.0.tcl
DEBUG: Re-registering default for use_configure
DEBUG: Re-registering default for build.cmd
DEBUG: Re-registering default for build.pre_args
DEBUG: Re-registering default for build.target
DEBUG: Re-registering default for destroot.cmd
DEBUG: Re-registering default for destroot.pre_args
DEBUG: Re-registering default for destroot.target
DEBUG: Re-registering default for destroot.destdir
DEBUG: universal variant already exists, so not adding the default one
DEBUG: Requested variant darwin is not provided by port sleepwatcher.
DEBUG: Requested variant i386 is not provided by port sleepwatcher.
DEBUG: Requested variant macosx is not provided by port sleepwatcher.
DEBUG: Executing variant universal provides universal
DEBUG: Executing org.macports.main (sleepwatcher)
---> Fetching sleepwatcher
DEBUG: Executing proc-pre-org.macports.fetch-fetch-0
DEBUG: Executing org.macports.fetch (sleepwatcher)
---> sleepwatcher_2.0.5_src.tgz doesn't seem to exist in /mp/var/macports/distfiles/sleepwatcher
DEBUG: Pinging www.bernhard-baehr.de...
DEBUG: Pinging distfiles.macports.org...
DEBUG: Pinging trd.no.distfiles.macports.org...
DEBUG: www.bernhard-baehr.de ping time is 153.488
DEBUG: distfiles.macports.org ping time is 64.735
DEBUG: trd.no.distfiles.macports.org ping time is 171.666
---> Attempting to fetch sleepwatcher_2.0.5_src.tgz from http://distfiles.macports.org/sleepwatcher
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 64416 100 64416 0 0 60857 0 0:00:01 0:00:01 --:--:-- 106k
---> Verifying checksum(s) for sleepwatcher
DEBUG: Executing org.macports.checksum (sleepwatcher)
---> Checksumming sleepwatcher_2.0.5_src.tgz
DEBUG: Correct (md5) checksum for sleepwatcher_2.0.5_src.tgz
DEBUG: Correct (sha1) checksum for sleepwatcher_2.0.5_src.tgz
DEBUG: Correct (rmd160) checksum for sleepwatcher_2.0.5_src.tgz
---> Extracting sleepwatcher
DEBUG: Executing org.macports.extract (sleepwatcher)
---> Extracting sleepwatcher_2.0.5_src.tgz
DEBUG: setting option extract.args to /mp/var/macports/distfiles/sleepwatcher/sleepwatcher_2.0.5_src.tgz
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/mp/var/macports/build/_Users_rschmidt_macports_dports_sysutils_sleepwatcher/work" && gzip -dc /mp/var/macports/distfiles/sleepwatcher/sleepwatcher_2.0.5_src.tgz | /usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing proc-post-org.macports.extract-extract-0
DEBUG: Executing org.macports.patch (sleepwatcher)
---> Configuring sleepwatcher
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (sleepwatcher)
---> Building sleepwatcher
DEBUG: Executing org.macports.build (sleepwatcher)
DEBUG: Assembled command: 'cd "/mp/var/macports/build/_Users_rschmidt_macports_dports_sysutils_sleepwatcher/work/sleepwatcher_2.0.5_src" && xcodebuild -alltargets -configuration Deployment build -sdk /Developer/SDKs/MacOSX10.4u.sdk OBJROOT=build/ SYMROOT=build/ ARCHS="ppc i386" MACOSX_DEPLOYMENT_TARGET=10.4 '
unknown option: -sdk
Usage: xcodebuild [-project <projectname>] [-activetarget] [-alltargets] [-target <targetname>]... [-activeconfiguration] [-configuration <configurationname>] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild [-version]
xcodebuild [-list]
Error: Target org.macports.build returned: shell command "cd "/mp/var/macports/build/_Users_rschmidt_macports_dports_sysutils_sleepwatcher/work/sleepwatcher_2.0.5_src" && xcodebuild -alltargets -configuration Deployment build -sdk /Developer/SDKs/MacOSX10.4u.sdk OBJROOT=build/ SYMROOT=build/ ARCHS="ppc i386" MACOSX_DEPLOYMENT_TARGET=10.4 " returned error 1
Command output: unknown option: -sdk
Usage: xcodebuild [-project <projectname>] [-activetarget] [-alltargets] [-target <targetname>]... [-activeconfiguration] [-configuration <configurationname>] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild [-version]
xcodebuild [-list]
Warning: the following items did not execute (for sleepwatcher): org.macports.destroot org.macports.build
DEBUG: invalid command name "::ui_init"
while executing
"::ui_init $priority $prefix $channels $message"
("uplevel" body line 2)
invoked from within
"uplevel 1 $body"
Error: Unable to upgrade port: 1
I had been running MacPorts from trunk. I'm currently running 1.7.0-rc1. I suspect the problem was caused by r41249 which introduced the "-sdk" option into the xcode portgroup; perhaps the -sdk option only exists as of Xcode 3? It's not listed in Xcode 2.5's "xcodebuild --help".
Change History
comment:2 Changed 4 years ago by toby@…
See r41249 ... looks like the xcode portgroup isn't Tiger-friendly for universal building. Oh well.
comment:4 Changed 4 years ago by toby@…
- Status changed from new to closed
- Resolution set to fixed
Yep, looks fixed.
comment:5 Changed 4 years ago by skl@…
I ran into this bug on Leopard 10.5.6 with XCode 3.0 too.
The manpage of xcodebuild says:
-default=value
Set the user default default to value.
so IMO there's only a "=" char missing. After adding "=" to the -sdk option, giving -sdk=/Developer/SDKs/MacOSX10.5.sdk everything ran as expected and the build succeeded.
comment:6 Changed 4 years ago by ryandesign@…
- Cc skl@… added
The manpage for the xcodebuild included with Xcode 3.1.2 says:
xcodebuild [-project projectname] [-activetarget] [-alltargets]
[-target targetname] [-parallelizeTargets]
[-activeconfiguration] [-configuration configurationname]
[-sdk <sdkfullpath> | <sdkname>] [buildaction ...]
[setting=value ...] [-default=value ...]
So, it shows that there should be no equals sign between "-sdk" and the SDK path.
Xcode 3.0 is not supported for use with MacPorts; it's too old. Please update.


I think it uses the SDKROOT environment variable instead ?
There should also be ARCHS, for setting the architectures...