NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.04k forks source link

Package request: o3de #255307

Open Ashvith10 opened 1 year ago

Ashvith10 commented 1 year ago

Project description

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.

Metadata

Ashvith10 commented 1 year ago

I can try working on a derivation, but I'm not sure if I will be able to build this locally.

QushyQushy commented 1 year ago

Any news on this?

Ashvith10 commented 1 year ago

@QushyQushy there's actually a bunch of issues with building o3de, and most of it has to do with how the bash scripts fail, because of the shebang in Python and Shell script respectively. I don't have a lot of experience with using patches in Nix expressions. This project tries to download it's own Python binaries, which isn't reproducible, I think. Also, my system isn't powerful enough to build this. It would be better if someone with proper Nix proficiency looks into this. However, I can give this a last try.

Here's the build instructions for Linux, if you want to try them for yourself.

QushyQushy commented 1 year ago

@QushyQushy there's actually a bunch of issues with building o3de, and most of it has to do with how the bash scripts fail, because of the shebang in Python and Shell script respectively. I don't have a lot of experience with using patches in Nix expressions. This project tries to download it's own Python binaries, which isn't reproducible, I think. Also, my system isn't powerful enough to build this. It would be better if someone with proper Nix proficiency looks into this. However, I can give this a last try.

Here's the build instructions for Linux, if you want to try them for yourself.

Thank you so much! I have zero familiarity with the Nix build system unfortunately. I thought it would be as simple as downloading the .deb file and extracting it in the proper places but I have no idea in reality.

polypoyo commented 3 weeks ago

Can we reopen this? I don't want to make a duplicate issue

Ashvith10 commented 3 weeks ago

@polypoyo I've re-opened this.

tanshihaj commented 2 weeks ago

I've tried to build o3de using nix + nixpkgs and here some thoughts about it. Even though build process pretty good documented o3de has one big issue regarding to building process: O3DE Packages. As well as other big c++/cmake projects this project invented its own cross-platform dependency management tooling. In general terms CMake scripts (engine itself, gems and project files) contains O3DE Packages declarations (here is the example from engine scripts: https://github.com/o3de/o3de/blob/c753ddf5c25c8cc7aa44845afd035e3996962e81/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux_x86_64.cmake#L20-L48) with tar hashes. CMake functions tries to download, check hash, unpack and check unpacked file hashes of these O3DE Packages. Result are put into $LY_3RDPARTY_PATH folder. There are a lot of packages with pre-build binaries inside.

This approach obviously conflicts with nix + nixpkgs because:

  1. nix build environment with enabled sandboxing will not allow build script to access network.
  2. Even if we will pre-download all these dependencies binaries from these packages will not run in nixos due to incorrect interpreter path and incorrect RPATH.
  3. Even if we will pre-download all required dependencies and run patchelf on them for engine code what to do with O3DE packages declared in gems and projects?

I see several solutions to fix this issue, one worse than other:

  1. Pre-download and pre-patch all required dependencies for engine itself, require special environment for packages with all required dependencies pre-downloaded and pre-patched. Kinda true nix-way but it is pretty hard-to-use for package users.
  2. Pre-download binaries for engine and hack somehow cmake functions in https://github.com/o3de/o3de/blob/development/cmake/3rdParty.cmake and https://github.com/o3de/o3de/blob/development/cmake/3rdPartyPackages.cmake so they will automatically patch binaries after downloading.

Maybe somebody here has more experience with dealing cmake-based package managers?

NB: it is just build-related issues, I think there can be bunch of other questions regarding to the usability: engine registration, packaging project for release, etc. I think this questions should be discussed separately.