"tar: Option --owner=0 is not supported" on macOS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Confirmed
|
Undecided
|
Przemyslaw Wirkus |
Bug Description
On OS X Mojave (10.14.4):
```
$ uname -a
Darwin my-mac.domain.local 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-
```
I followed the build instructions for the latest release:
```
$ wget https:/
$ tar xf gcc-arm-
$ cd gcc-arm-
./install-
# instead of "build prerequisites", I did
brew install gmp mpfr libmpc isl libelf
./build-
```
The build ran (for a few hours), but I hit this error, I think at packaging time:
```
+ echo Task '[III-11]' /x86_64-
Task [III-11] /x86_64-
+ cp /Users/
+ cp /Users/
+ cp /Users/
+ copy_dir_clean /Users/
+ set +u
+ mkdir -p /Users/
+ cd /Users/
+ cd /Users/
+ tar xf -
+ tar cf - --exclude=CVS --exclude=.svn --exclude=.git --exclude=.pc '--exclude=*~' '--exclude=.#*' '--exclude=*.orig' '--exclude=*.rej' .
+ set -u
+ rm -f /Users/
+ rm -f /Users/
+ pushd /Users/
~/src/brew/
+ ln -s /Users/
+ tar cjf /Users/
tar: Option --owner=0 is not supported
Usage:
List: tar -tf <archive-filename>
Extract: tar -xf <archive-filename>
Create: tar -cf <archive-filename> [filenames...]
Help: tar --help
```
This option is hardcoded at this part of `./build-
```
# Start making the package.
pushd $BUILDDIR_NATIVE
ln -s $INSTALLDIR_NATIVE $INSTALL_
# Make the package tarball.
${TAR} cjf $PACKAGEDIR/
--owner=0 \
--group=0 \
--exclude=
--exclude=
$INSTALL_
$INSTALL_
$INSTALL_
$INSTALL_
# Remove stale links.
rm -f $INSTALL_
popd
```
This is the tar(1) that macOS packages:
```
$ which tar
/usr/bin/tar
$ tar --version
bsdtar 2.8.3 - libarchive 2.8.3
```
whose manpage says nothing about `--owner` but offers instead
```
An input file in mtree(5) format can be used to create an output archive with arbitrary ownership, permissions, or names that differ from existing data on disk:
$ cat input.mtree
#mtree
usr/bin uid=0 gid=0 mode=0755 type=dir
$ tar -cvf output.tar @input.mtree
```
How are the official macOS builds done? Do those machines have GNU tar installed? I found GNU tar in brew:
```
$ brew install gnu-tar
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 5a63de022 to e098c37dc.
Updated 1 tap (homebrew/cask).
==> Downloading https:/
==> Downloading from https:/
#######
==> Pouring gnu-tar-
==> Caveats
GNU "tar" has been installed as "gtar".
If you need to use it as "tar", you can add a "gnubin" directory
to your PATH from your bashrc like:
PATH=
==> Summary
🍺 /usr/local/
```
Rerunning as
```
$ PATH="/
```
made it build, but that's not a good fix.
The official install instructions should explain that you need GNU tar installed, or (preferably) the build script should be patched to handle BSD tar.
description: | updated |
Changed in gcc-arm-embedded: | |
status: | New → Confirmed |
Hi Nick,
We are indeed using GNU tar in our build system.
When I get my hands on OS X 10.14 I will try to figure out how to sort this issue out.
We may change build scripts or update documentation on how to build with GNU tar.
kind regards
Przemek