Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: arch: Command not found #92

Closed
sebadoom opened this issue Feb 14, 2018 · 5 comments
Closed

make: arch: Command not found #92

sebadoom opened this issue Feb 14, 2018 · 5 comments
Labels

Comments

@sebadoom
Copy link

During build I am now seeing the following error:

make: arch: Command not found
go build --ldflags '-s -w -X "main.version=v0.2.3-2-gbd2ca31" -X "main.buildTime=Wed Feb 14 13:21:43 -03 2018" -extldflags "-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"' -o bin/fscrypt ./cmd/fscrypt
go build -buildmode=c-shared --ldflags '-s -w -X "main.version=v0.2.3-2-gbd2ca31" -X "main.buildTime=Wed Feb 14 13:21:43 -03 2018" -extldflags "-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"' -o bin/pam_fscrypt.so ./pam_fscrypt
rm -f bin/pam_fscrypt.h

The build succeeds nonetheless. Is this expected? It might be related to commit 3326520

@josephlr
Copy link
Member

arch(1) is a command line tool that just prints out the architecture you're currently running (this is so the right version of the Protobuf Compiler can be used in the Makefile). The command is part of coreutils and was introduced there in 2007 for version 6.10. You can check your version of coreutils by running ls --version.

Even though it's been around for awhile, arch does the exact same thing as uname -m, so I'll just use that instead, and it should fix your problem.

Also, out of curiosity, what system are you running?

@sebadoom
Copy link
Author

sebadoom commented Feb 14, 2018

ArchLinux, up-to-date. I don't have the arch command and I do have coreutils, of course:

seba@i7-4790K-LIN [04:01:16 PM] [~] 
-> % arch
zsh: command not found: arch
seba@i7-4790K-LIN [04:01:27 PM] [~] 
-> % pacman -Qi coreutils 
Name            : coreutils
Version         : 8.29-1
Description     : The basic file, shell and text manipulation utilities of the GNU operating system
Architecture    : x86_64
URL             : https://www.gnu.org/software/coreutils/
Licenses        : GPL3
Groups          : base
Provides        : None
Depends On      : glibc  acl  attr  gmp  libcap  openssl
Optional Deps   : None
Required By     : ca-certificates-utils  intellij-idea-community-edition  linux  mkinitcpio  netctl  util-linux
Optional For    : usbutils
Conflicts With  : None
Replaces        : None
Installed Size  : 13.79 MiB
Packager        : Sébastien Luttringer <[email protected]>
Build Date      : Fri 29 Dec 2017 09:08:09 AM -03
Install Date    : Mon 22 Jan 2018 03:32:13 PM -03
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Output of ls --version:

seba@i7-4790K-LIN [04:01:33 PM] [~] 
-> % ls --version
ls (GNU coreutils) 8.29
Copyright (C) 2017 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 Richard M. Stallman and David MacKenzie.

Edit: I just checked how ArchLinux builds coreutils and it seems fairly standard, arch does not appear to be disabled, but it is not in my system:

./configure \
      --prefix=/usr \
      --libexecdir=/usr/lib \
      --with-openssl \
      --enable-no-install-program=groups,hostname,kill,uptime
  make
}

@sebadoom
Copy link
Author

Ah, here's what's going on: arch is not installed by default according to coreutils' docs: https://www.gnu.org/software/coreutils/manual/html_node/arch-invocation.html

arch is not installed by default, so portable scripts should not rely on its existence.

It needs to be explicitly enabled using configure. As you said, uname -m might be more portable.

@josephlr
Copy link
Member

Ahhhhhhh... That makes sense. I guess I'll send in a patch to the man pages then. This seems like the type of thing that should be mentioned.

@josephlr
Copy link
Member

josephlr commented Feb 14, 2018

Should be fixed in 7442ff1, please reopen if for some reason it isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants