Opened 10 years ago

Last modified 8 months ago

#29172 new enhancement

remove dependency on Xcode

Reported by: joshmoz@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version:
Keywords: Cc: mfeiri, internetzel, kaioless@…, cooljeanius (Eric Gallager), c.herbig@…, schwern@…, m@…, PerMildner, alexkowel@…, llamafilm, macports@…, mmpestorich (Mike M Pestorich), larryv (Lawrence Velázquez), dliessi (Davide Liessi), isviridov, Dave-Allured (Dave Allured), mascguy (Christopher Nielsen)
Port:

Description

I realize this would be a pretty significant change but I'd like for MacPorts to not depend on Xcode. Xcode now costs money, which means that MacPorts depends on non-free (as in beer) software. As far as I know there is no convenient and free developer toolchain on Mac OS X any more. The MacPorts project is probably in the best position of any project to provide that.

(Mozilla, the project I'm most heavily involved with, would appreciate it)

Change History (25)

comment:1 Changed 10 years ago by ryandesign (Ryan Schmidt)

Xcode 3 is still free and still works fine on Snow Leopard. Since Lion is not released we don't know what will happen with that yet.

This wish is probably best discussed at length on the mailing list first; it's not a ticket than can be easily resolved with a couple lines of code. This is a major major change. It's probably not realistic to expect MacPorts to ever be free of the Xcode dependency -- not for all variants of all ports, anyway.

comment:2 Changed 10 years ago by mfeiri

Cc: mfeiri@… added

Well, it is doable though and it would be nice-to-have in any case. Assuming we use the clang toolchain we'd just need binaries of clang, ld64, and a make tool. Additionally we'd have to provide headers from xnu and Libc. That should be all thats necessary to bootstrap macports. Everything else can be built from there.

comment:3 Changed 10 years ago by jmroot (Joshua Root)

You should theoretically be able to run MacPorts without Xcode right now, provided your toolchain is installed in the same places as Xcode's. The only thing that actually requires it is the base installer pkg preflight check (and you could fool that with any old executable installed as /usr/bin/xcodebuild). Individual ports may of course rely on all kinds of things from Xcode, most obviously xcodebuild itself.

comment:4 in reply to:  description ; Changed 10 years ago by internetzel

Replying to joshmoz@…:

I realize this would be a pretty significant change but I'd like for MacPorts to not depend on Xcode. Xcode now costs money, which means that MacPorts depends on non-free (as in beer) software. As far as I know there is no convenient and free developer toolchain on Mac OS X any more. The MacPorts project is probably in the best position of any project to provide that.

Did you ever realize there is Gentoo Prefix?
http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml
I didn't know of it's existence until a fews days ago but they seem to provide exactly what you're looking for. It needs Xcode only for bootstrapping. After that everything gets compiled by it's own toolchain.
Although I didn't test it they seem to provide clang 2.9 as well as llvm-gcc-4.2 ready to be built and used on Tiger, Leopard and Snow Leopard.

comment:5 Changed 10 years ago by internetzel

Cc: tobias.netzel@… added

Cc Me!

comment:6 Changed 10 years ago by skymoo (Adam Mercer)

Cc: ram@… added

Cc Me!

comment:7 in reply to:  4 Changed 10 years ago by joshmoz@…

Replying to tobias.netzel@…:

Did you ever realize there is Gentoo Prefix?
http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml
I didn't know of it's existence until a fews days ago but they seem to provide exactly what you're looking for. It needs Xcode only for bootstrapping. After that everything gets compiled by it's own toolchain.
Although I didn't test it they seem to provide clang 2.9 as well as llvm-gcc-4.2 ready to be built and used on Tiger, Leopard and Snow Leopard.

That's really no better than MacPorts for what I want. I am only interested in getting a developer toolchain on my machine without having to have Xcode myself. I don't care how the toolchain itself is compiled.

comment:8 Changed 10 years ago by kaioless@…

Cc: kaioless@… added

Cc Me!

comment:9 in reply to:  description Changed 10 years ago by kaioless@…

Also I'd like to ask why is it not possible to make binary macports package?

comment:10 Changed 8 years ago by skymoo (Adam Mercer)

Cc: ram@… removed

comment:11 Changed 8 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:12 Changed 8 years ago by cooljeanius (Eric Gallager)

This came up again on the mailing lists here: https://lists.macosforge.org/pipermail/macports-dev/2013-March/022374.html

Also I'd like MacPorts to go even further than this: I'd like it to be entirely self-hosting some day.

comment:13 in reply to:  12 Changed 8 years ago by larryv (Lawrence Velázquez)

Replying to egall@…:

Also I'd like MacPorts to go even further than this: I'd like it to be entirely self-hosting some day.

I don't think this is something worth pursuing, to be perfectly frank. The bang for the buck just isn't there.

comment:14 Changed 8 years ago by larryv (Lawrence Velázquez)

Cc: c.herbig@… added

Has duplicate #39789.

comment:15 Changed 7 years ago by ryandesign (Ryan Schmidt)

Cc: schwern@… m@… Per.Mildner@… added
Version: 1.9.2

Has duplicates #35045, #40982.

comment:16 Changed 7 years ago by alexkowel@…

Cc: alexkowel@… added

Cc Me!

comment:17 Changed 7 years ago by llamafilm

Cc: elliottbalsley@… added

Cc Me!

comment:18 Changed 7 years ago by mfeiri

After a batch of changes we now have something like a pure open source SDK in ${destroot}${prefix}/Developer/SDKs/Darwin${os.major}.sdk. The relevant ports are CarbonHeaders, csu, libc-headers, libm-headers, libunwind-headers, and xnu-headers. I didn't yet try to uninstall Xcode to really verify this, but it appears possible now to build basic applications without Xcode. This works for me on my machine (OS X 10.9):

clang-mp-3.5 helloworld.c -isysroot /opt/local/Developer/SDKs/Darwin13.sdk --sysroot /

Plenty of work/opportunities for future enhancements exist:

  • Package open source headers for 10.10 SDK if and when Apple provides them
  • Improve coverage relative to the official OS X SDK, e.g. provide libraries and more headers
  • Offer versioned DarwinXX.sdk ports instead of a bunch of header ports for the current host system, e.g. to enable cross-compilation
  • Provide substitutes for xcodebuild (e.g. xctool) and other relevant developer tools.
  • Introduce a way for ports to indicate if they can be built with a pure open source SDK or if proprietary frameworks are required.

comment:19 Changed 6 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:20 Changed 5 years ago by mmpestorich (Mike M Pestorich)

Cc: mmpestorich@… added

Cc Me!

comment:21 Changed 5 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:22 Changed 5 years ago by dliessi (Davide Liessi)

Cc: davide.liessi@… added

Cc Me!

comment:23 Changed 2 years ago by isviridov

Cc: isviridov added

comment:24 Changed 2 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:25 Changed 8 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added
Note: See TracTickets for help on using tickets.