Closed MajickTek closed 2 years ago
At a first glance, it looks like the build script for paradox-typed-db might be missing this file: https://github.com/Xiphoseer/paradox-typed-db/blob/main/spec.json
Can you check whether that's there and explain how you build the API server?
Hi @Xiphoseer Im simply calling cargo install --git https://github.com/Xiphoseer/lu-res-api-server.git --branch main
so it should be downloading straight from the github repository. Shouldn't be missing any files unless your cargo script is missing something
Hi, so it lookes like I messed up the dependecies between two repos (specifically https://github.com/LUDevNet/ParadoxServer (API Server) and https://github.com/Xiphoseer/paradox-typed-db). There was a dev
branch for the API server that corresponds to the latest version of typed-db, but that latest version was unfortunately also picked up by the one on main
which you tried to use.
I just merged the relevant branches and pushed a new release build, that should work for you. Let me know if the problem persists even with those changes.
Can confirm, this is still happening.
@wertercatt do you have rustfmt
in your PATH? Can you try just running that on it's own (no parameters) to see what happens?
Looking a bit closer, this could come from writing any of 4 files to OUT_DIR (set by cargo when invoking build.rs) or maybe when calling rustfmt
.
If that is missing, can you try rustup component add rustfmt
(if Ubuntu has rustup installed)
yeah it seems like ubuntu doesn't ship rustfmt by defaukt until 22.04. But it should be in the relevant -update
source you can add to apt and I can make it optional in the build.
Yeah, rustfmt wasn't installed. After apt installing it, I got a new error instead.
error[E0309]: the associated type `<Self as TypedRow<'_, '_>>::Table` may not live long enough
--> /home/wertercatt/.cargo/git/checkouts/paradox-typed-db-aba9554673c5c7a8/f9e35a5/src/lib.rs:75:46
|
75 | return Some(Self::new(r, table));
| ^^^^^
|
= help: consider adding an explicit lifetime bound `<Self as TypedRow<'_, '_>>::Table: 'b`...
= note: ...so that the reference type `&<Self as TypedRow<'_, '_>>::Table` does not outlive the data it points at
error[E0309]: the associated type `<R as TypedRow<'_, '_>>::Table` may not live long enough
--> /home/wertercatt/.cargo/git/checkouts/paradox-typed-db-aba9554673c5c7a8/f9e35a5/src/lib.rs:114:49
|
114 | self.inner.next().map(|row| R::new(row, self.table))
| ^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<R as TypedRow<'_, '_>>::Table: 'b`...
= note: ...so that the reference type `&<R as TypedRow<'_, '_>>::Table` does not outlive the data it points at
Compiling hyper v0.14.16
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.
error: could not compile `paradox-typed-db`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `paradox-server v0.1.0 (https://github.com/LUDevNet/ParadoxServer#f85b7a7e)`, intermediate artifacts can be found at `/tmp/cargo-install0maXWn`
Caused by:
build failed
I just moved the issue to the repo that actually contains the broken code. Commit 032830e should solve both problems, i.e. both just printing a warning when rustfmt
isn't found and the lifetime issue. It looks like the compiler is smart enough to derive the correct lifetimes from Rust 1.56.0 onwards (I'm usually on stable), but it doesn't hurt to be just that little bit more explicit to support the older compiler versions like the ones that ship with ubuntu by default.
Closing this because I downloaded Rust 1.54.0, compiled paradox server with it once before the change which reproduced the error and once after the change which worked, so I'm reasonably certain it's actually solved. LMK if there are any issues that remain.
Following the instructions I attempted to install paradox from npm.
I received this after a bunch of successful download messages:
system info: NPM: 6.14.4 cargo: 1.53.0 python (if that matters): 3.8.10
Ill give any more info if necessary.
It could be just a permission issue for some file but im not sure