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

thisroot.sh does not recognize bash when running in qemu-x86_64 #14085

Closed
1 task done
Tracked by #14319
kkauder opened this issue Nov 21, 2023 · 5 comments · Fixed by #14251
Closed
1 task done
Tracked by #14319

thisroot.sh does not recognize bash when running in qemu-x86_64 #14085

kkauder opened this issue Nov 21, 2023 · 5 comments · Fixed by #14251

Comments

@kkauder
Copy link

kkauder commented Nov 21, 2023

Check duplicate issues.

  • Checked for duplicates

Description

Using a docker container on M1, but not optimized for M1, thisroot.sh extracts the shell name as qemu-x86_64, and consequently produces

ERROR: must "cd where/root/is" before calling ". bin/thisroot.sh" for this version of "qemu-x86_64"!

Reason:
/proc/$$/cmdline produces

/usr/bin/qemu-x86_64
/usr/bin/bash
bash
--norc
...

and cut -d '' -f1 picks up the emulator, not the shell.

Reproducer

I don't know where to find a lighter image, this one isn't too bad at <10 GB. On a Silicon Mac:

curl -L https://github.com/eic/eic-shell/raw/main/install.sh | bash
./eic-shell
source /usr/local/bin/thisroot.sh

I believe in linux the following also invokes the image with a qemu setting

docker run --rm -it --platform linux/arm64 ghcr.io/eic/jug_dev:master-nightly

ROOT version

   ------------------------------------------------------------------
  | Welcome to ROOT 6.28/04                        https://root.cern |
  | (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on May 08 2023, 02:44:07                 |
  | From tags/v6-28-04@v6-28-04                                      |
  | With g++ (Debian 12.2.0-14) 12.2.0                               |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

Installation method

spack

Operating system

Docker container on M1 Mac, inside uname -a = Linux 7163f573db33 5.15.49-linuxkit-pr #1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023 x86_64 GNU/Linux

Additional context

No response

@ferdymercury
Copy link
Collaborator

Try maybe adding something like:

if trueExe == qemu-x86_64
trueExe=$(cut -d '' -f2 /proc/$$/cmdline) || return 1
endif

@wdconinc
Copy link
Contributor

The same happens for various other combinations of host and target architectures with qemu. The filename of the emulator doesn't even always include qemu (it's /usr/libexec/qemu-binfmt/aarch64-binfmt-P when emulating aarch64 on x64_64, for example)...

@kkauder
Copy link
Author

kkauder commented Nov 22, 2023

Is there a reason why ps -p $$ -o comm= isn't used as the default? Cause that seems to work.

@ferdymercury
Copy link
Collaborator

ferdymercury commented Nov 22, 2023

Because it failed when calling as executable or with some other platforms (4c9e1e6) #10418

@wdconinc
Copy link
Contributor

Please consider #14251 as a possible fix.

@guitargeek guitargeek added this to Issues in Fixed in 6.32.00 via automation Dec 18, 2023
@guitargeek guitargeek added this to Issues in Fixed in 6.30.04 via automation Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

4 participants