Giter Club home page Giter Club logo

Comments (35)

yonaskolb avatar yonaskolb commented on May 22, 2024 1

I noticed this in the Swift 4 release notes:

On macOS, Swift package builds now occur in a sandbox which prevents network access and file system modification, to help mitigate the effect of maliciously crafted manifests

I hadn't seen this mentioned before. Doesn't seem like there was a proposal for this. Still not sure how this affects homebrew installation

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024 1

@agurodriguez your error looks like you’re not compiling with Xcode 9.3, as it’s complaining about Swift 4.1’s compactMap not being found

from xcodegen.

daniel-beard avatar daniel-beard commented on May 22, 2024

May be related to having Xcode 9 GM installed.

from xcodegen.

jalopezcar avatar jalopezcar commented on May 22, 2024

I had the same problem with xcode9, it works with xcode8

sudo xcode-select -s .../Xcode.app

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

Yes, it won't build with Xcode 9 if that's your default. I'll update to Swift 4 hopefully in the next couple of days

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

Swift 4 upgrade implemented by #52

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

Just a note @daniel-beard, if you want to install a working Swift 4 version before the next release you can install from master:

$ git clone https://github.com/yonaskolb/XcodeGen.git
$ cd XcodeGen
$ make

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

I've released 1.0.0 with Swift 4 support, but this still seems to be an issue. Does anyone have any ideas on how to fix this, as I can't find any information about the error?

from xcodegen.

pepicrft avatar pepicrft commented on May 22, 2024

@yonaskolb I ran through similar issues when I tried to install xcode using Homebrew. I solved by adding the flag --no-sandbox.

brew install xcodegen --no-sandbox

Not sure about why the flag is needed though @yonaskolb

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

Thanks @pepibumur! That does indeed seem to fix the issue, strange...
I've updated the readme

from xcodegen.

pepicrft avatar pepicrft commented on May 22, 2024

Cool @yonaskolb

from xcodegen.

pepicrft avatar pepicrft commented on May 22, 2024

@yonaskolb, I think they prevent that people run code in the Package.swift that has access to the system somehow. But I don't think it's the case here since the Package.swift is not doing such thing. Weird :/

from xcodegen.

ehyche avatar ehyche commented on May 22, 2024

@yonaskolb : I ran:

brew update
brew tap yonaskolb/XcodeGen https://github.com/yonaskolb/XcodeGen.git
brew install XcodeGen --no-sandbox

and that fixed the "sandbox-exec: sandbox_apply_container: Operation not permitted" error. But I am still seeing the homebrew error, which causes XcodeGen to not install. Here is the output:

[ehyche@GM19403 ~]$ brew install XcodeGen --no-sandbox
==> Installing xcodegen from yonaskolb/xcodegen
==> Downloading https://github.com/yonaskolb/XcodeGen/archive/1.1.0.tar.gz
Already downloaded: /Users/ehyche/Library/Caches/Homebrew/xcodegen-1.1.0.tar.gz
==> Building XcodeGen
==> swift build -c release -Xswiftc -static-stdlib
Last 15 lines from /Users/ehyche/Library/Logs/Homebrew/xcodegen/01.swift:
Resolving https://github.com/yonaskolb/JSONUtilities at 3.3.8
Cloning https://github.com/JohnSundell/Unbox
Resolving https://github.com/JohnSundell/Unbox at 2.5.0
Cloning https://github.com/jpsim/Yams
Resolving https://github.com/jpsim/Yams at 0.3.6
Cloning https://github.com/tadija/AEXML.git
Resolving https://github.com/tadija/AEXML.git at 4.1.0
Cloning https://github.com/swift-xcode/xcodeproj.git
Resolving https://github.com/swift-xcode/xcodeproj.git at 0.1.2
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.7.2
Cloning https://github.com/onevcat/Rainbow.git
Resolving https://github.com/onevcat/Rainbow.git at 2.1.0
Cloning https://github.com/kylef/Commander.git
Resolving https://github.com/kylef/Commander.git at 0.6.1

If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
yonaskolb/xcodegen

