darlinghq / darling

Darwin/macOS emulation layer for Linux
http://www.darlinghq.org
GNU General Public License v3.0
11.35k stars 438 forks source link

xcode-select --install broken because of a potential server issue #1006

Closed slyd0g closed 2 years ago

slyd0g commented 3 years ago

Expected Result Install Xcode CLI tooling

Actual Result The python script that is called pulls files from https://swdistcache.darlinghq.org/api/v1/products/by-tag?tag=DTCommandLineTools but that currently returns a 500. Seems like a potential server issue.

Steps To Reproduce

  1. Within your Darling shell, execute xcode-select --install
slyd0g commented 3 years ago

image

1kko commented 3 years ago

+1 I have same issue here. I even tried to use vpn, and it's same.

after little digging, I found https://swdistcache.darlinghq.org/ was serving okay static page, but right after adding api https://swdistcache.darlinghq.org/api/ server returns 500 Internal Server Error.

This makes almost impossible to install brew on fresh build.

awakecoding commented 3 years ago

First-time darling user here, and I encounter the same issue on my side

matko7274 commented 3 years ago

Same for me here. I encounter the same problem.

perezd commented 3 years ago

I've also been having this issue. What is this even doing?

tresf commented 3 years ago

A temporary workaround is to sign into an Apple Developer account and search for the Command Line tools which match your XCode version.

For example, for XCode 12.4, you can download here: (requires an Apple Developer login)

https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_12.4/Command_Line_Tools_for_Xcode_12.4.dmg

Then you can install: (This is for a user named user running XCode 12.4, please adapt as needed)

hdiutil attach /Volumes/SystemRoot/home/user/Downloads/Command_Line_Tools_for_Xcode_12.4.dmg
cd /Volumes/Command_Line_Tools_for_Xcode_12.4/
installer -pkg Command\ Line\ Tools.pkg -target /

Confirm they're installed:

git --version
perezd commented 3 years ago

This workaround worked for me, I'm not sure what the other version is even doing but this is also the safest way to do it given it doesn't make some random URL call to a darling webserver.

matko7274 commented 3 years ago

That worked for me also @tresf ! Thanks !

DavidBerdik commented 3 years ago

https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_12.4/Command_Line_Tools_for_Xcode_12.4.dmg

I'm having this issue as well and cannot work around it using this link since I'm not a registered Apple Developer. Would anyone be willing to share a copy with me or tell me where I might acquire a copy?

HinTak commented 3 years ago

It is free to register ; and dev tools are free to download - it is getting more out of your registration that costs.

DavidBerdik commented 3 years ago

@HinTak I filled out the section of the registration process where you are asked for personal information, but was then redirected to a payment page which I didn't fill out. I assumed that meant that I was not registered. I'm not on a computer at the moment to try it out, but from what you said, I assume that this is a dark pattern and I'm actually registered now?

HinTak commented 3 years ago

@DavidBerdik I don't remember - I had mine some years ago . Pretty sure I did not pay apple anything ever for it. It is just getting an apple id under https://developer.apple.com/ . Hmm, I remember apple can get annoying depending what browser you use - paradoxically one is blocked from some downloads from desktop Linux but okay from android phones. (both non-apple devices).

DavidBerdik commented 3 years ago

@HinTak I tried downloading it using Chrome on Ubuntu as well as Safari on my macOS VM, but it seems that it is indeed paywalled now. I can probably find a mirror of it online somewhere, but after further experimenting, I'm not sure that Darling is appropriate for my needs, so I've kind of given up for now.

HinTak commented 3 years ago

There are various tutorial online about "apple id registration credit card" workarounds; apparently setting credit card details to "none" is an option, if you register in a particular way. If you are merely interested in building for mac os x, osxcross might be a better answer than darling (seeing as you already have a mac os vm).

tresf commented 3 years ago

@HinTak I tried downloading it using Chrome on Ubuntu as well as Safari on my macOS VM, but it seems that it is indeed paywalled now. I can probably find a mirror of it online somewhere, but after further experimenting, I'm not sure that Darling is appropriate for my needs, so I've kind of given up for now.

Depending on the tools you are looking for, you should be able to find a mirror online. For example, I was able to find the 12.4 tools in a quick google search.

That said, I personally haven't been able to use darling to successfully build anything yet. My environment currently has missing or segfaulting libraries making it unusable, but I was at least able to get the command-line tools installed manually using the aforementioned technique.

