4JX / L5P-Keyboard-RGB

Cross platform software to control the RGB/lighting of the 4 zone keyboard included in the 2020, 2021, 2022 and 2023 lineup of the Lenovo Legion laptops. Works on Windows and Linux.
GNU General Public License v3.0
308 stars 39 forks source link

Compile issues #124

Closed 4JX closed 11 months ago

4JX commented 1 year ago

I know this has been closed for over a year, but I'm currently having the same issue and I'm running into the same issue and getting the same error regardless of whether I attempt to build via cargo-make or use vcpkg then regular cargo. I doubt this is a glibc issue, at least as far as versioning, because I'm running 2.37 and it still persists

Originally posted by @OrderlyUnicode in https://github.com/4JX/L5P-Keyboard-RGB/issues/17#issuecomment-1656563420

@OrderlyUnicode whats the exact error?

OrderlyUnicode commented 1 year ago

Before I do, a bit of background. I noticed in the output I was going to place that it was complaining about not having clang, so I installed that. It technically changed the output, but the error was more or less the same, but this time, hinting at an issue with a library called yuv, which I already had installed.

Output while running cargo build --release Compiling scrap v0.5.0 (https://github.com/rustdesk/rustdesk?rev=6c15dd6#6c15dd6f) error: could not find native static library `yuv`, perhaps an -L flag is missing? error: could not compile `scrap` (lib) due to previous error
Output while running cargo make build-release Compiling scrap v0.5.0 (https://github.com/rustdesk/rustdesk?rev=6c15dd6#6c15dd6f) error: could not find native static library `yuv`, perhaps an -L flag is missing? error: could not compile `scrap` (lib) due to previous error [cargo-make][1] ERROR - Error while executing command, exit code: 101 [cargo-make][1] WARN - Build Failed. [cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 5 - Error while executing command, exit code: 1 [cargo-make] WARN - Build Failed.
4JX commented 1 year ago

Ah those look a little different, can you try in either the Makefile.toml for cargo make or in the raw procedure to change any instance of VCPKG_INSTALLATION_ROOT to VCPKG_ROOT? Assuming libvpx/libyuv where installed correctly that might be why

OrderlyUnicode commented 1 year ago

Editing the Makefile.toml had no effect. I'm unsure what you mean by changing the instances in the raw proceedure, though.

4JX commented 1 year ago

If compilling it fully manually theres the step

Download and bootstrap VCPKG You'll need to set an environment variable called VCPKG_INSTALLATION_ROOT pointing to the directory where you downloaded and bootstrapped VCPKG.

Where you should change the variable's name and try re-compiling the app.

Just to triple check, you did also run vcpkg update && vcpkg install libvpx libyuv once vcpkg was installed right?

OrderlyUnicode commented 1 year ago

Yes and no. vcpkg update failed with the following error

the update command does not currently support manifest mode. Instead, modify your vcpkg.json and run install.
note: updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure.

I did appear to succeed with just vcpkg install though

If the update is absolutely necessary, I'm unsure how to go about it, as it also suggests running bootstrap-vcpkg, to which I get a command not found error.

4JX commented 1 year ago

Yes and no. vcpkg update failed with the following error

This is expected, you only need the bootstrap step ./vcpkg/bootstrap-vcpkg.sh and vcpkg install... Actually (missread that as meaning for the first time install and not what I sent) that should only happen if you're running the vcpkg command from the keyboard program's repository. You don't really need to update it since you cloned it off a fresh commit but run that command from the vcpkg folder itself.

And then you set VCPKG_ROOT to the folder where you git-cloned and setup vcpkg

I'm using NixOS so I "simulate" a vcpkg install, but the env var should point to something similar this


[infinity@nixos:~/Documents/GitHub/L5P-Keyboard-RGB]$ find $VCPKG_ROOT
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib/libvpx.so
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib/libvpx.a
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib/libvpx.so.8.0
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib/libyuv.so
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib/libvpx.so.8.0.0
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib/libvpx.so.8
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/x64-linux/lib/libyuv.a
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/vcpkg
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/vcpkg/status
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/vcpkg/info
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/vcpkg/info/libyuv_1.0_x64-linux.list
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/vcpkg/info/libvpx_1.0_x64-linux.list
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/installed/vcpkg/updates
/nix/store/hkd63zbc8x7ywmr5svf819s5ndas6l8j-vcpkg-1.0.0/.vcpkg-root
OrderlyUnicode commented 1 year ago

And then you set VCPKG_ROOT to the folder where you git-cloned and setup vcpkg

I actually set it to where my package manager installed it, since I had trouble manually building vcpkg.

OrderlyUnicode commented 1 year ago

I did actually get it to build though by running vcpkg install libvpx libyuv outside the folder where I downloaded the repo.

OrderlyUnicode commented 1 year ago

So before this is closed, I'm going to note that I was able to reproduce the fix with a different branch of the repo by running vcpkg install from a different directory, editing the Makefile.toml file to replace VCPKG_INSTALLATION_ROOT with VCPKG_ROOT, and setting the environment variable VCPKG_ROOT to where my package manager installed it, which happens to be /opt/vcpkg but might be different for distros using different package managers, such as Ubuntu or Fedora.

OrderlyUnicode commented 1 year ago

Sorry, unrelated things made life a bit chaotic, so I wasn't able to say this until now. Since the fix previously mentioned has it building for me, should I close this?

EDIT: Okay, so the "working" status is technically with caveats. It works if I set it using something running Xorg, but on wayland, it throws a dbus error mentioning X11, but I feel like if that's something worth investigating, that it's worth investigating in its own issue. If you'd rather I keep it here, I'll try to collect more information about what's happening and post it here.

4JX commented 1 year ago

No need, keeping this open so that I remember to eventually update the cargo make file / readme build instructions 👍

4JX commented 11 months ago

Closed via https://github.com/4JX/L5P-Keyboard-RGB/commit/21268d36d59c219590c1ee9002950e39a2c85115