!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

712 Members
Rust163 Servers

Load older messages


SenderMessageTime
9 May 2022
@dpc:matrix.orgdpc joined the room.00:31:20
@kayla.fire:matrix.orgkayla (she/they) joined the room.10:57:28
@niklaskorz:matrix.orgniklaskorz joined the room.12:18:00
@tyberius_prime:matrix.orgTyberiusPrime (fiber at home when) joined the room.14:50:40
@stopbystudent:matrix.orgstopbystudent joined the room.15:18:30
10 May 2022
@dpc:matrix.orgdpc

Help. I'm trying to port my fenix toolschain setup to crane and:

      fenix-pkgs = fenix.packages.${system};
      fenix-channel = fenix-pkgs.stable;

      craneLib = (crane.mkLib pkgs).overrideScope' (final: prev: {
        # inherit (fenix-channel) cargo rustc;
      });

I can't uncomment that line because it breaks everything. AFAICT, that's what I was more or less doing in naersk

05:05:55
@dpc:matrix.orgdpc

Hmm...

Found something that works.

      fenix-pkgs = fenix.packages.${system};
      fenix-channel = (fenix-pkgs.stable);

      craneLib = (crane.mkLib pkgs).overrideScope' (final: prev: {
        cargo = fenix-channel.cargo;
        rustc = fenix-channel.rustc;
      });

Is this the right way then?

05:19:13
@dpc:matrix.orgdpc
In reply to @js:ukvly.org

or for me on nixos 21.11:

error: /nix/store/qjgj2642srlbr59wwdihnn66sw97ming-glibc-2.33-123/lib/libpthread.so.0: undefined symbol: __libc_siglongjmp, version GLIBC_PRIVATE
   --> /home/julian/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:284:9
    |
284 | pub use proc_macro_error_attr::proc_macro_error;
    |         ^^^^^^^^^^^^^^^^^^^^^
I am hitting this problem all the time myself. The reason is that normal cargo/rustup are impure. The only reliable solution I've found is to use nix flakes + lorri for everything on NixOs.
05:29:41
@a-kenji:matrix.orga-kenji
In reply to @dpc:matrix.org
I am hitting this problem all the time myself. The reason is that normal cargo/rustup are impure. The only reliable solution I've found is to use nix flakes + lorri for everything on NixOs.
Why is lorri important here?
05:51:11
@dpc:matrix.orgdpc a-kenji: It's just making the an experience so smooth that it's close to just using system-wide rustup/cargo 06:12:57
@dpc:matrix.orgdpc You cd into your project and everything gets set up as it should be, and you can open your editor, run cargo build etc. and things just work 06:13:37
@a-kenji:matrix.orga-kenji Ah, yeah. I think I didn't understand you correctly there. I thought you meant that lorri is important for cargo/rustup. 06:17:20
@a-kenji:matrix.orga-kenjiLorri is a pretty nice project, I agree!06:17:49
@slby:matrix.orgslby

Does anyone have examples how to deal with a build.rs script like this?:
https://github.com/raduzaharia-medium/gtk-rss-reader-resource/blob/main/build.rs

fn main() {
    compile_resources(
        "content",
        "content/app.gresource.xml",
        "gtk-rss-reader.gresource",
    );
}
12:34:02
11 May 2022
@dpc:matrix.orgdpc In a nixifified project using flakes, do you check-in the .envrc file into git, or is every contributor expected to create it if they use something like lorri? 15:47:56
@kamadorueda:matrix.orgkamadoruedaI check-in the .envrc normally15:49:42
@a-kenji:matrix.orga-kenjiThis is something I am not sure about, I have checked it in until now too.15:49:57
@vika:fireburn.ruVika (she/her)
In reply to @dpc:matrix.org
In a nixifified project using flakes, do you check-in the .envrc file into git, or is every contributor expected to create it if they use something like lorri?
I check my .envrc into git personally
21:38:39
@vika:fireburn.ruVika (she/her)That way a single direnv allow on a nix-enabled machine gets me my environment anywhere21:38:58
@dpc:matrix.orgdpcSo far I have been checking it in, but I wonder if it is ever undesireable or something.21:44:51
@a-kenji:matrix.orga-kenji The reason, I am not sure is: Maybe other people want to use it differently. 21:54:02
@a-kenji:matrix.orga-kenji I usually am just adding use_flake, but other people might want a different .envrc. 21:54:58
12 May 2022
@vika:fireburn.ruVika (she/her)
In reply to @a-kenji:matrix.org
I usually am just adding use_flake, but other people might want a different .envrc.
Why wouldn't you use a Nix-based environment if you have nix installed? I made my .envrc a no-op on systems that don't have nix in PATH, but for people who have it, they gonna get the same environment I use everywhere (if they choose to allow the .envrc to run)
05:50:01
@vika:fireburn.ruVika (she/her)This is a sensible thing to do if you already have Nix on your machine05:50:33
@vika:fireburn.ruVika (she/her)...with one caveat that flakes aren't gonna be enabled, but I think it might produce a somewhat helpful message if they aren't by means of nix rambling about experimental-optiona05:52:37
@vika:fireburn.ruVika (she/her)* ...with one caveat that flakes aren't gonna be enabled, but I think it might produce a somewhat helpful message if they aren't by means of nix rambling about experimental-options05:52:43
@a-kenji:matrix.orga-kenji
In reply to @vika:fireburn.ru
Why wouldn't you use a Nix-based environment if you have nix installed? I made my .envrc a no-op on systems that don't have nix in PATH, but for people who have it, they gonna get the same environment I use everywhere (if they choose to allow the .envrc to run)
Some people don't have flakes enabled, some might use a different invocation - with lorri / sorri / have their own nix-shell caching. This probably won't happen to many people, but every now and then I think about how this can be made a little bit more universal.
08:29:17
@vika:fireburn.ruVika (she/her)
In reply to @a-kenji:matrix.org
Some people don't have flakes enabled, some might use a different invocation - with lorri / sorri / have their own nix-shell caching. This probably won't happen to many people, but every now and then I think about how this can be made a little bit more universal.
One could build detection for common workflows like lorri/sorri too. Having flakes disabled is also a valid concern, but once again, this could be potentially detected and handled
08:30:38
@vika:fireburn.ruVika (she/her)flake-compat is a thing thankfully08:31:04
@a-kenji:matrix.orga-kenji
In reply to @vika:fireburn.ru
One could build detection for common workflows like lorri/sorri too. Having flakes disabled is also a valid concern, but once again, this could be potentially detected and handled
Yeah I need to look more into how to make it compatible with different use cases.
13:18:56

Show newer messages


Back to Room ListRoom Version: 6