!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

709 Members
Rust162 Servers

Load older messages


SenderMessageTime
20 Sep 2022
@linus:schreibt.jetztLinux HackermanI suspect we can't use it in nixpkgs, but again I don't know anything about it so 🤷12:58:07
@tengkuizdihar:matrix.orgIzdihar
In reply to @linus:schreibt.jetzt
I suspect we can't use it in nixpkgs, but again I don't know anything about it so 🤷
searched it in nixpkgs, no crane 👌
12:58:32
@tengkuizdihar:matrix.orgIzdihar someone literally just jumps in and said try this and I'm trying it. If it's working, what a chad. 13:03:32
@pareto-optimal-dev:matrix.orgpareto-optimal-dev joined the room.13:43:22
@tengkuizdihar:matrix.orgIzdihar Linux Hackerman: does it need to be in nativebuildinputs or can I also put it in buildInputs? I've accidentally done that and the issue persists... 14:13:12
@linus:schreibt.jetztLinux HackermanNot 100% sure but I do think it's supposed to be in nativeBuildInputs14:13:34
@gianarb:matrix.orgGianluca Arbezzano left the room.14:22:18
@gianarb:matrix.orgGianluca Arbezzano joined the room.14:22:46
@tengkuizdihar:matrix.orgIzdihar yep still the same error in nativeBuildInputs lmao Linux Hackerman 14:34:18
@linus:schreibt.jetztLinux Hackerman Izdihar: ah, I think you also need gsettings-desktop-schemas in buildInputs 14:36:40
@tengkuizdihar:matrix.orgIzdihar
In reply to @linus:schreibt.jetzt
Izdihar: ah, I think you also need gsettings-desktop-schemas in buildInputs
alright, its building time
14:37:17
@tengkuizdihar:matrix.orgIzdiharstill doesn't work lmaoo14:55:21
@tengkuizdihar:matrix.orgIzdiharI might need to follow this https://github.com/NixOS/nixpkgs/blob/95af2245a32f8e1310ad4e3bf50b76d86ddbbc0a/doc/languages-frameworks/gnome.section.md#frequently-encountered-issues-ssec-gnome-common-issues14:57:58
@gianarb:matrix.orgGianluca Arbezzano

Hello! I think I have a basic question. First time trying to package a Rust project

        alexandria = naersk'.buildPackage {
          src = builtins.fetchGit {
            url = ssh://git@github.com/.../...;
            ref = "HEAD";
            rev = "asdas";
          };
          patches = [
            ./001-remove-buildinfo.patch
          ];
          gitAllRefs = true;
        };

The build fails applying the patch with:

can't find file to patch at input line 14                                                                                       
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

I looked at the derivation logs via nix logs and I checked the source archive directory but the files in there looks totally different compared with the one I have as part of the repository. Not sure why and as consequence the patch fails because it can't find all the files it should have

15:31:09
@gianarb:matrix.orgGianluca Arbezzano *

Hello! I think I have a basic question. First time trying to package a Rust project

        rust-test = naersk'.buildPackage {
          src = builtins.fetchGit {
            url = ssh://git@github.com/.../...;
            ref = "HEAD";
            rev = "asdas";
          };
          patches = [
            ./001-remove-buildinfo.patch
          ];
          gitAllRefs = true;
        };

The build fails applying the patch with:

can't find file to patch at input line 14                                                                                       
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

I looked at the derivation logs via nix logs and I checked the source archive directory but the files in there looks totally different compared with the one I have as part of the repository. Not sure why and as consequence the patch fails because it can't find all the files it should have

