| 13 Jul 2022 |
pennae | ah, that sounds like it's just the thing :) | 08:38:03 |
pennae | will give that a shot, tyvm | 08:38:28 |
pennae | yeah, this is much better than what we had before :) | 09:32:26 |
Alyssa Ross | yay :) | 09:32:46 |
pennae | (even if it's still mostly doing some setup and calling python 😅) | 09:32:56 |
| 14 Jul 2022 |
@grahamc:nixos.org | I have a shell that comes from this use of Naersk. When I open a shell, it pre-builds all my dependencies. The naersk docs show just throwing rustc and cargo into a mkShell but that isn't sufficient for the case I show below. Is there a way to ask naersk to stop prebuilding and just use buildPackage for my shell?
naersk-lib.buildPackage {
src = ./.;
nativeBuildInputs = with pkgs; [
clang
cpiotools.defaultPackage.${system}
grub2_efi
jq
nix
pkgsStatic.pkg-config
pkgsStatic.stdenv.cc
qemu
rustfmt
which
vim # xxd
];
buildInputs = with pkgs; [ pkgsStatic.zstd cryptsetupStatic rustPlatform.bindgenHook ];
OVMF_PATH = pkgs.OVMF.fd;
# Configures the target which will be built.
# ref: https://doc.rust-lang.org/cargo/reference/config.html#buildtarget
CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl";
# Enables static compilation.
#
# If the resulting executable is still considered dynamically
# linked by ldd but doesn't have anything actually linked to it,
# don't worry. It's still statically linked. It just has static
# position independent execution enabled.
# ref: https://github.com/rust-lang/rust/issues/79624#issuecomment-737415388
CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static";
# Configures the linker which will be used. cc.targetPrefix is
# sometimes different than the targets used by rust. i.e.: the
# mingw-w64 linker is "x86_64-w64-mingw32-gcc" whereas the rust
# target is "x86_64-pc-windows-gnu".
#
# This is only necessary if rustc doesn't already know the correct linker to use.
#
# ref: https://doc.rust-lang.org/cargo/reference/config.html#targettriplelinker
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER = with pkgs.pkgsStatic.stdenv;
"${cc}/bin/${cc.targetPrefix}gcc";
# link against libc.a
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS = "-lc";
doCheck = true;
};
| 14:40:02 |
jonringer | Not naersk, but I just rustPlatform.buildRustPackage + cargoLock.lockFile example | 21:25:39 |
jonringer | * Not naersk, but I just use rustPlatform.buildRustPackage + cargoLock.lockFile example | 21:26:26 |
| 15 Jul 2022 |
dpc | In reply to @grahamc:nixos.org
I have a shell that comes from this use of Naersk. When I open a shell, it pre-builds all my dependencies. The naersk docs show just throwing rustc and cargo into a mkShell but that isn't sufficient for the case I show below. Is there a way to ask naersk to stop prebuilding and just use buildPackage for my shell?
naersk-lib.buildPackage {
src = ./.;
nativeBuildInputs = with pkgs; [
clang
cpiotools.defaultPackage.${system}
grub2_efi
jq
nix
pkgsStatic.pkg-config
pkgsStatic.stdenv.cc
qemu
rustfmt
which
vim # xxd
];
buildInputs = with pkgs; [ pkgsStatic.zstd cryptsetupStatic rustPlatform.bindgenHook ];
OVMF_PATH = pkgs.OVMF.fd;
# Configures the target which will be built.
# ref: https://doc.rust-lang.org/cargo/reference/config.html#buildtarget
CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl";
# Enables static compilation.
#
# If the resulting executable is still considered dynamically
# linked by ldd but doesn't have anything actually linked to it,
# don't worry. It's still statically linked. It just has static
# position independent execution enabled.
# ref: https://github.com/rust-lang/rust/issues/79624#issuecomment-737415388
CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static";
# Configures the linker which will be used. cc.targetPrefix is
# sometimes different than the targets used by rust. i.e.: the
# mingw-w64 linker is "x86_64-w64-mingw32-gcc" whereas the rust
# target is "x86_64-pc-windows-gnu".
#
# This is only necessary if rustc doesn't already know the correct linker to use.
#
# ref: https://doc.rust-lang.org/cargo/reference/config.html#targettriplelinker
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER = with pkgs.pkgsStatic.stdenv;
"${cc}/bin/${cc.targetPrefix}gcc";
# link against libc.a
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS = "-lc";
doCheck = true;
};
I don't understand what's 'isn't sufficient for the case I show below' | 18:56:27 |
@grahamc:nixos.org | I wanted to do this, but had trouble making it cross-compile to musl | 18:57:00 |
dpc | Do you want the binary that you're building with naersk in your shell ... ? | 18:59:16 |
dpc | I should finally try musl target with crane. I couldn't get it working with naersk as well, though I did not try really hard. | 19:01:36 |
| 16 Jul 2022 |
denommus | How to have a checkPhase in cargo2nix? | 17:45:01 |
| 19 Jul 2022 |
| Icewind joined the room. | 12:44:51 |
| 20 Jul 2022 |
| Ben Frank joined the room. | 20:58:51 |
| 23 Jul 2022 |
| didiercrunch joined the room. | 22:14:32 |
| 26 Jul 2022 |
| ctem joined the room. | 11:32:40 |
| underpantsgnome! changed their display name from tinybronca to tailrec. | 14:48:56 |
| underpantsgnome! changed their display name from tailrec to tinybronca. | 15:38:18 |
| 28 Jul 2022 |
| Izdihar joined the room. | 01:29:20 |
Izdihar | hello, does anyone know how to use nixos+codelldb + rust? | 01:30:10 |
Izdihar | * hello, does anyone know how to use nixos+codelldb+rust? | 01:30:13 |
| 29 Jul 2022 |
dpc | Where's the problem? | 03:35:11 |
Izdihar | In reply to @dpc:matrix.org Where's the problem? my problem is about how to do it at all. I've followed non-nixos way to do it to no avail. | 05:32:05 |
kayla (she/they) | In reply to@tengkuizdihar:matrix.org my problem is about how to do it at all. I've followed non-nixos way to do it to no avail. in what way is it not working? what have you done so far?
Does it show up? is the extension installed in vscode already? is the extension erroring? | 17:12:12 |
| 1 Aug 2022 |
| better_sleeping joined the room. | 09:02:43 |
| better_sleeping left the room. | 09:03:16 |
| jhillyerd joined the room. | 22:38:09 |
| 3 Aug 2022 |
Alyssa Ross | hey, it's been a while since I needed a beta/nightly Rust compiler. Is oxalica's Rust overlay still the thing to use? | 18:04:09 |
a-kenji | In reply to @qyliss:fairydust.space hey, it's been a while since I needed a beta/nightly Rust compiler. Is oxalica's Rust overlay still the thing to use? For me, yes. | 18:04:36 |