Andy-Python-Programmer/aero

Build script throwing subprocess "Exec format error"

amxda opened this issue · 5 comments

amxda commented

Hello! There's a bit of an issue with the build process, and the way the bundled cargo is called from aero.py seems to disagree with subprocess on my system for some reason.

Results of ./aero.py --test:

Traceback (most recent call last):
  File "/Users/<name>/Documents/Programming/aero/./aero.py", line 665, in <module>
    main()
  File "/Users/<name>/Documents/Programming/aero/./aero.py", line 644, in main
    user_bins = build_userland(args)
  File "/Users/<name>/Documents/Programming/aero/./aero.py", line 371, in build_userland
    return build_cargo_workspace('userland', 'build', ['--package', 'utest', *cmd_args], get_cargo())
  File "/Users/<name>/Documents/Programming/aero/./aero.py", line 261, in build_cargo_workspace
    code, _, _ = run_command([cargo, command, *args], cwd=cwd)
  File "/Users/cat/Documents/Programming/aero/./aero.py", line 223, in run_command
    output = subprocess.run(args, **kwargs)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '../bundled/host-rust-prebuilt/aero/host-cargo/bin/cargo'
  • python3 --version: Python 3.9.6
  • Host Operating System: macOS Ventura 13.0
  • Host Architecture: aarch64-darwin

note: I'm well aware aarch64-darwin isn't officially supported, but it's one of the few (if not the only) mainstream consumer platform using the aarch64 architecture, and at least the only aarch64-based device I have access to for testing.

update: aero.py build system is not functional on aarch64 - PR #81 will likely fix architecture support, upon which this issue can be closed.

48cf commented

the issue here is that the prebuilt rust/cargo is compiled for x86_64-linux, you will have to figure out a way to compile all of that yourself if you want to use it on aarch64-darwin

why does aero need a seperate rust/cargo installation in place of the system default?

48cf commented

it's for cross compiling iirc

@jwpjrdev I'm not super familiar with the architecture of this project, but I think the whole unpacking a remote version of cargo from a Google Drive archive is just a band-aid fix implemented at some point that needs to be replaced (but again take this with a grain of salt).