This allows many features of Xcode to be used while developing. I made it so I can work on the client in an environment I’m familiar with.
I’m not sure if you guys would be interested in this but I thought I’d offer it up in case.
This allows many features of Xcode to be used while developing. I made it so I can work on the client in an environment I’m familiar with.
I’m not sure if you guys would be interested in this but I thought I’d offer it up in case.
Great work!
I’ve worked on other projects where separate buildsystems were maintained, and it proved to be tough to keep up with. The obvious drawback is that it requires that someone must constantly keep it in sync. Do you have anything in mind to handle that automatically?
There’s also the issue of the msvc guys popping up with some “me too"s :)
Thanks =)
An Xcode plugin could “automagically” put things together based on some set of rules. Apple doesn’t release the APIs so building plugins requires decompiling and guessing at them. I have experience doing it but it’s slow work.
This is setup to use make for the actual building so it should keep working when / if the Xcode project falls out of date. If the project goes stale that worst that will happen is inability to autocomplete / jump to new files.
Awesome! I did also some bitcoin changes in Xcode… but had a really rough setup (external build system!).
I freshly checktout your master but i cannot open the xcodeproject. It always crashes. I tested with Xcode 6.1 and 5.1.1.
Maybe the xcodeproject should not be in the root folder. Why not in the contrib folder?
crashlog:
/Applications/Xcode.app/Contents/MacOS/Xcode ~/Documents/bitcoin/bitcoinxcode/bitcoin.xcodeproj 2014-11-14 09:27:32.912 Xcode[46187:945229] DeveloperPortal: Using pre-existing current store at URL (file:///Users/jonasschnelli/Library/Developer/Xcode/DeveloperPortal%206.1.db). 2014-11-14 09:27:34.658 Xcode[46187:945226] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/DVTFrameworks/DVTFrameworks-6539/DVTFoundation/FilePaths/DVTFilePath.m:802 Details: fsrep is relative ('src/qt/bitcoin-qt') parentPath must not be nil but it is. Object: <DVTFilePath> Method: +_filePathForParent:fileSystemRepresentation:length:allowCreation: Thread: <NSThread: 0x7fadb0c38850>{number = 1, name = main} Hints: None 2014-11-14 09:27:34.743 Xcode[46187:945226] [MT] DVTAssertions: Backtrace: 0 0x000000010706e9ca -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit) 1 0x0000000105e279ef _DVTAssertionHandler (in DVTFoundation) 2 0x0000000105e27cde _DVTAssertionFailureHandler (in DVTFoundation) 3 0x0000000105c658fb +[DVTFilePath _filePathForParent:fileSystemRepresentation:length:allowCreation:] (in DVTFoundation) 4 0x0000000105c6550d +[DVTFilePath _filePathForParent:pathString:] (in DVTFoundation) 5 0x0000000105c6527d +[DVTFilePath filePathForPathString:] (in DVTFoundation) 6 0x0000000106a2a3e2 -[IDEPathRunnable setFilePathFromUTF8String:fromXMLUnarchiver:] (in IDEFoundation) 7 0x0000000105dcbc21 _DVTSetUTF8StringRepValueWithMethod (in DVTFoundation) 8 0x0000000105ca3db2 -[DVTXMLUnarchiver decodeElementNodeWithXMLTextReader:owner:container:parsingState:success:error:] (in DVTFoundation) 9 0x0000000105ca328e -[DVTXMLUnarchiver decodeNodeWithXMLTextReader:owner:container:parsingState:error:] (in DVTFoundation) 10 0x0000000105ca4035 -[DVTXMLUnarchiver decodeElementNodeWithXMLTextReader:owner:container:parsingState:success:error:] (in DVTFoundation) 11 0x0000000105ca328e -[DVTXMLUnarchiver decodeNodeWithXMLTextReader:owner:container:parsingState:error:] (in DVTFoundation) 12 0x0000000105ca4035 -[DVTXMLUnarchiver decodeElementNodeWithXMLTextReader:owner:container:parsingState:success:error:] (in DVTFoundation) 13 0x0000000105ca328e -[DVTXMLUnarchiver decodeNodeWithXMLTextReader:owner:container:parsingState:error:] (in DVTFoundation) 14 0x0000000105ca2e2d -[DVTXMLUnarchiver _readAndReturnError:] (in DVTFoundation) 15 0x0000000106770040 +[IDEScheme schemeFromXMLData:withRunContextManager:customDataStoreContainer:customDataSpecifier:isShown:orderHint:error:] (in IDEFoundation) 16 0x000000010676f4ff -[IDERunContextManager _updateMap:contextForCustomDataStore:specifier:] (in IDEFoundation) 17 0x000000010676eae4 -[IDERunContextManager _customDataStoresDidUpdate] (in IDEFoundation) 18 0x0000000105ca5e26 -[NSObject(DVTPropertyLinking) dvt_addObserverWithName:toKeyPath:ofObject:block:] (in DVTFoundation) 19 0x000000010676e11e -[IDERunContextManager initWithWorkspace:] (in IDEFoundation) 20 0x000000010675972b -[IDEWorkspace _setupWorkspaceArenaIfNeeded] (in IDEFoundation) 21 0x0000000106871a79 __81-[IDEWorkspace _finishLoadingAsynchronously:shouldUpgradeFromSimpleFilesFocused:]_block_invoke (in IDEFoundation) 22 0x0000000106871d7a __81-[IDEWorkspace _finishLoadingAsynchronously:shouldUpgradeFromSimpleFilesFocused:]_block_invoke321 (in IDEFoundation) 23 0x00007fff8fe922e8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ (in Foundation) 24 0x00007fff8fd7e905 -[NSBlockOperation main] (in Foundation) 25 0x00007fff8fd5d59c -[__NSOperationInternal _start:] (in Foundation) 26 0x00007fff8fd5d1a3 __NSOQSchedule_f (in Foundation) 27 0x00007fff94fbdc13 _dispatch_client_callout (in libdispatch.dylib) 28 0x00007fff94fc9cbf _dispatch_main_queue_callback_4CF (in libdispatch.dylib) 29 0x00007fff8f79ec59 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ (in CoreFoundation) 30 0x00007fff8f75b2ef __CFRunLoopRun (in CoreFoundation) 31 0x00007fff8f75a838 CFRunLoopRunSpecific (in CoreFoundation) 32 0x00007fff99f9743f RunCurrentEventLoopInMode (in HIToolbox) 33 0x00007fff99f971ba ReceiveNextEventCommon (in HIToolbox) 34 0x00007fff99f96ffb _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox) 35 0x00007fff97e98821 _DPSNextEvent (in AppKit) 36 0x00007fff97e97fd0 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit) 37 0x000000010639382d -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit) 38 0x00007fff97e8bf73 -[NSApplication run] (in AppKit) 39 0x00007fff97e77424 NSApplicationMain (in AppKit) 40 0x00007fff9b6b05c9 start (in libdyld.dylib) 41 0x0000000000000002 Abort trap: 6
I did a little trickery to make Xcode’s run button work. The scheme lets you set an executable to run which the UI makes you choose an absolute path of what to run – which works great if you’re developing /Applications/Safari or similar but doesn’t let you choose a path relative to the project directory.
I modified the scheme file directly to be a relative path which Xcode takes wonderfully. Unfortunetely there is some kind of assert that Xcode fires when it opens the project file for the first time that makes it crash.
So that means it will open it just fine with an absolute path – not helpful for a shared project! After it loads you can modify the file directly to a relative path and it sucks it up no problem.
On Friday, November 14, 2014, Jonas Schnelli notifications@github.com wrote:
Awesome! I did also some bitcoin changes in Xcode… but had a really rough setup (external build system!).
I freshly checktout your master but i cannot open the xcodeproject. It always crashes. I tested with Xcode 6.1 and 5.1.1.
Maybe the xcodeproject should not be in the root folder. Why not in the contrib folder?
crashlog: /Applications/Xcode.app/Contents/MacOS/Xcode ~/Documents/bitcoin/bitcoinxcode/bitcoin.xcodeproj 2014-11-14 09:27:32.912 Xcode[46187:945229] DeveloperPortal: Using pre-existing current store at URL (file:///Users/jonasschnelli/Library/Developer/Xcode/DeveloperPortal%206.1.db). 2014-11-14 09:27:34.658 Xcode[46187:945226] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/DVTFrameworks/DVTFrameworks-6539/DVTFoundation/FilePaths/DVTFilePath.m:802 Details: fsrep is relative (‘src/qt/bitcoin-qt’) parentPath must not be nil but it is. Object: Method: +_filePathForParent:fileSystemRepresentation:length:allowCreation: Thread: <NSThread: 0x7fadb0c38850>{number = 1, name = main} Hints: None 2014-11-14 09:27:34.743 Xcode[46187:945226] [MT] DVTAssertions: Backtrace: 0 0x000000010706e9ca -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:](in IDEKit) 1 0x0000000105e279ef _DVTAssertionHandler (in DVTFoundation) 2 0x0000000105e27cde _DVTAssertionFailureHandler (in DVTFoundation) 3 0x0000000105c658fb +[DVTFilePath _filePathForParent:fileSystemRepresentation:length:allowCreation:](in DVTFoundation) 4 0x0000000105c6550d +[DVTFilePath _filePathForParent:pathString:](in DVTFoundation) 5 0x0000000105c6527d +[DVTFilePath filePathForPathString:](in DVTFoundation) 6 0x0000000106a2a3e2 -[IDEPathRunnable setFilePathFromUTF8String:fromXMLUnarchiver:](in IDEFoundation) 7 0x0000000105dcbc21 _DVTSetUTF8StringRepValueWithMethod (in DVTFoundation) 8 0x0000000105ca3db2 -[DVTXMLUnarchiver decodeElementNodeWithXMLTextReader:owner:container:parsingState:success:error:](in DVTFoundation) 9 0x0000000105ca328e -[DVTXMLUnarchiver decodeNodeWithXMLTextReader:owner:container:parsingState:error:](in DVTFoundation) 10 0x0000000105ca4035 -[DVTXMLUnarchiver decodeElementNodeWithXMLTextReader:owner:container:parsingState:success:error:](in DVTFoundation) 11 0x0000000105ca328e -[DVTXMLUnarchiver decodeNodeWithXMLTextReader:owner:container:parsingState:error:](in DVTFoundation) 12 0x0000000105ca4035 -[DVTXMLUnarchiver decodeElementNodeWithXMLTextReader:owner:container:parsingState:success:error:](in DVTFoundation) 13 0x0000000105ca328e -[DVTXMLUnarchiver decodeNodeWithXMLTextReader:owner:container:parsingState:error:](in DVTFoundation) 14 0x0000000105ca2e2d -[DVTXMLUnarchiver _readAndReturnError:](in DVTFoundation) 15 0x0000000106770040 +[IDEScheme schemeFromXMLData:withRunContextManager:customDataStoreContainer:customDataSpecifier:isShown:orderHint:error:](in IDEFoundation) 16 0x000000010676f4ff -[IDERunContextManager _updateMap:contextForCustomDataStore:specifier:](in IDEFoundation) 17 0x000000010676eae4 -[IDERunContextManager _customDataStoresDidUpdate](in IDEFoundation) 18 0x0000000105ca5e26 -[NSObject(DVTPropertyLinking) dvt_addObserverWithName:toKeyPath:ofObject:block:](in DVTFoundation) 19 0x000000010676e11e -[IDERunContextManager initWithWorkspace:](in IDEFoundation) 20 0x000000010675972b -[IDEWorkspace _setupWorkspaceArenaIfNeeded](in IDEFoundation) 21 0x0000000106871a79 __81-[IDEWorkspace _finishLoadingAsynchronously:shouldUpgradeFromSimpleFilesFocused:]_block_invoke (in IDEFoundation) 22 0x0000000106871d7a __81-[IDEWorkspace _finishLoadingAsynchronously:shouldUpgradeFromSimpleFilesFocused:]_block_invoke321 (in IDEFoundation) 23 0x00007fff8fe922e8 NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK (in Foundation) 24 0x00007fff8fd7e905 -[NSBlockOperation main](in Foundation) 25 0x00007fff8fd5d59c -[__NSOperationInternal _start:](in Foundation) 26 0x00007fff8fd5d1a3 NSOQSchedule_f (in Foundation) 27 0x00007fff94fbdc13 _dispatch_client_callout (in libdispatch.dylib) 28 0x00007fff94fc9cbf _dispatch_main_queue_callback_4CF (in libdispatch.dylib) 29 0x00007fff8f79ec59 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE (in CoreFoundation) 30 0x00007fff8f75b2ef __CFRunLoopRun (in CoreFoundation) 31 0x00007fff8f75a838 CFRunLoopRunSpecific (in CoreFoundation) 32 0x00007fff99f9743f RunCurrentEventLoopInMode (in HIToolbox) 33 0x00007fff99f971ba ReceiveNextEventCommon (in HIToolbox) 34 0x00007fff99f96ffb _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox) 35 0x00007fff97e98821 _DPSNextEvent (in AppKit) 36 0x00007fff97e97fd0 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:](in AppKit) 37 0x000000010639382d -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:](in DVTKit) 38 0x00007fff97e8bf73 -[NSApplication run](in AppKit) 39 0x00007fff97e77424 NSApplicationMain (in AppKit) 40 0x00007fff9b6b05c9 start (in libdyld.dylib) 41 0x0000000000000002 Abort trap: 6
— Reply to this email directly or view it on GitHub #5276 (comment).
src/qt
folder into a empty project, chose clang
and some Qt paths and all done.
The only thing you need to do before that is ./configure
@theuni: remember: a Xcode project only needs a update if a new file was added or deleted. That’s absolutely madeble.
I see this files in the contribfolder. If nobody keeps that up to date over let’s say 6 month. Drop it.
Just speaking historically, we used to have 4 makefiles for different systems, and keeping all 4 up to date when files were added or removed was already annoying - to the point where the one file that was not regularly tested (the visual c++ one) got hopelessly outdated and was eventually removed. And we are currently adding/removing files much more frequently than then.
I’m fine with other project files under contrib though, with less implied guarantees about up to dateness.
IMO theres not much to loose if we place it under the contrib sections. Xcode brings a easy way to start developing around the bitcoin-core. For those who are not so into linux and valgrind, etc. it might help a lot. Fluid code editing on mac (eclipse is a mess!), nice LLDB frontend, GUI like memory leak detection, static analyzer, time profiler, etc. Proposal: after merging give the project-file a chance to survive for half a year. If it’s outdated then, drop it (people will ACK the dropping then).
Once the basics are there, i can try to auto-configure this xcode project on a script basis. The project file is nothing more than a xml-, makefile-like thing.
I spent hours looking for official, semi-official (or anything definitive and current) build instructions or project file for Xcode – and was very surprised that I came up empty handed. I"m really happy to see this PR.
I think there are a large number of Mac OS developers who would appreciate this being as accessible and current as possible. I guess putting it in contrib
would be OK, as long as there is easy to find documentation about it.
39+ buildConfiguration = "Debug"
40+ ignoresPersistentStateOnLaunch = "NO"
41+ debugDocumentVersioning = "YES"
42+ allowLocationSimulation = "YES">
43+ <PathRunnable
44+ FilePath = "/Users/ddustin/Library/Developer/Xcode/DerivedData/bitcoin-hgcxjaiitthtfmbhlaaruaclhrgx/Build/Products/bitcoind">
39+ buildConfiguration = "Debug"
40+ ignoresPersistentStateOnLaunch = "NO"
41+ debugDocumentVersioning = "YES"
42+ allowLocationSimulation = "YES">
43+ <PathRunnable
44+ FilePath = "/Users/ddustin/Library/Developer/Xcode/DerivedData/bitcoin-hgcxjaiitthtfmbhlaaruaclhrgx/Build/Products/bitcoin-test">
39+ buildConfiguration = "Debug"
40+ ignoresPersistentStateOnLaunch = "NO"
41+ debugDocumentVersioning = "YES"
42+ allowLocationSimulation = "YES">
43+ <PathRunnable
44+ FilePath = "/Users/ddustin/Library/Developer/Xcode/DerivedData/bitcoin-hgcxjaiitthtfmbhlaaruaclhrgx/Build/Products/bitcoin-qt">
@ddustin, is there an overwhelming advantage over a separate repo, à la https://github.com/ENikS/bitcoin-dev-msvc?
I really like that idea. That way it’s a separate project with separate maintainers, so changes don’t even have to pass through here. We could still refer to it in documentation here.
Well whatever works. I built this for myself and I am happy to share it. I will maintain it for myself as long as it’s useful for me, which will probably be for a while. If @jonasschnelli wants to keep it up to date too that’s great.
It is worth noting this isn’t actually a unique build system. It just uses Xcode to call ‘make’ and introduces the conveniences of the Xcode interface.
To demonstrate a few of the simpler features:
If you edit the scheme to point to src/qt/bitcion-qt you can easily set breakpoints visually, step through, and use Xcode’s debugging interface. You can also CMD+click functions (like SetupEnvironment in this example) and see implementations for things. This speeds up development for me by an order of magnitude. Check it out in these screenshots.