Andy-Python-Programmer / aero

Aero is a new modern, experimental, UNIX-like operating system following the monolithic kernel design. Supporting modern PC features such as long mode, 5-level paging, and SMP (multicore), to name a few.
https://aero.andypy.dev
GNU General Public License v3.0
1.17k stars 50 forks source link

Build script throwing subprocess "Exec format error" #86

Open ghost opened 1 year ago

ghost commented 1 year ago

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'

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.

ghost commented 1 year ago

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 1 year ago

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

jwpjrdev commented 1 year ago

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

48cf commented 1 year ago

it's for cross compiling iirc

ghost commented 1 year ago

@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).