Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

flake: Bump nixpkgs & flake-utils #76

Merged
merged 2 commits into from
Jan 30, 2022

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Jan 17, 2022

Summary & Motivation

Bump nixpkgs to 21.11 since 21.05 is dead. Also, the nixUnstable from 21.05 doesn't seem to build on Darwin.

Further context

see #71
cc @DieracDelta

@Ma27 Ma27 requested a review from aaronjanse January 17, 2022 22:58
@Ma27
Copy link
Member Author

Ma27 commented Jan 17, 2022

Also pushed a temp fix for #75, while I'm not too happy about it, there isn't much else we can do about it to unblock folks on macos since it appears to be a NixOS bug.

cc @lilyball @DieracDelta (would be awesome if you could test this on Darwin for me :))

@DieracDelta
Copy link

DieracDelta commented Jan 17, 2022

I tested this in two ways on rev 01b3623 on my m1. This is the commit with the gc test enabled for aarch64-darwin. I believe the GC problem I was encountering got fixed shortly after I opened #71 (see Eelco's PR ). I hope this means we can keep the gc test. What I tested on:
(1) I checked out the repo, nix built the default package for aarch64-darwin. This built fine on nix 2.5.1.
(2) I added this rev to my neovim config and checked that I was getting syntax errors on nix files. Seems to be working.

@lilyball
Copy link

The disabled test isn't related to GC, it's a test that fails when Nix is configured to enable the sandbox when calling nix --version from within the sandboxed build environment.

Another option is to set sandboxProfile on the derivation to allow access to the things that nix is improperly breaking on (or to just disable the sandbox in general if you don't want to try and punch small holes in it). This means the derivation will fail to build if sandbox=true on macOS but it will succeed if sandbox=relaxed or if the sandbox is disabled (which is the default). You can see an example of relaxing the sandbox in macvim. This change would have to be done to the derivation in nixpkgs too of course.

I suppose a third option is to make the test explicitly check if nix --version even executes successfully, and if it fails then just skip the test (i.e. return without running the test as there's no way of dynamically marking a test as skipped). Or use a build.rs script that checks for this and sets a --cfg flag that controls whether the test is ignored. But that seems overly complicated.

@lilyball
Copy link

I successfully built rnix-lsp on my M1 machine with the nixpkgs input overridden to my pinned recent version of nixpkgs/nixpkgs-unstable (and with sandbox=relaxed). I realize that this overrides one of the changes in this PR, but that does test how I would consume this flake if I switch my local setup from nixpkgs's derivation to the flake (which is tempting but means I'd have to build from source instead of using the nixpkgs binary cache).

I am not set up right now to easily actually test the language server itself (I haven't configured vim for that yet, and I didn't want to change my VSCode user config), but the build is the important part.

@lilyball
Copy link

I just did the same on my x86_64-darwin machine for good measure.

@Ma27
Copy link
Member Author

Ma27 commented Jan 30, 2022

Another option is to set sandboxProfile on the derivation to allow access to the things that nix is improperly breaking on (or to just disable the sandbox in general if you don't want to try and punch small holes in it). This means the derivation will fail to build if sandbox=true on macOS but it will succeed if sandbox=relaxed or if the sandbox is disabled (which is the default). You can see an example of relaxing the sandbox in macvim. This change would have to be done to the derivation in nixpkgs too of course.

I'm not very keen on maintaining workarounds (at several places) for a Nix bug tbh. In the end this isn't a system/architecture-specific feature, so as long as it doesn't break everywhere we should be fine IMHO.

That said I'd merge this and publish a new release to fix the issue on our end at least.

@Ma27 Ma27 merged commit 2a21f16 into nix-community:master Jan 30, 2022
@Ma27 Ma27 deleted the flake-input-updates branch January 30, 2022 23:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants