Hello,
I’m trying to package the grafbase.com tools (a GraphQL federation gateway) to be able to try it.
I encounter a compilation error on the vendor dependency. I don’t know how to fix:
--> /nix/var/nix/builds/nix-2155-4037846201/grafbase-gateway-0.53.3-vendor/source-registry-0/rsasl-2.2.0/src/context.rs:121:16
|
120 | pub fn build_context<'a, 'b>(provider: &'a (dyn Provider<'b> + 'a)) -> &'a Context<'b> {
| -- lifetime `'a` defined here
121 | unsafe { &*(provider as *const dyn Provider as *const Context) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'a` must outlive `'static`
|
note: raw pointer casts of trait objects cannot extend lifetimes
--> /nix/var/nix/builds/nix-2155-4037846201/grafbase-gateway-0.53.3-vendor/source-registry-0/rsasl-2.2.0/src/context.rs:121:16
|
121 | unsafe { &*(provider as *const dyn Provider as *const Context) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this was previously accepted by the compiler but was changed recently
= help: see <https://github.com/rust-lang/rust/issues/141402> for more information
error: could not compile `rsasl` (lib) due to 1 previous error
Here is the nix expression I use (I follow the nixpkgs-unstable branch) :
{
fetchFromGitHub,
rustPlatform,
}:
rustPlatform.buildRustPackage rec {
pname = "grafbase-gateway";
version = "0.53.3";
src = fetchFromGitHub {
owner = "grafbase";
repo = "grafbase";
rev = "gateway-${version}";
sha256 = "sha256-ajqkyE7VM2utRARTw2P6jjqRG1sTMvCN8Mv40iWGMyY=";
};
preBuild = ''
pwd
ls -la
cargo --version
rustc --version
'';
cargoArgs = [
"--package"
"gateway"
];
cargoHash = "sha256-ZIR1N7Rg51aijLQDW3BX6d2NtowqssysJJAAFRwKQv4=";
}
If someone has a hint, I’d be happy