Live data from Hacker News

sudo make install

bvnf.space

21–30 of 38 posts

Re: sudo make install

#21

Earlier quoted context omitted.

Differences in GNU/BSD sed is hardly a bug in Make.

No, correct. But it is a good example of something that you might expect to be more standard than it is between platforms, because of its age and relative ubiquity, where the differences get highlighted when trying to create (not just with make but other tools too) a consistent build process for a project.

Yeah, variance between different system utilities is one of the biggest underrated perils of shell scripting. For a long time, I worked on a team that mostly used Macs to administer Linux servers, which led to some confusing issues when people tested certain commands locally and then tried to use them on a server.

It would be nice if shellcheck had checks to detect common BSD/GNU incompatibilities and warn about them so you don't have to catch them in the moment.

Re: sudo make install

#23
post #17

Earlier quoted context omitted.

But this works: $ sed -e 's/foo/FOO/' -i 'ip.txt'

That's same as `sed -i 's/foo/FOO/' ip.txt` on GNU sed. Question is about inplace editing command that works on both GNU and MacOS (without needing a backup, with backup `-i.bkp` works on both). I don't have a Mac to check if `sed -e 's/foo/FOO/' -i 'ip.txt'` works there.

I checked, it doesn't. I see your point.

Re: sudo make install

#24

I’ve been working on Makefiles lately and its funny how many compatibility issues there are. I was doing Sed substitutions and found I needed to change the -i flag to make it work between Mac and Linux. I was really hoping for ultimate portability but ended up learning lots of hacks that lead to portability

Differences in GNU/BSD sed is hardly a bug in Make.

It wasn't claimed to be a bug.

Re: sudo make install

#25

I’ve been working on Makefiles lately and its funny how many compatibility issues there are. I was doing Sed substitutions and found I needed to change the -i flag to make it work between Mac and Linux. I was really hoping for ultimate portability but ended up learning lots of hacks that lead to portability

This is why powershell is gaining traction

Re: sudo make install

#26

I’ve been working on Makefiles lately and its funny how many compatibility issues there are. I was doing Sed substitutions and found I needed to change the -i flag to make it work between Mac and Linux. I was really hoping for ultimate portability but ended up learning lots of hacks that lead to portability

This is why powershell is gaining traction

PowerShell has platform-specific modules and ships by default with a ton of compatibility-breaking aliases. It doesn't really solve this problem

Re: sudo make install

#27

sudo make install is failure to use package management and an acceptance of unmanaged and increase system entropy. Tools like checkinstall are the way to go, at a minimum.

Indeed. Also, scripts (especially Dockerfiles) which run `apt-get install foo bar baz`; usually mixed in with a bunch of other commands, and file copying/editing. That's literally what package formats like .deb, .rpm, etc. are for! For example: - Write your dependencies in a `my-package/DEBIAN/control` file - If you want any extra files, put those in your `my-package/` folder too (e.g. `my-package/etc/some_config_fil…

The main issue when it comes to using Debian or most conventional package managers (nix really deserves its own mention there) is that you also pretty much distro lock your software, which may not be always beneficial. Another problem comes now in the form of distribution; packaging is one thing, distributing is another. Debian isn't too bad about this but depending on your choice of packager[0], you could suddenly need to spend another couple days trying to figure out how to even host the thing unless you want to spend time running wget on your production machines to pull in deb/RPM/makepkg output/pick your poison files.

Nix deserves its own mention because while it pretty much singlehandedly tries to solve all major issues with dependency management, it also... does so by abandoning almost every assumption most people have about how the OS is supposed to work (not to mention that writing nix files is basically learning a whole new language which is... doable but not exactly accessible). It's definitely the stronger solution compared to dockerfiles, but you can translate any program for any distro into a dockerfile as long as it runs on your kernel (alongside the fact that a dockerfile is a really good way to deal with the "documentation abandoned 5 years ago, but it runs on Dave's machine if you follow the README and change about 50 different small settings in your OS" projects which are done a dozen with FOSS projects).

Docker is a mess technically but when it comes to software you want to use/deploy but don't want to understand all the fine details of the source code, it is often a lot easier to work with compared to Nix, which if you have something not in nixpkgs, can result in you needing to start making upstream patches to genericize build directories and generally change peoples CI flows in ways maintainers don't necessarily appreciate.

tldr; nix is good, docker is easy.

[0] It's been a few years but the worst package distribution system I've had the displeasure to use are Ubuntu PPAs. It's a system close to the Debian specification but it requires a whole set of separate commands and weird signing steps before you can upload anything, none of which is properly documented because they expect people that want to use PPAs to shove it in a makefile, which isn't useful if you don't use a language that relies on Makefiles, but I digress.

Re: sudo make install

#28
post #26

Earlier quoted context omitted.

This is why powershell is gaining traction

PowerShell has platform-specific modules and ships by default with a ton of compatibility-breaking aliases. It doesn't really solve this problem

Sure it does, all the standard calls are universal, hell I wrote a _universal_ directory monitoring shell script. Try and do that with bash on windows/linux/osx.

Re: sudo make install

#29
post #26

Earlier quoted context omitted.

PowerShell has platform-specific modules and ships by default with a ton of compatibility-breaking aliases. It doesn't really solve this problem

Sure it does, all the standard calls are universal, hell I wrote a _universal_ directory monitoring shell script. Try and do that with bash on windows/linux/osx.

>I wrote a _universal_ directory monitoring shell script

That might be a good Show HN example.

Re: sudo make install

#30

Earlier quoted context omitted.

Sure it does, all the standard calls are universal, hell I wrote a _universal_ directory monitoring shell script. Try and do that with bash on windows/linux/osx.

>I wrote a _universal_ directory monitoring shell script That might be a good Show HN example.

Seconded!
Post reply on HN