HinTak commented 3 years ago

My experience with darling has been disappointing and disastrous (#848 ) ; I have been using osxcross for cross-building mac os x packages from linux quite successfully for 3 or 4 years now. Darling was meant to be a replacement for osx vm, but except for the most trivial command line usage, is not a replacement for access to os x...

If you want xcode for cross-building os x software from a different platform, I recommend looking at osxcross to see if it fits your needs.

tresf commented 3 years ago

Thanks for sharing.

If you want xcode for cross-building os x software from a different platform, I recommend looking at osxcross to see if it fits your needs.

I just use a Mac, personally, but I'm looking at this project for adding official darling documentation for some projects which have a strong Linux-only base. 🍻

HinTak commented 3 years ago

There were some weirdness about directly pasting the url into the browser, but after logging and search for the tools with: https://developer.apple.com/download/all/?q=%22command%20line%20tools%20for%20Xcode%22 , I got them - they are a bit large to post, but in case you find another mirror and want to confirm they are genuine, here are the file sizes and md5sums:

$ ls -l Command_Line_Tools_for_Xcode_12.*
-rw-rw-r--. 1 Hin-Tak Hin-Tak 451635408 Aug 31 20:29 Command_Line_Tools_for_Xcode_12.4.dmg
-rw-rw-r--. 1 Hin-Tak Hin-Tak 482791365 Aug 31 20:34 Command_Line_Tools_for_Xcode_12.5.1.dmg
[Hin-Tak@localhost tmp]$ md5sum Command_Line_Tools_for_Xcode_12.*
62ff0c3fbee4a5c8ce56266a9961484e  Command_Line_Tools_for_Xcode_12.4.dmg
b7d0524ec5d51ad719787f112f1b7015  Command_Line_Tools_for_Xcode_12.5.1.dmg
TheBrokenRail commented 3 years ago

@HinTak

My experience with darling has been disappointing and disastrous (#848 ) ;

Yes, we get it!

But believe it or not, no one here is a magic genie who can magically find and fix the cause of a 1 year old issue, that you can't even reproduce.

And believe it or not, it is really annoying to see you spamming your issue in completely unrelated ones.

Your issue is not caused by a missing system call. Your issue is not caused by a discussion about a new kernel feature. Your issue is not caused by a build-system failure. And it definitely isn't caused by a broken web server!

You already have 2 issues dedicated to this (#848 and #854)! So stop spamming unrelated stuff! You're just annoying people and making them less inclined to help you!

HinTak commented 3 years ago

Sounds a lot like a broken record. I guess anybody who is confident that the wipe-external-drives issue is not caused by darling, can happily trying hooking up an external drive with important stuff on it, while using darling for a few days.

Prove it by your action.

iiisak commented 3 years ago

Sounds a lot like a broken record. I guess anybody who is confident that the wipe-external-drives issue is not caused by darling, can happily trying hooking up an external drive with important stuff on it, while using darling for a few days. Prove it by your action.

Are you unable to read?

But believe it or not, no one here is a magic genie who can magically find and fix the cause of a 1 year old issue, that you can't even reproduce.

HinTak commented 3 years ago

As I said, you can try 'fail to reproduce the problem' by hooking an external drive of your own important stuff on it, while using darling for a few days.

Please try and fail to reproduce!

iiisak commented 3 years ago

As I said, you can try 'fail to reproduce the problem' by hooking an external drive of your own important stuff on it, while using darling for a few days. Please try and fail to reproduce!

You fail to show any logs supporting your claim that Darling wiped your external hard drive. Also you keep on making it emotional with "important stuff" as if Darling specifically checks if you have important documents stored and then wipes them.

I personally wouldn't even bother reproducing if someone doesn't give me logs/evidence of their problem.

TheBrokenRail commented 3 years ago

@HinTak

Sounds a lot like a broken record. I guess anybody who is confident that the wipe-external-drives issue is not caused by darling, can happily trying hooking up an external drive with important stuff on it, while using darling for a few days.

If anyone sounds like a broken record, it is you, constantly spamming it everywhere, Honestly, I'm not sure you even understand the saying if you think it is applicable here. FYI, it means to say the same thing over and over again. You know, like spamming an issue in tons of irrelevant places, but what you're doing is totally different... oh wait, it isn't.

If you want the issue fixed, you must either fix it yourself, or provide someone else enough information to fix it for you.

Constantly complaining about your issue without making any actual effort to actually fix it won't help anyone!

For goodness sakes, a rough summary of your issue is:

I ran Darling a few times and my files on my drives disappeared multiple times. I might have ran an rm -rf command the first time, I'm not sure. Please fix now.

That is nowhere near enough information to fix an issue. Especially for a project as complex as Darling is. We can't find the cause of an issue by vague symptom alone.

As the reporter, the burden of proof is on you, you have to prove the issue was caused by Darling, and you have to show how to reproduce it. This issue hasn't happened to literally anybody else!

And honestly, at this point, nobody is exactly eager to help you after spamming everywhere.

HinTak commented 3 years ago

Darling takes about 16GB to build. Try using an external drive to build, for example - that was how I encountered the problem, twice. Twice is already two times too much.

At least, cmake build directory is not in any sense 'important stuff', if you don't keep anything else on that drive. If you are so confident the data destruction is not caused by darling, you could use this as your daily work pattern. Try to 'fail to reproduce'.

tresf commented 3 years ago

I ran Darling a few times and my files on my drives disappeared multiple times. I might have ran an rm -rf command the first time, I'm not sure. Please fix now.

Since Darling mounts the root filesystem too, this actually makes sense. I believe fuse-mounted drives are user-wipable so recursively deleting could have this exact effect (as well as from wine, etc). Of course, this is all off-topic here. 🍻

iiisak commented 3 years ago

Since Darling mounts the root filesystem too, this actually makes sense. I believe fuse-mounted drives are user-wipable so recursively deleting could have this exact effect (as well as from wine, etc). Of course, this is all off-topic here. 🍻

The real problem is that HinTak keeps on pushing other people to reproduce it for him. Which is a complete waste of time if the person doesn't give any evidence of how/why this could be happening. And especially if that person is constantly nagging the devs to reproduce/fix it in issues which have nothing to do with his problem.

TheBrokenRail commented 3 years ago

@HinTak

Darling takes about 16GB to build. Try using an external drive to build, for example - that was how I encountered the problem, twice. Twice is already two times too much. At least, cmake build directory is not in any sense 'important stuff', if you don't keep anything else on that drive. If you are so confident the data destruction is not caused by darling, you could use this as your daily work pattern. Try to 'fail to reproduce'.

Again, proving the issue exists (and explaining reproduction) is not our responsibility, it is yours. If you are not willing to put in the effort to prove your issue exists, stop spamming about it. In-fact, stop spamming about it period.

The issue happened to you (and only you so far). You want it fixed, it is your responsibility to prove it exists, not mine or anybody else's.

HinTak commented 3 years ago

I am not "pushing" - this current threads started by @tresf sharing his experience with darling - https://github.com/darlinghq/darling/issues/1006#issuecomment-909388709 - is only positive reviews allowed??!!!

iiisak commented 3 years ago

is only positive reviews allowed??!!!

No. You can of course report if something bad happened. But as said BEFORE ALREADY:

The issue happened to you (and only you so far). You want it fixed, it is your responsibility to prove it exists, not mine or anybody else's.

HinTak commented 3 years ago

So, I wish some of your drives get wiped some day. Good luck.

iiisak commented 3 years ago

So, I wish some of your drives get wiped some day. Good luck.

Wow, how rude.

HinTak commented 3 years ago

Do I want it fixed? Not particularly, and I don't see it happening any time soon. I am just waiting to see when it would happen, while getting on with other solution, like vm or using old macs. Am I going to continue to think / mention that it is a problem? Yes.

iiisak commented 3 years ago

Am I going to continue to think / mention that it is a problem? Yes.

Why do you want to continue nagging people about an issue you don't even want fixed. Not to mention an issue that nobody else has ever reported before except you and ONLY you.

tresf commented 3 years ago

I am not "pushing" - this current threads started by @tresf sharing his experience with darling - #1006 (comment) - is only positive reviews allowed??!!!

It was a disclaimer, in case a follow-up to my solution was something like "Ok, it installed, but why doesn't git from 12.4 work?". (I haven't gotten further, so I wanted the OP to know this).

Projects like this are volunteer lead, so improving it for others is how we should all approach issues. This means that users discovering issues (such as a drive wiped) must be accompanied with steps so others can reproduce. This sounds redundant, but it is, since most hard-to-reproduce issues are otherwise not obvious to onlookers. 🍻

TheBrokenRail commented 3 years ago

@HinTak

I am not "pushing" - this current threads started by @tresf sharing his experience with darling - #1006 (comment) - is only positive reviews allowed??!!!

This is not Yelp, we are not reviewing anything. This is an issue about xcode-select being unable to download the CLT, and only that. If you want to share something about your drives, create an issue for that... oh wait, you already did that, twice.

How about I put this in a way you might understand. Imagine you join a Chess Club ran by Bob. Then suddenly, James barges in, screams "Bob's cat ate my fish last year and I have no proof!", then left. Except that isn't the first time he's done it, this is the sixth time James has barged into something and yelled about his fish. You are James, don't be James.

tresf commented 3 years ago

The maintainers might know this but the entire off-topic rant above can be hidden (..., Hide, Reason) as "off-topic" including this post, so people visiting this thread don't have to scroll through it all. 😅

HinTak commented 3 years ago

Let's say you think Donald Trump is an idiot and often says it too. Are you going to do anything about your belief and your words, say, by walking up to him and knock him on the head, trying to improve the "average intelligence of human being on earth"?

Open-source or not, run by volunteers or not, if you put a piece of software out there which destroys data, do you have a responsibility?

Does opening sourcing 3-D printing gun schematics, and claiming you do it as a volunteer, absolves you from responsibility of people using said gun schematics to kill?

tresf commented 3 years ago

if you put a piece of software out there which destroys data, do you have a responsibility?

There's unwritten moral responsibilities, yes. As is yours, to help the world know how this can happen. Please share your steps (in the appropriate thread), it will make the project and community stronger.

It sucks to have to prove to a project when they've faltered, but it's how volunteer projects work. You must volunteer your time too. This isn't an oligarchy or dictatorship, programmers will always be responsive to steps which reproduce a defect ❤️

iiisak commented 3 years ago

Let's say you think Donald Trump is an idiot and often says it too.

I won't even bother reading the rest of your reply since you had to make it political for no reason at all.

tresf commented 3 years ago

Let's say you think Donald Trump is an idiot and often says it too.

I won't even bother reading the rest of your reply since you had to make it political for no reason at all.

It's just a poor analogy. Some projects make it very hard to escalate issues. There's one in particular that's FOSS but the bug tracker is closed to the public, shutting out the community that's expected to rally in its support, which is absolutely a politically-relevant issue although I'd have chosen something like global warming as a less-polarizing example of futility. 😅

Fortunately, Darling doesn't seem to be that way. ❤️

perezd commented 3 years ago

This is all completely offtopic everyone, we have a specific problem about a server-side throwing a 500, can you please move this argument to someplace more productive and relevant? Or better yet, stop.

DavidBerdik commented 3 years ago

Back on topic:

osxcross might be a better answer than darling (seeing as you already have a mac os vm).

@HinTak Isn't osxcross intended for cross-compiling macOS software on Linux? That's what it looks like to me, which unfortunately means that it is not useable. What I need is the ability to run a macOS application with a GUI on Linux, but that does not seem possible.

There were some weirdness about directly pasting the url into the browser, but after logging and search for the tools with: https://developer.apple.com/download/all/?q=%22command%20line%20tools%20for%20Xcode%22 , I got them - they are a bit large to post, but in case you find another mirror and want to confirm they are genuine, here are the file sizes and md5sums:

@HinTak I tried it using this link, and it worked. Thank you!

HinTak commented 3 years ago

@DavidBerdik I checked the url is identical - so I think Apple just blocks direct-url-linking: you must arrive at the download url via an Apple web page, not through a third party web site. This is a common web server configuration to make sure large downloads (or images) only happens as a result of the user eye-balling web pages on the same server.

DavidBerdik commented 3 years ago

@HinTak Yeah I have seen this method before, but I didn't expect that Apple would do it since there would presumably be a need to support use cases where the file is downloaded through the command line.

superbonaci commented 3 years ago

Is possible to download xcode and command line tools on a real mac, then copy it over to linux and choose local file to install with darling?

bugaevc commented 3 years ago

Yes

superbonaci commented 3 years ago

Ok but do I have to modify the brew.sh install script or do I pass some option to darling or how do I do it? I'm asking for help here.

TheBrokenRail commented 3 years ago

IMO the best option is still just to download the CLT from Apple's Developer Portal and then install them in Darling, its always worked for me.

superbonaci commented 3 years ago

But do you need some Apple account or Developer enrollment?