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

gcc-ar failed: error executing command ... /usr/bin/ar: invalid option -- '@' #14143

Closed
yesudeep opened this issue Oct 20, 2021 · 1 comment
Closed

Comments

@yesudeep
Copy link
Contributor

yesudeep commented Oct 20, 2021

Description of the problem / feature request:

Build failure:

... 
/usr/bin/ar: invalid option -- '@'

with Bazel's rolling release.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

❯ bazel test ...
2021/10/20 13:45:35 Downloading https://github.com/bazelbuild/bazel/releases/download/5.0.0-pre.20211011.2/bazel-5.0.0-pre.20211011.2-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
ERROR: /home/yesudeep/code/foo/foo/algorithm/BUILD.bazel:1:11: Linking foo/algorithm/libswap_ints.a failed: (Exit 1): gcc-ar failed: error executing command
  (cd /home/yesudeep/.cache/bazel/_bazel_yesudeep/207c7cf9b46d428b257b88510b274dc9/sandbox/linux-sandbox/7/execroot/__main__ && \
  exec env - \
    PATH=/home/yesudeep/.cache/bazelisk/downloads/bazelbuild/bazel-5.0.0-pre.20211011.2-linux-x86_64/bin:/home/yesudeep/.emacs.d/bin:/home/yesudeep/.local/bin:/home/yesudeep/.python/bin:/home/yesudeep/.cargo/bin:/home/yesudeep/.yarn/bin:/home/yesudeep/flutter/bin:/home/yesudeep/.homebrew/bin:/home/yesudeep/go/bin:/snap/bin:/mingw64/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc-ar @bazel-out/k8-fastbuild/bin/foo/algorithm/libswap_ints.a-2.params)
# Configuration: ce753a6cf9bc0287f94b51cdd4ece0523bc6611ed2b38f7be9a6f2f2978b8012
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
/usr/bin/ar: invalid option -- '@'
Usage: /usr/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoOPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
       /usr/bin/ar -M [<mri-script]
 commands:
  d            - delete file(s) from the archive
  m[ab]        - move file(s) in the archive
  p            - print file(s) found in the archive
  q[f]         - quick append file(s) to the archive
  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  s            - act as ranlib
  t[O][v]      - display contents of the archive
  x[o]         - extract file(s) from the archive
 command specific modifiers:
  [a]          - put file(s) after [member-name]
  [b]          - put file(s) before [member-name] (same as [i])
  [D]          - use zero for timestamps and uids/gids (default)
  [U]          - use actual timestamps and uids/gids
  [N]          - use instance [count] of name
  [f]          - truncate inserted file names
  [P]          - use full path names when matching
  [o]          - preserve original dates
  [O]          - display offsets of files in the archive
  [u]          - only replace files that are newer than current archive contents
 generic modifiers:
  [c]          - do not warn if the library had to be created
  [s]          - create an archive index (cf. ranlib)
  [l <text> ]  - specify the dependencies of this library
  [S]          - do not build a symbol table
  [T]          - make a thin archive
  [v]          - be verbose
  [V]          - display the version number
  @<file>      - read options from <file>
  --target=BFDNAME - specify the target object format as BFDNAME
  --output=DIRNAME - specify the output directory for extraction operations
  --record-libdeps=<text> - specify the dependencies of this library
 optional:
  --plugin <p> - load the specified plugin
 emulation options:
  No emulation specific options
/usr/bin/ar: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pe-x86-64 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex plugin
INFO: Elapsed time: 19.862s, Critical Path: 0.17s
INFO: 23 processes: 19 internal, 4 linux-sandbox.
FAILED: Build did NOT complete successfully

What operating system are you running Bazel on?

OS: ClearLinux

❯ uname -a
Linux ghostname 5.10.74-25.lts2020 #1 SMP Sun Oct 17 03:04:46 PDT 2021 x86_64 GNU/Linux

Compiler:

❯ gcc --version
gcc (Clear Linux OS for Intel Architecture) 11.2.1 20211015 releases/gcc-11.2.0-353-g6a936be4ad
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What's the output of bazel info release?

❯ bazel info release
release 5.0.0-pre.20211011.2
@benjaminp
Copy link
Collaborator

#3760

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

No branches or pull requests

2 participants