FiloSottile / homebrew-musl-cross

Homebrew Formula for static-friendly musl-based GCC macOS-to-Linux cross-compilers
https://blog.filippo.io/easy-windows-and-linux-cross-compilers-for-macos/
ISC License
547 stars 45 forks source link

Uses system sed (`/usr/bin/sed`) rather than GNU sed (`/usr/local/bin/sed`) #12

Closed SamuelMarks closed 4 years ago

SamuelMarks commented 5 years ago
/usr/bin/sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
gmake[5]: *** [/private/tmp/musl-cross-20190620-7779-5tsznk/musl-cross-make-0.9.8/linux-4.4.10/scripts/Makefile.headersinst:112: /private/tmp/musl-cross-20190620-7779-5tsznk/musl-cross-make-0.9.8/build/local/x86_64-linux-musl/obj_kernel_headers/staged/include/asm-generic/.install] Error 1
gmake[4]: *** [/private/tmp/musl-cross-20190620-7779-5tsznk/musl-cross-make-0.9.8/linux-4.4.10/scripts/Makefile.headersinst:127: asm-generic] Error 2
gmake[3]: *** [/private/tmp/musl-cross-20190620-7779-5tsznk/musl-cross-make-0.9.8/linux-4.4.10/Makefile:1060: headers_install] Error 2
gmake[3]: Leaving directory '/private/tmp/musl-cross-20190620-7779-5tsznk/musl-cross-make-0.9.8/build/local/x86_64-linux-musl/obj_kernel_headers'
gmake[2]: *** [Makefile:146: sub-make] Error 2
gmake[2]: Leaving directory '/private/tmp/musl-cross-20190620-7779-5tsznk/musl-cross-make-0.9.8/linux-4.4.10'
gmake[1]: *** [Makefile:260: obj_kernel_headers/.lc_built] Error 2
gmake[1]: Leaving directory '/private/tmp/musl-cross-20190620-7779-5tsznk/musl-cross-make-0.9.8/build/local/x86_64-linux-musl'
gmake: *** [Makefile:168: install] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/filosottile/homebrew-musl-cross/issues

Which is odd, so I double checked:

$ which sed
/usr/local/bin/sed
$ sed --version
sed (GNU sed) 4.7
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
Paolo Bonzini, Jim Meyering, and Assaf Gordon.
GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.
$ /usr/bin/sed --version
/usr/bin/sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
$ strings /usr/bin/sed | grep -F FreeBSD
$FreeBSD: src/usr.bin/sed/compile.c,v 1.28 2005/08/04 10:05:11 dds Exp $
$FreeBSD: src/usr.bin/sed/main.c,v 1.36 2005/05/10 13:40:50 glebius Exp $
$FreeBSD: src/usr.bin/sed/misc.c,v 1.10 2004/08/09 15:29:41 dds Exp $
$FreeBSD: src/usr.bin/sed/process.c,v 1.39 2005/04/09 14:31:41 stefanf Exp $
FiloSottile commented 5 years ago

Thanks for the report, could you provide reproduction instructions?

SamuelMarks commented 5 years ago

I'm not sure how to reproduce, on my end I just ran brew upgrade.

EDIT: Was able to get this to succeed by mv /usr/bin/sed /usr/bin/sed.bak; cp /usr/local/bin/sed /usr/bin/; brew upgrade; mv /usr/bin/sed.bak /usr/bin/sed

==> Upgrading filosottile/musl-cross/musl-cross 
==> Downloading https://github.com/richfelker/musl-cross-make/archive/v0.9.8.tar.gz
Already downloaded: ~/Library/Caches/Homebrew/downloads/b1fb6145694b3f03e6d4bab7953ade2a909be7407f0819f78d892d3dcd3f81e8--musl-cross-make-0.9.8.tar.gz
==> Downloading https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.10.tar.xz
Already downloaded: ~/Library/Caches/Homebrew/downloads/398d7b1a67ebf5f658f5f31f2d57a936f9161716fed598d400290556e8049d42--linux-4.4.10.tar.xz
==> Downloading https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.bz2
Already downloaded: ~/Library/Caches/Homebrew/downloads/874c62a002181fc3df2f9f0a8a9499f33bb21ccb6370ab9b1065a0e634264b70--mpfr-3.1.4.tar.bz2
==> Downloading https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
Already downloaded: ~/Library/Caches/Homebrew/downloads/bd14c3cef87f64bec2487a0b0135ce51aea28ef5153b0c74bfd9888c82ebf3b8--mpc-1.0.3.tar.gz
==> Downloading https://ftp.gnu.org/gnu/gmp/gmp-6.1.1.tar.bz2
Already downloaded: ~/Library/Caches/Homebrew/downloads/5e579956c8e1aafdb613f9a1735c3b94b0c947db2b3399353408dcb30820abc4--gmp-6.1.1.tar.bz2
==> Downloading https://www.musl-libc.org/releases/musl-1.1.22.tar.gz
Already downloaded: ~/Library/Caches/Homebrew/downloads/9389d81146f56f0022c4a8176540aafb5c445271f3d832b9ee26240b009bf46c--musl-1.1.22.tar.gz
==> Downloading https://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.bz2
Already downloaded: ~/Library/Caches/Homebrew/downloads/16b0cf84c596dc930fb778e07dc61cf98a1927d8a6287beed37571757804a448--binutils-2.27.tar.bz2
==> Downloading https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=3d5db9ebe860
Already downloaded: ~/Library/Caches/Homebrew/downloads/53c623e9fd9ebac8516b8d880b2a1f0e9c9ef2aa08be18ec30d173ba4ca7d1f2--config.sub
==> Downloading https://ftp.gnu.org/gnu/gcc/gcc-6.4.0/gcc-6.4.0.tar.xz
Already downloaded: ~/Library/Caches/Homebrew/downloads/e91b66be39793d16f9455fa42756bf471f6fa77c02bd51ca6f3b2f01f823af73--gcc-6.4.0.tar.xz
==> Downloading http://isl.gforge.inria.fr/isl-0.15.tar.bz2
Already downloaded: ~/Library/Caches/Homebrew/downloads/2d80a8397ef48e37eff156838a9b7e6963c8f2560eaa9dd578f0894fa731a229--isl-0.15.tar.bz2
==> /usr/local/opt/make/bin/gmake install TARGET=x86_64-linux-musl
🍺  /usr/local/Cellar/musl-cross/0.9.8: 2,474 files, 148.4MB, built in 49 minutes 2 seconds
Removing: /usr/local/Cellar/musl-cross/0.9.7_1... (2,464 files, 163.9MB)
==> Caveats
FiloSottile commented 5 years ago

Weird, that's what

https://github.com/FiloSottile/homebrew-musl-cross/blob/35c92f16d61f22307a15b509cde9600e421b7c41/musl-cross.rb#L115

should be for...

FiloSottile commented 5 years ago

I just tried doing the same upgrade myself and unfortunately I can't reproduce it.

Can you give an output for brew config, brew doctor, and brew install --verbose --debug musl-cross? Thank you!

SamuelMarks commented 5 years ago
$ brew config
HOMEBREW_VERSION: 2.1.6-22-g3cef108
ORIGIN: https://github.com/Homebrew/brew
HEAD: 3cef1088967291a27583b41c09c32a041b52b00e
Last commit: 12 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c0915e6f8580648888a85a2f6e826b3c7c88167d
Core tap last commit: 4 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_NO_ANALYTICS: 1
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 10.0 build 1001
Git: 2.22.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_131
macOS: 10.14.5-x86_64
CLT: 10.2.1.0.1.1554506761
Xcode: 10.2.1
CLT headers: 10.2.1.0.1.1554506761
XQuartz: 2.7.11 => /opt/X11
$ brew doctor

doctor.txt

$ brew install --verbose --debug musl-cross

musl-cross.txt

FiloSottile commented 4 years ago

I've never managed to reproduce this, and it doesn't look like anyone else ran into it, so I have to assume it was either an environment issue or an Homebrew bug.

The good news is that we now ship bottles, so you should be able to install the formula without compiling it.