/usr/local/Homebrew/Library/Homebrew/utils/github.rb:226:in `raise_api_error': curl failed!  (GitHub::Error)
curl: (22) The requested URL returned error: 422 Unprocessable Entity
curl: (3) <url> malformed
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:184:in `open'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:284:in `search'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:231:in `search_issues'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:244:in `issues_for_formula'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:369:in `fetch_issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:365:in `issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:419:in `dump'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:133:in `rescue in <main>'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:26:in `<main>'

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

@ehyche, I just noticed that too actually. It was working before but now that error occurs. Nothing has changed that I can see between 1.0.1 and 1.1.0. Maybe a homebrew update broken something?
The error from Homebrew doesn't really help. Running with -v gives a bit more info though

~/Developer/XcodeGen: brew install XcodeGen --no-sandbox -v
==> Installing xcodegen from yonaskolb/xcodegen
==> Downloading https://github.com/yonaskolb/XcodeGen/archive/1.1.0.tar.gz
Already downloaded: /Users/Yonas/Library/Caches/Homebrew/xcodegen-1.1.0.tar.gz
==> Verifying xcodegen-1.1.0.tar.gz checksum
tar xzf /Users/Yonas/Library/Caches/Homebrew/xcodegen-1.1.0.tar.gz
==> Building XcodeGen
==> swift build -c release -Xswiftc -static-stdlib
Compile CYaml src/scanner.c
Compile CYaml src/reader.c
Compile CYaml src/writer.c
Compile CYaml src/dumper.c
Compile CYaml src/parser.c
Compile CYaml src/emitter.c
Compile CYaml src/loader.c
Compile CYaml src/api.c
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `initialize': Operation not permitted - /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift.cc (Errno::EPERM)
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `open'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:350:in `log'
	from /usr/local/Homebrew/Library/Homebrew/shims/super/clang:369:in `<main>'
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /private/tmp/xcodegen-20170920-93543-fqqj0p/XcodeGen-1.1.0/.build/release.yaml main
Fetching https://github.com/kylef/PathKit.git
Fetching https://github.com/jpsim/Yams.git
Fetching https://github.com/kylef/Commander.git
Fetching https://github.com/yonaskolb/JSONUtilities.git
Fetching https://github.com/kylef/Spectre.git
Fetching https://github.com/onevcat/Rainbow.git
Fetching https://github.com/swift-xcode/xcodeproj.git
Fetching https://github.com/jpsim/Yams
Fetching https://github.com/tadija/AEXML.git
Fetching https://github.com/yonaskolb/JSONUtilities
Fetching https://github.com/JohnSundell/Unbox
Cloning https://github.com/kylef/PathKit.git
Resolving https://github.com/kylef/PathKit.git at 0.8.0
Cloning https://github.com/jpsim/Yams.git
Resolving https://github.com/jpsim/Yams.git at 0.3.6
Cloning https://github.com/yonaskolb/JSONUtilities.git
Resolving https://github.com/yonaskolb/JSONUtilities.git at 3.3.8
Cloning https://github.com/yonaskolb/JSONUtilities
Resolving https://github.com/yonaskolb/JSONUtilities at 3.3.8
Cloning https://github.com/JohnSundell/Unbox
Resolving https://github.com/JohnSundell/Unbox at 2.5.0
Cloning https://github.com/jpsim/Yams
Resolving https://github.com/jpsim/Yams at 0.3.6
Cloning https://github.com/tadija/AEXML.git
Resolving https://github.com/tadija/AEXML.git at 4.1.0
Cloning https://github.com/swift-xcode/xcodeproj.git
Resolving https://github.com/swift-xcode/xcodeproj.git at 0.1.2
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.7.2
Cloning https://github.com/onevcat/Rainbow.git
Resolving https://github.com/onevcat/Rainbow.git at 2.1.0
Cloning https://github.com/kylef/Commander.git
Resolving https://github.com/kylef/Commander.git at 0.6.1

==> Formula
Tap: yonaskolb/xcodegen
Path: /usr/local/Homebrew/Library/Taps/yonaskolb/homebrew-xcodegen/Formula/xcodegen.rb
==> Configuration
HOMEBREW_VERSION: 1.3.2-86-g5d888c0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 5d888c08a3186c7ca411a0197e4fcf36f2cd3769
Last commit: 3 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: e6b63822d703810d91b03c045009f8b1a65908ac
Core tap last commit: 75 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 9.0 build 900
Git: 2.13.5 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /opt/local/bin/perl => /opt/local/bin/perl5.16
Python: /usr/bin/python
Ruby: /Users/Yonas/.rvm/rubies/ruby-2.4.0/bin/ruby
Java: 1.8.0_77, 1.7.0_71
macOS: 10.12.6-x86_64
Xcode: 9.0
CLT: N/A
X11: N/A
MacPorts/Fink: /opt/local/bin/port
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/apache2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
MACOSX_DEPLOYMENT_TARGET: 10.12
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.12
HOMEBREW_SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/super:/usr/bin:/bin:/usr/sbin:/sbin

Error: yonaskolb/xcodegen/xcodegen 1.1.0 did not build
Logs:
     /Users/Yonas/Library/Logs/Homebrew/xcodegen/00.options.out
     /Users/Yonas/Library/Logs/Homebrew/xcodegen/01.swift
If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
yonaskolb/xcodegen

/usr/local/Homebrew/Library/Homebrew/utils/github.rb:226:in `raise_api_error': curl failed!   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current (GitHub::Error)
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 422 Unprocessable Entity
curl: (3) <url> malformed
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:184:in `open'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:284:in `search'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:231:in `search_issues'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:244:in `issues_for_formula'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:369:in `fetch_issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:365:in `issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:419:in `dump'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:133:in `rescue in <main>'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:26:in `<main>'
~/Developer/XcodeGen:

from xcodegen.

ehyche avatar ehyche commented on May 22, 2024

Looks like it is related (I think) to the custom tap that is used: Homebrew/brew#2733

from xcodegen.

aerobounce avatar aerobounce commented on May 22, 2024

So, seemingly it's a brew-side bug and we have to wait until next version of brew...?

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

Yeah, I'm sure it it's an Xcode 9, homebrew or formula problem. It might be fixed with a homebrew or macOS update?

from xcodegen.

ilovezfs avatar ilovezfs commented on May 22, 2024

Hi, I'm one of the Homebrew maintainers. You need to run swift build --disable-sandbox because Homebrew runs all builds in a sandbox, and you cannot exec another sandbox within a sandbox.

You should not run brew install --no-sandbox, which is intended for debugging purposes only.

from xcodegen.

aerobounce avatar aerobounce commented on May 22, 2024

Ah, that totally makes sense...

from xcodegen.

ilovezfs avatar ilovezfs commented on May 22, 2024

For an example, see Homebrew/homebrew-core#18456.

from xcodegen.

pepicrft avatar pepicrft commented on May 22, 2024

Makes sense. Thanks, @ilovezfs for clarifying it. I've updated it to not use the sanbox flag with Homebrew.

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

Fantastic, thank you @ilovezfs!
Is there any documentation around the Swift 4 changes that require this workaround? Is it all Swift 4 packages or only those with C code, as I noticed the error happened while compiling libCYaml from the Yams dependency.

from xcodegen.

pepicrft avatar pepicrft commented on May 22, 2024

I found this @yonaskolb on this link:

On macOS, Swift package builds now occur in a sandbox which prevents network access and file system modification, to help mitigate the effect of maliciously crafted manifests.

I think it might be related

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

Yeah I believe that's what caused it

from xcodegen.

aerobounce avatar aerobounce commented on May 22, 2024

Seems now on 1.1.0 this is fixed by those workaround commits. Successfully installed xcodegen by brew on 10.12.6 with Xcode 9.
I think this issue is solved, at least for now?

from xcodegen.

jalopezcar avatar jalopezcar commented on May 22, 2024

I'm getting the same error with 1.9.0 version

$ brew install xcodegen
==> Installing xcodegen from yonaskolb/xcodegen
==> Downloading https://github.com/yonaskolb/XcodeGen/archive/1.9.0.tar.gz
Already downloaded: /Users/jlopezcarreno/Library/Caches/Homebrew/xcodegen-1.9.0.tar.gz
==> make install PREFIX=/usr/local/Cellar/xcodegen/1.9.0
Last 15 lines from /Users/jlopezcarreno/Library/Logs/Homebrew/xcodegen/01.make:
Cloning https://github.com/yonaskolb/JSONUtilities.git
Resolving https://github.com/yonaskolb/JSONUtilities.git at 3.3.8
Cloning https://github.com/JohnSundell/ShellOut.git
Resolving https://github.com/JohnSundell/ShellOut.git at 2.1.0
Cloning https://github.com/kylef/PathKit.git
Resolving https://github.com/kylef/PathKit.git at 0.9.1
Cloning https://github.com/tadija/AEXML.git
Resolving https://github.com/tadija/AEXML.git at 4.3.0
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.8.0
Cloning https://github.com/onevcat/Rainbow.git
Resolving https://github.com/onevcat/Rainbow.git at 3.1.1
Cloning https://github.com/kylef/Commander.git
Resolving https://github.com/kylef/Commander.git at 0.8.0
make: *** [build] Error 1

If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
yonaskolb/xcodegen

/usr/local/Homebrew/Library/Homebrew/utils/github.rb:220:in `raise_api_error': curl failed!  (GitHub::Error)
curl: (22) The requested URL returned error: 422 Unprocessable Entity
curl: (3) <url> malformed
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:178:in `open_api'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:292:in `search'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:225:in `search_issues'
	from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:238:in `issues_for_formula'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:368:in `fetch_issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:364:in `issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:418:in `dump'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:139:in `rescue in <main>'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:31:in `<main>'

It doesn't happen with v1.8.0

$ brew install https://raw.githubusercontent.com/yonaskolb/XcodeGen/1.9.0/Formula/xcodegen.rb

It seems also that the tag version 1.9.0 point actually to v1.8.0

from xcodegen.

vhbit avatar vhbit commented on May 22, 2024

@jalopezcar please provide output of brew install xcodegen --verbose, Xcode version and if you have CLT (command line tools) installed.

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

@jalopezcar can you see if the formula on master fixes your issue?

from xcodegen.

jalopezcar avatar jalopezcar commented on May 22, 2024

I still get the same error

$ brew install https://raw.githubusercontent.com/yonaskolb/XcodeGen/master/Formula/xcodegen.rb --verbose

/Library/Homebrew/build.rb /Users/jlopezcarreno/Library/Caches/Homebrew/Formula/xcodegen.rb --verbose
==> Downloading https://github.com/yonaskolb/XcodeGen/archive/1.9.0.tar.gz
Already downloaded: /Users/jlopezcarreno/Library/Caches/Homebrew/xcodegen-1.9.0.tar.gz
==> Verifying xcodegen-1.9.0.tar.gz checksum
tar xzf /Users/jlopezcarreno/Library/Caches/Homebrew/xcodegen-1.9.0.tar.gz
==> make install PREFIX=/usr/local/Cellar/xcodegen/1.9.0
swift build --disable-sandbox -c release -Xswiftc -static-stdlib
Compile CYaml src/writer.c
Compile CYaml src/parser.c
Compile CYaml src/emitter.c
Compile CYaml src/reader.c
Compile CYaml src/api.c
Compile CYaml src/scanner.c
Compile Swift Module 'AEXML' (5 sources)
Compile Swift Module 'PathKit' (1 sources)
Compile Swift Module 'JSONUtilities' (10 sources)
Compile Swift Module 'Rainbow' (11 sources)
Compile Swift Module 'Commander' (9 sources)
Compile Swift Module 'Spectre' (8 sources)
Compile Swift Module 'Yams' (16 sources)
/private/tmp/xcodegen-20180416-88739-3hlf5l/XcodeGen-1.9.0/.build/checkouts/AEXML.git--1992474868199569405/Sources/Element.swift:100:24: error: value of type '[AEXMLElement]' has no member 'compactMap'
        let found = all?.compactMap {
                    ~~~^ ~~~~~~~~~~
/private/tmp/xcodegen-20180416-88739-3hlf5l/XcodeGen-1.9.0/.build/checkouts/AEXML.git--1992474868199569405/Sources/Element.swift:114:24: error: value of type '[AEXMLElement]' has no member 'compactMap'
        let found = all?.compactMap { element in
                    ~~~^ ~~~~~~~~~~
/private/tmp/xcodegen-20180416-88739-3hlf5l/XcodeGen-1.9.0/.build/checkouts/AEXML.git--1992474868199569405/Sources/Element.swift:131:55: error: value of type '[AEXMLElement]' has no member 'compactMap'
        let found = all(containingAttributeKeys: keys)?.compactMap { element in
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ~~~~~~~~~~
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /private/tmp/xcodegen-20180416-88739-3hlf5l/XcodeGen-1.9.0/.build/release.yaml main
Fetching https://github.com/kylef/PathKit.git
Fetching https://github.com/kylef/Commander.git
Fetching https://github.com/jpsim/Yams.git
Fetching https://github.com/yonaskolb/JSONUtilities.git
Fetching https://github.com/kylef/Spectre.git
Fetching https://github.com/onevcat/Rainbow.git
Fetching https://github.com/xcodeswift/xcproj.git
Fetching https://github.com/JohnSundell/ShellOut.git
Fetching https://github.com/tadija/AEXML.git
Cloning https://github.com/xcodeswift/xcproj.git
Resolving https://github.com/xcodeswift/xcproj.git at 4.3.0
Cloning https://github.com/jpsim/Yams.git
Resolving https://github.com/jpsim/Yams.git at 0.7.0
Cloning https://github.com/yonaskolb/JSONUtilities.git
Resolving https://github.com/yonaskolb/JSONUtilities.git at 3.3.8
Cloning https://github.com/JohnSundell/ShellOut.git
Resolving https://github.com/JohnSundell/ShellOut.git at 2.1.0
Cloning https://github.com/kylef/PathKit.git
Resolving https://github.com/kylef/PathKit.git at 0.9.1
Cloning https://github.com/tadija/AEXML.git
Resolving https://github.com/tadija/AEXML.git at 4.3.0
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.8.0
Cloning https://github.com/onevcat/Rainbow.git
Resolving https://github.com/onevcat/Rainbow.git at 3.1.1
Cloning https://github.com/kylef/Commander.git
Resolving https://github.com/kylef/Commander.git at 0.8.0
make: *** [build] Error 1

==> Formula
Path: /Users/jlopezcarreno/Library/Caches/Homebrew/Formula/xcodegen.rb
==> Configuration
HOMEBREW_VERSION: 1.6.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 6233b9d1991043b00f635a2878fa336db3ae95d2
Last commit: 19 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9623af306426378a6be99b8b32043b5c5ca751b7
Core tap last commit: 12 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION: 1
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.3.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.0 build 900
Git: 2.16.2 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 9.0.4, 1.8.0_162, 1.7.0_80
macOS: 10.13.3-x86_64
CLT: 9.2.0.0.1.1510905681
Xcode: 9.2
XQuartz: N/A
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.13
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/super:/usr/bin:/bin:/usr/sbin:/sbin

Error: xcodegen 1.9.0 did not build
Logs:
     /Users/jlopezcarreno/Library/Logs/Homebrew/xcodegen/01.make
     /Users/jlopezcarreno/Library/Logs/Homebrew/xcodegen/00.options.out
     /Users/jlopezcarreno/Library/Logs/Homebrew/xcodegen/01.make.cc
Do not report this issue to Homebrew/brew or Homebrew/core!

from xcodegen.

vhbit avatar vhbit commented on May 22, 2024

@jalopezcar ok, that's a different issue. You use Xcode 9.2 while xcodegen 1.9.0 is now Swift 4.1
I guess that can be mitigated by providing a shim in AEXML for compactMap on earlier Swift versions, similar to https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/SwiftShims.swift

from xcodegen.

vhbit avatar vhbit commented on May 22, 2024

@yonaskolb maybe it's time to use bottles instead of building? I can see that mint is delivered through brew official repo and gets bottles support right away, any particular reason why xcodegen doesn't follow that path?

from xcodegen.

yonaskolb avatar yonaskolb commented on May 22, 2024

@vhbit There’s no reason that we don’t have an official formula yet. Back when xcodegen started it wasn’t allowed for maintainers to submit the formula to homebrew. I don’t believe that’s the case anymore, but I just haven’t gotten around to it. Obviously I use Mint 😉
If you’d like to submit the formula that would be great!

from xcodegen.

vhbit avatar vhbit commented on May 22, 2024

@yonaskolb

you’d like to submit the formula that would be great!

I don't think they'll like workarounds I've put there 😄 but I'll try soon.

from xcodegen.

agurod42 avatar agurod42 commented on May 22, 2024

Hello guys! I'm facing the same problem :(

Tried with mint, brew and also building from sources.

This is my mint output:

mint install yonaskolb/xcodegen --verbose
🌱  Finding latest version of xcodegen
🌱  Resolved latest version of xcodegen to 1.9.0
🌱  Cloning https://github.com/yonaskolb/xcodegen.git 1.9.0...
Cloning into 'github.com_yonaskolb_xcodegen'...
remote: Counting objects: 178, done.
remote: Compressing objects: 100% (139/139), done.
remote: Total 178 (delta 12), reused 101 (delta 9), pack-reused 0
Receiving objects: 100% (178/178), 1.28 MiB | 123.00 KiB/s, done.
Resolving deltas: 100% (12/12), done.
Note: checking out 'aec94c87f5925ce2af5ca0224f24376c3c53e5f0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

🌱  Building xcodegen. This may take a few minutes...
Fetching https://github.com/kylef/PathKit.git
Fetching https://github.com/kylef/Commander.git
Fetching https://github.com/yonaskolb/JSONUtilities.git
Fetching https://github.com/jpsim/Yams.git
Fetching https://github.com/kylef/Spectre.git
Fetching https://github.com/onevcat/Rainbow.git
Fetching https://github.com/xcodeswift/xcproj.git
Fetching https://github.com/JohnSundell/ShellOut.git
Fetching https://github.com/tadija/AEXML.git
Cloning https://github.com/xcodeswift/xcproj.git
Resolving https://github.com/xcodeswift/xcproj.git at 4.3.0
Cloning https://github.com/jpsim/Yams.git
Resolving https://github.com/jpsim/Yams.git at 0.7.0
Cloning https://github.com/yonaskolb/JSONUtilities.git
Resolving https://github.com/yonaskolb/JSONUtilities.git at 3.3.8
Cloning https://github.com/JohnSundell/ShellOut.git
Resolving https://github.com/JohnSundell/ShellOut.git at 2.1.0
Cloning https://github.com/kylef/PathKit.git
Resolving https://github.com/kylef/PathKit.git at 0.9.1
Cloning https://github.com/tadija/AEXML.git
Resolving https://github.com/tadija/AEXML.git at 4.3.0
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.8.0
Cloning https://github.com/onevcat/Rainbow.git
Resolving https://github.com/onevcat/Rainbow.git at 3.1.1
Cloning https://github.com/kylef/Commander.git
Resolving https://github.com/kylef/Commander.git at 0.8.0
Compile CYaml src/scanner.c
Compile CYaml src/reader.c
Compile CYaml src/writer.c
Compile CYaml src/parser.c
Compile CYaml src/emitter.c
Compile CYaml src/api.c
Compile Swift Module 'PathKit' (1 sources)
Compile Swift Module 'AEXML' (5 sources)
Compile Swift Module 'JSONUtilities' (10 sources)
Compile Swift Module 'Rainbow' (11 sources)
/private/var/folders/bn/vphz8g615hz01svmbckkcpjw0000gn/T/mint/github.com_yonaskolb_xcodegen/.build/checkouts/AEXML.git--1992474868199569405/Sources/Element.swift:100:24: error: value oftype '[AEXMLElement]' has no member 'compactMap'
        let found = all?.compactMap {
                    ~~~^ ~~~~~~~~~~
/private/var/folders/bn/vphz8g615hz01svmbckkcpjw0000gn/T/mint/github.com_yonaskolb_xcodegen/.build/checkouts/AEXML.git--1992474868199569405/Sources/Element.swift:114:24: error: value oftype '[AEXMLElement]' has no member 'compactMap'
        let found = all?.compactMap { element in
                    ~~~^ ~~~~~~~~~~
/private/var/folders/bn/vphz8g615hz01svmbckkcpjw0000gn/T/mint/github.com_yonaskolb_xcodegen/.build/checkouts/AEXML.git--1992474868199569405/Sources/Element.swift:131:55: error: value oftype '[AEXMLElement]' has no member 'compactMap'
        let found = all(containingAttributeKeys: keys)?.compactMap { element in
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ~~~~~~~~~~
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /private/var/folders/bn/vphz8g615hz01svmbckkcpjw0000gn/T/mint/github.com_yonaskolb_xcodegen/.build/release.yaml main

from xcodegen.

agurod42 avatar agurod42 commented on May 22, 2024

You're totally right. Updated Xcode to 9.3 and the problem went away.

Thank you!

from xcodegen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.