gorilla-devs / GDLauncher

GDLauncher is a simple, yet powerful Minecraft custom launcher with a strong focus on the user experience
https://gdevs.io
GNU General Public License v3.0
1.21k stars 254 forks source link

Trouble Building on Arm64 #727

Closed theofficialgman closed 1 year ago

theofficialgman commented 3 years ago

Describe the bug When attempting to build on arm64 (in this case a nintendo switch), the build fails. Logs: 2020-12-21T20_27_01_716Z-debug.log 2020-12-21T20_27_01_772Z-debug.log 2020-12-21T20_27_01_824Z-debug.log

System: NVIDIA Jetson UNKNOWN Jetpack 4.3 [L4T 32.3.1] NV Power Mode: Locked_MAX - Type: 7 jetson_stats.service: active Board info: Type: UNKNOWN SOC Family: tegra210 - ID:33 Module: UNKNOWN - Board: UNKNOWN Code Name: icosa Boardids: 2595:0000:A0 CUDA GPU architecture (ARCH_BIN): NONE Serial Number: 1234 Libraries: CUDA: NOT_INSTALLED cuDNN: 7.6.3.28 TensorRT: 6.0.1.10 Visionworks: NOT_INSTALLED OpenCV: 4.1.1 compiled CUDA: NO VPI: NOT_INSTALLED Vulkan: 1.1.70

OS: Ubuntu 18.04.5 LTS aarch64 Host: icosa Kernel: 4.9.140+ Shell: bash 4.4.20 DE: GNOME 3.28.4 WM: GNOME Shell Terminal: gnome-terminal CPU: (4) @ 1.989GHz Memory: 1429MiB / 3969MiB

theofficialgman commented 2 years ago

looking at the https://github.com/r58Playz/m1-multimc-hack/blob/master/mcwrap.py m1-multimc-hack python script for inspiration, it looks like they get around this issue on M1 Macs using the official MultMC5 binary by rewriting the original classpath and arguments that multimc tries to launch they can do this because multimc has wrapper command functionality thats not available here in gdlauncher though so thats another dead end

theofficialgman commented 2 years ago