15:31:17
21 Sep 2022
@tengkuizdihar:matrix.orgIzdihar It's working now! No more errors! The worst part about it is that I need to probably wait for the next version of the package to get some of the fixes that's included in my patch... https://github.com/NixOS/nixpkgs/issues/189571#issuecomment-1253102758 Linux Hackerman 02:36:05
@tengkuizdihar:matrix.orgIzdihar
In reply to @tengkuizdihar:matrix.org
It's working now! No more errors! The worst part about it is that I need to probably wait for the next version of the package to get some of the fixes that's included in my patch... https://github.com/NixOS/nixpkgs/issues/189571#issuecomment-1253102758 Linux Hackerman
or not, I guess now I just need to wait for a PR review
12:32:23
22 Sep 2022
@Ericson2314:matrix.orgJohn Ericson joined the room.15:36:50
@dpc:matrix.orgdpcHow do I configure a piece of code to run in my (crane-base) derivation?21:34:45
@dpc:matrix.orgdpcAPI docs mentiones Phases and hooks: https://github.com/ipetkov/crane/blob/master/docs/API.md#optional-attributes-1021:35:14
@dpc:matrix.orgdpc But I can't figure out what exactly am I supposed to set to get something to run? I just need to chmod +x some files that were copied into the derivation. 21:35:46
@ngerstle:matrix.org@ngerstle:matrix.org joined the room.22:00:17
23 Sep 2022
@tengkuizdihar:matrix.orgIzdihar
In reply to @dpc:matrix.org
But I can't figure out what exactly am I supposed to set to get something to run? I just need to chmod +x some files that were copied into the derivation.
what do you want to run in those phases? Like a custom bash command?
01:24:46
@tengkuizdihar:matrix.orgIzdiharIf so, then which phase you're choosing will depend entirely on what you want to do. This is the order of the phases is explained here preBuild01:28:08
@tengkuizdihar:matrix.orgIzdihar * If so, then which phase you're choosing will depend entirely on what you want to do. This is the order of the phases is explained here https://nixos.org/manual/nixpkgs/stable/#sec-stdenv-phases01:28:19
@nbp:mozilla.orgnbp changed their display name from nbp to nbp (PTO until Oct 1st).17:55:19
@nbp:mozilla.orgnbp changed their display name from nbp (PTO until Oct 1st) to nbp.17:55:48
25 Sep 2022
@andreasfelix:matrix.orgFelix Andreas joined the room.22:17:07
27 Sep 2022
@x10an14:matrix.orgx10an14

Anyone know of a cross-compilation example that targets musl and uses rust-overlay?

I can't for the life of me figure this out. I've spent the past couple of hours trying to search and read up on it, but I feel like there's some crucial tidbits of ignorance that keep me in the dark.
All the rust docs refer to leveraging rustup, which AFAIU is kinda antheisis to the premise of Nix.

I'm finding the learning curve a bit too steep for me =/

I've attempted:

  • rust-toolchain.toml; ```toml
    [toolchain]
    targets = ["x86_64-unknown-linux-musl", "x86_64-unknown-linux-gnu"]
    `flake.nix`: ```nix
      overlays = [
        (import rust-overlay)
        (self: super: {
          rustToolchain =
            let
              rust = super.rust-bin;
            in
            if builtins.pathExists ./rust-toolchain.toml then
              rust.fromRustupToolchainFile ./rust-toolchain.toml
            else if builtins.pathExists ./rust-toolchain then
              rust.fromRustupToolchainFile ./rust-toolchain
            else
              rust.stable.latest.default;
        })
      ]
    
    And finally; cargo build --target 'x86_64-unknown-linux-musl'
18:24:57
@x10an14:matrix.orgx10an14 *

Anyone know of a cross-compilation example that targets musl and uses rust-overlay?

I can't for the life of me figure this out. I've spent the past couple of hours trying to search and read up on it, but I feel like there's some crucial tidbits of ignorance that keep me in the dark.
All the rust docs refer to leveraging rustup, which AFAIU is kinda antheisis to the premise of Nix.

I'm finding the learning curve a bit too steep for me =/

I've attempted:

  • rust-toolchain.toml;

    [toolchain]
    targets = ["x86\_64-unknown-linux-musl", "x86\_64-unknown-linux-gnu"]
    
    

    flake.nix:

      overlays = [
        (import rust-overlay)
        (self: super: {
          rustToolchain =
            let
              rust = super.rust-bin;
            in
            if builtins.pathExists ./rust-toolchain.toml then
              rust.fromRustupToolchainFile ./rust-toolchain.toml
            else if builtins.pathExists ./rust-toolchain then
              rust.fromRustupToolchainFile ./rust-toolchain
            else
              rust.stable.latest.default;
        })
      ]
    

    And finally; cargo build --target 'x86_64-unknown-linux-musl'

18:27:11

Show newer messages


Back to Room ListRoom Version: 6