News for hackers. Stuff that matters.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by sreque on Monday April 02, 2018 @05:29PM (#16739545)
I've heard it said that the greatest minds of our generation are thinking about how to make people click ads. However, I feel like the greatest minds of our generation are spent trying to figure out how to enable people to build Linux software on OSX. Whether it is:

* a convoluted process involving Vagrant, Docker, or both, because you depend on one or more pieces of software that don't run at all on OSX, including Docker itself.

* slogging through bugs specific to services running on OSX because they really only support Linux well, such as Cassandra or Kafka, or even MySQL.

* Getting shells scripts that work reliably on both OSX and Linux, especially as the tools used to do so break backwards compatibility, either by Apple itself or by 3rd party tools like HomeBrew.

* Getting a consistent development environment at all on OSX. Doing so seems to be much easier on a Linux distribution than on OSX.

And that's not even talking about general issues like:

* incredibly flaky bluetooth drivers, often requiring a full restart to fix, if not having to reset some weird hardware bit.

* My laptop randomly not waking up properly from sleep and requiring a restart.

* My laptop randomly beach-balling more often than I ever saw BSoDs on windows.

* OSX seeming to just run really slowly compared to Linux whenever it is stressed in any meaningful way.

* My laptop's wifi not working with random wifi endpoints, such as at the airport or hotel. Whether it's router software bugs or OSX bugs, I am always able to connect just fine on my windows laptop.

* Having to deal with OSX's incredibly outdated userland and its BSD-specific userland. Yes, there are workarounds, but they are generally a pain to figure out and have not been standardized in our environment in any way.

* For a few months my OSX terminal was SEG-faulting about twice a week. I learned to be very grateful for screen/tmux during that time. At some point Apple seemed to fix it, at least.

At $lastjob we were actually developing a Linux service that relied heavily on Linux APIs because it was essentially creating full-on Linux containers like Docker. Before I joined, the previous developers, all big apple fans, were actually going through the tremendous effort of trying to make the service at least build and run on OSX, even if it no-oped most of the things it did.

When I joined, one of my first acts was to completely remove OSX support for this service, and I promise you that life got way easier ever since. Our development processes got simpler. Our build system got simpler. And most of all, our source code got simpler and easier to read.

Granted, most of us aren't developing software that directly calls into Linux APIs, but even then I think you'll find huge productivity wins if you just use a Linux laptop or desktop, assuming everything else is equal.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by antimatter on Monday April 02, 2018 @06:26PM (#16739999)
Everything you listed under your general issues section is my exact experience when running Linux. I don't seem to have any of those issues on OSX.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by Myrmornis on Monday April 02, 2018 @06:05PM (#16739842)
I did maintain a Linux laptop (Ubuntu) for all my personal and development usage, from 2003-2011. Based on my experience at that time, it is entirely incorrect to claim that the experience with device drivers (wifi, bluetooth) and sleep/suspend/hibernate is better on Linux. Those things basically never worked right, battery experience was terrible, and many times during that era I lost a day's work because something was broken early in the boot sequence, and I couldn't even start X Windows.

In 2011 I switched to macOS due to my job and I have never had to deal with any of that. Ever. Perhaps the Linux laptop experience has improved significantly since then though.

Furthermore, there was no hardware nearly as nice as Apple laptops on which to install linux. (Yeah, other than Apple laptops, but I felt like I didn't have the money to justify that).

However I of course agree with your points regarding Vagrant/Docker and shell scripting. It is a shame that MacOS could not be based on Linux.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by resoluti0n on Monday April 02, 2018 @07:47PM (#16740534)
The device drivers compatibility and availability on Linux these days has never been better. Even better than Windows and OS X out of the box in many cases. Seriously, there has been huge improvements in the last few years.

If you want to run Linux on a laptop and get the best experience, a Mac is not the best option. Thinkpad (business class X and T series) is what you are looking for.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by eosrei on Monday April 02, 2018 @08:00PM (#16740612)
Linux has come far in seven years. I haven't had issues with wifi or bluetooth for years on quality hardware (Thinkpad, Dell.) YMMV
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by foobarian on Monday April 02, 2018 @10:43PM (#16741479)
I begrudgingly use a MBP now after many years dealing with similar issues on Linux. The hardware is great, things adjacent to hardware are great (drivers, external monitors, configuration) but I would prefer to have the windowing system behave more like Gnome. Things like Alt+click to drag a window, Alt-Tab cycling through windows not apps (and stick to the same desktop workspace at that) menu bar location etc.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by Myrmornis on Tuesday April 03, 2018 @12:52AM (#16742004)
FWIW Alt-Tab, for me, does cycle through windows not apps, and windows within the same workspace only. Check SystemPreferences => Keyboard => Shortcuts => "Move focus to next window"
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by unclepresent on Monday April 02, 2018 @05:53PM (#16739739)
for everyone who wants to expirience a hell of developing software for linux under OSX i suggest to try to build apache httpd server from source on mac. it seems to be a trivial task on Linux but it is a hell of nightmare on OSX. I am saying this just because having a custom build version of apache is a commin need for many web projects.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by Myrmornis on Monday April 02, 2018 @06:07PM (#16739855)
Once you've got to the point of needing to match your production server technology, doesn't it feel like you should be using a VM or docker (assuming you're tied to MacOS as the development environment)?
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by stiGGG on Monday April 02, 2018 @06:22PM (#16739973)
Yeah, i don't understand this argument. Even all the devs i know working under linux are doing all their development under docker or VMs to match the live environment and being able to switch between different projects more easily. And even when you have only one project, who wants to run debian stable or centos as his main OS?
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by unclepresent on Monday April 02, 2018 @07:57PM (#16740601)
I do use docker. Do not worry about this part.

But first of all development without docker is much faster. Setting up a docker container takes some time (especially with a custom built apache server).

Secondly running a docker machine (needs a Linux VM) on mac in parallel to Vagrant (I have to use it too) is CPU taxing as both (docker machine and vagrant) VMs take a lot of power from main CPU.

Add to this constant port conflicts and network paths resolutions issues between different docker containers and hosts. Also it forces me to use Oracle Virtual Box (who likes Oracle ?) These little things all add up.

My point is that what should be a trivial task, is not so trivial when deployment is done on one platform and development is done on another. I agree with original comment that it probably makes sense for industry as a whole to switch to Linux development workstation instead of Mac.

The only reason I use Mac besides it is a company policy is because OSX somehow able to render better fonts. My eyes are getting tired after looking on poorly rendered fonts from Linux machines. If you use Mac and want to see how Linux fonts look like - install SeaMonkey browser. It turns off all proprietary patented algorithms available on OSX and renders fonts exactly as on pure Linux where due to some licensing issues many nice font rendering technics are disabled.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by tracker1 on Monday April 02, 2018 @09:18PM (#16741091)
Do an intermediate container, and it shouldn't take very long for repeat builds.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by zeveb on Tuesday April 03, 2018 @08:26AM (#16743950)
> Even all the devs i know working under linux are doing all their development under docker or VMs

I don't, because docker is a buggy, embarrassingly-poorly-designed system and VMs are a pain. I develop on the same system I deploy on: Debian stable.

> And even when you have only one project, who wants to run debian stable or centos as his main OS?

I loathe CentOS, but I love Debian stable. It's a wonderful, solid (one might even say … stable) system. Why wouldn't I want to run it as my main OS?

One of the things I really hate about our development culture is the cult of the new. It's a good thing to use stable, well-tested systems. Let others find the bugs; I'm happy to get work done.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by gurkendoktor on Monday April 02, 2018 @07:54PM (#16740583)
> who wants to run debian stable or centos as his main OS?

I haven't used these two in particular, but if they support flatpak, why not? You'd have the same packages as on the server plus the latest versions of GUI apps.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by stiGGG on Monday April 02, 2018 @10:11PM (#16741343)
Interesting point, is flatpak already a mature thing?
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by gurkendoktor on Tuesday April 03, 2018 @04:13AM (#16742746)
I've used flatpak on an Ubuntu 16.04 base without issues. There are limitations, for example you can't easily replace/update your window manager through flatpak or snap. But for user-facing apps, it's really a great step forward.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by FabHK on Tuesday April 03, 2018 @06:05AM (#16743259)
The macOS system shell, python, compiler etc. are out of date, and out of your control. They're good enough for basic tinkering. However, as soon as you develop on a Mac professionally, you should create your own dev environments and stack independent of the macOS maintained one, starting with brew for example.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by super_mario on Tuesday April 03, 2018 @10:20AM (#16744831)
I thought it was common knowledge that you should not rely on system provided Python, Ruby, Tcl etc. They are there for scripting the system and nothing else.

If you are Python developer, install specific version your project needs and use that. Same for any other language.

Not sure what you mean by outdated compiler? For what? C, C++ etc are distributed with Xcode and clang is usually standard compliant and recent.

BASH is the only problem. Newer BASH versions switched to GPL v3 and Apple will never upgrade to that.

My personal solution for that is to disable system integrity protection, build latest bash and install in /bin.

This way most scripts that have #!/bin/sh or #!/bin/bash and rely on new BASH features just work.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by walshemj on Monday April 02, 2018 @07:13PM (#16740317)
You always ought to build on the same hardware you deploy on - to be blunt having multiple developers messing around on n different macs is just madness!
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by bschwindHN on Monday April 02, 2018 @08:54PM (#16740958)
Just use docker or a VM for matching your production environment. Then your devs can use whatever device they're comfortable with. Add in a CI environment and then suddenly you don't need to force the same OS on everyone. Everybody likes something different.
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by walshemj on Monday April 02, 2018 @11:09PM (#16741594)
Its better than nothing, but you still have added extra risk by doing it this way:

Are all the VM's exactly the same

Can you 100% prove that the vm behaves identically on all the varied hardware.

And no "professional" would consider "Everybody likes something different" is ever valid for a paying job!

No problem if its a hobby project but on a project with even a small number say 5 or 6 the risk isn't worth it.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by bschwindHN on Tuesday April 03, 2018 @02:44AM (#16742399)
Once again, this is why CI is important, it acts as a final test to make sure things build and run correctly. If your deployments go through the entire CI process before going anywhere important, the source of the work (developers' particular workstation setup) is not as important.

> Are all the VM's exactly the same

Is the silicon die on your processor exactly the same as everyone else on your team? If not, you're not a TRUE professional.

> Can you 100% prove that the vm behaves identically on all the varied hardware.

No, but I also recognize that I (and many other devs) are not writing space shuttle / train control / self-driving car software that is responsible for human lives. If I were, I wouldn't be advocating for the style of development I mentioned above. That is a different situation which I imagine most people on this site are not dealing with.

> And no "professional" would consider "Everybody likes something different" is ever valid for a paying job!

What does this even mean? Of course it can be "valid" for a paying job. There are literally companies out there who offer different OSes and machines to use for a job and the developers get paid. You get to deem they are not "professional" because...?

> No problem if its a hobby project but on a project with even a small number say 5 or 6 the risk isn't worth it.

The risk doesn't lie with the number of people on a project but the scope of the project itself: basically, can human lives be impacted in a significant way if a dev screws up? Then yeah, there are better, more rigorous ways. Are you writing a web app, a desktop GUI, some CLI tool, or perhaps...the Linux kernel? Then develop on the machine you like! Have a good review process, set up CI to build for the platforms you support, and implement a good set of tests.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by walshemj on Tuesday April 03, 2018 @04:09PM (#16748613)
"Is the silicon die on your processor exactly the same as everyone else on your team?"

Of course I have worked on projects where all the test dev and live hardware was explicitly brought from the same production run so the hard ware was identical down to the rev no of the pcb's - our hardware guy would have liked to have all the disk also from the same production run.

Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by jen20 on Tuesday April 03, 2018 @11:06AM (#16745310)
Can you "100% prove" that your destop Linux distribution has the same kernel modules and packages, and that none of the versions or patches diverge from the server your project is destined for?
Re:Apple Plans to Use Its Own Chips in Macs from 2020, Repla... by kalleboo on Tuesday April 03, 2018 @09:37AM (#16744462)
I don't even know what hardware I'm deploying on. Amazon/Google/Azure has abstracted that away from me.