ok hear me out everyone... I have one idea that "should" work for all launchers that rely on the official minecraft version manifest.json (https://launchermeta.mojang.com/mc/game/version_manifest_v2.json or https://launchermeta.mojang.com/mc/game/version_manifest.json)

so here is what we do:

  1. have a github/gitlab server mirror this version_manifest.json file and make it available for edits
  2. create a .json parsing script to read each individual game version json available from the above version_manifast (so this is one minecraft version in it https://launchermeta.mojang.com/v1/packages/bcc36c0cf4cb0c8e9d6b34a62376ad7485556fe1/21w40a.json)
  3. automate a script to replace all of the org/lwjgl files with equivalent versions from my lwjgl binaries repos https://github.com/theofficialgman/lwjgl3-binaries-arm64, or use my multimc5 meta repo to somehow grab the information and replace it inside the microsoft provided json
  4. host a new verson_manifest.json with these changes which updates automatically and just update the launchers MC_MANIFEST_URL at build time
JJTech0130 commented 2 years ago

@theofficialgman I made a script to do that: https://github.com/JJTech0130/launchermeta-parse-nodejs Sorry for the messy code, it was like my second time with async js... I never finished it cuz I figured it was not worth it when using MMC, but feel free to use it as a basis. You should remove the S3 stuff; I never got that to work. Maybe I'll finish it sometime. Maybe.

JJTech0130 commented 2 years ago

@theofficialgman Not sure if edited pings work, sry for the double ping.

theofficialgman commented 2 years ago

(edited pings don't work) but you don't need to ping me anyway, this is my issue in gdlauncher so I see every reply anyway. Thanks for pointing me to your repo. I've never used javascript either so don't worry about it

I probably won't look into this till the weekend at earliest.. but I'll let you know if I make any progress on it.

JJTech0130 commented 2 years ago

Not my first time with js, just my first time with async js, I forgot a word there :) IIRC it mostly worked? I think it just needed to recalculate the hashes and sizes (and possibly filenames? I don't remember)...

theofficialgman commented 2 years ago

well in theory if I add to this script to parse from the lwjgl jars from my multimc meta repo (instead of reading from my binaries repo directly), then you don't even need to re-calculate any hashes/sizes since those are already in the multimc5 meta repo... basically I'm just theory-crafting what would be easier to maintain for me. Either way I'll look into it later and see what its current state is for myself

JJTech0130 commented 2 years ago

OK! Thanks for picking this all up... I have like way to many projects, and they are all in different languages (this in NodeJS, my Calibre/DRM stuff in Python, my matrix stuff in Go, my FIRST Tech Challenge stuff in Java... you get the point), much too hard to keep track and I really just don't have much interest in MC on RPi anymore.

theofficialgman commented 2 years ago

OK! Thanks for picking this all up...

Of course! Your documentation, repos, etc were extremely important on getting me on the right track for doing all of this, so thank you for that. Personally I don't see much reason to use Minecraft on the RPi (its a bit weak imho) but other more powerful SBC keep coming out so this should be future proof for them. I wanted minecraft java on nintendo switch in a better way than the original java launcher and a bunch of scripts so working on multimc5 just seemed like the obvious choice (given your attempts showing it could be done).

RedstoneWizard08 commented 2 years ago

I don't know if this will help but I've successfully gotten Minecraft 1.18.2 to run in VNC on Ubuntu Server 21.10. It's possible to run it without a GPU and everything, but we now just need a launcher for it instead of a shell script that runs the literal client jar (compiled from MCP mappings).

Eskaan commented 2 years ago

Just noticed I never gave this one its proper labels

theofficialgman commented 2 years ago

just an update on this. I completed what I suggested back in october of last year https://github.com/gorilla-devs/GDLauncher/issues/727#issuecomment-941521066 I will be coming back to building GDLauncher for armhf/arm64. I have created an automated script for generating my own custom minecraft version_manifest.json file to use my already existing accompanying libraries. It uses the programs jq wget sponge and spruce to modify and merge json files.

https://github.com/theofficialgman/piston-meta-arm64 https://github.com/theofficialgman/piston-meta-arm32

This should allow any arbitrary launcher to have a simple one line change. For GDLauncher, that "should" mean simply changing this one line to my manifest https://github.com/gorilla-devs/GDLauncher/blob/69a02964f4877f85271b5cdb09123e038c3bf9ec/src/common/utils/constants.js#L2 https://raw.githubusercontent.com/theofficialgman/piston-meta-arm64/main/mc/game/version_manifest.json

pinging @JJTech0130 just incase you wanted look

edit (see the last comment here for release binaries)

theofficialgman commented 2 years ago

@killpowa I have rebased the ARM64 changes that were posted earlier and applied them to my fork. however, I still can't build with seemingly non-arm64 issues https://github.com/theofficialgman/GDLauncher

I always get this error (regardless if I use npm i or yarn). npm i completes without error, then I get this when running npm run release:setup

 npm run release:setup

> gdlauncher@1.1.29 release:setup
> cross-env-shell NODE_ENV=production APP_TYPE=electron REACT_APP_RELEASE_TYPE=setup "npm run build" && npm run build-electron:setup && npm run deploy setup

> gdlauncher@1.1.29 build
> cross-env-shell NODE_ENV=production APP_TYPE=electron CI=false craco build

craco:  *** Cannot find ESLint plugin (ESLintWebpackPlugin). ***
Creating an optimized production build...
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:135:10)
    at module.exports (/home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/garrett/GDLauncher/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/garrett/GDLauncher/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/home/garrett/GDLauncher/node_modules/react-scripts/scripts/build.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:135:10)
    at module.exports (/home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/NormalModule.js:417:16)
    at /home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/NormalModule.js:452:10
    at /home/garrett/GDLauncher/node_modules/react-scripts/node_modules/webpack/lib/NormalModule.js:323:13
    at /home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/garrett/GDLauncher/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/garrett/GDLauncher/node_modules/react-scripts/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.9.0
theofficialgman commented 2 years ago

ok I manged to build... but I am getting errors on creating/selecting an instance

actions.js:2911 Missing resource: /home/garrett/.config/gdlauncher_next/datastore/libraries/net/minecraft/1.12.2.jar
actions.js:1132 Error: EEXIST: file already exists, open '/home/garrett/.config/gdlauncher_next/instances/1.12.2/installing.lock'
actions.js:2236 TypeError: The "path" argument must be of type string. Received undefined
    at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:120:11)
    at Object.join (node:path:1172:7)
    at index.js:143:24
    at Array.reduce (<anonymous>)
    at L (index.js:111:8)
    at actions.js:2178:25
    at f (regeneratorRuntime.js:86:17)
    at Generator._invoke (regeneratorRuntime.js:66:24)
    at Generator.next (regeneratorRuntime.js:117:21)
    at r (asyncToGenerator.js:3:20)
    at s (asyncToGenerator.js:25:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

edit: oh oops its my meta. looks like the format is slightly different than MMC

theofficialgman commented 2 years ago

fixed the meta everything works!

Screenshot from 2022-09-06 21-47-36

theofficialgman commented 2 years ago

you can download my release binaries for ARM32 and ARM64 linux from here: https://github.com/Pi-Apps-Coders/files/releases/tag/large-files

everything (including the java downloader) works. Tested on Nintendo Switch, Jetson Orin, and Raspberry Pi