Skip to content

Commit 86c0fc2

Browse files
authored
Merge branch 'nix-community:main' into main
2 parents af99e7e + cb6515f commit 86c0fc2

13 files changed

+3260
-2501
lines changed

.github/workflows/ci.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
os: [macos-latest, ubuntu-latest]
19+
os:
20+
- macos-13 # Intel
21+
- macos-latest # Apple M1
22+
- ubuntu-latest
2023
build-flags:
2124
- ""
2225
- --override-input nixpkgs github:nixos/nixpkgs/nixpkgs-unstable
@@ -27,10 +30,10 @@ jobs:
2730
ref: staging
2831

2932
- name: Install nix
30-
uses: cachix/install-nix-action@v25
33+
uses: cachix/install-nix-action@V28
3134

3235
- name: Set up cachix
33-
uses: cachix/cachix-action@v14
36+
uses: cachix/cachix-action@v15
3437
with:
3538
name: nix-community
3639
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

.github/workflows/monthly.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
contents: read
2828
steps:
2929
- uses: actions/checkout@v4
30-
- uses: DeterminateSystems/nix-installer-action@v9
31-
- uses: DeterminateSystems/flakehub-push@v3
30+
- uses: DeterminateSystems/nix-installer-action@v14
31+
- uses: DeterminateSystems/flakehub-push@v5
3232
with:
3333
visibility: public
3434
rolling: true

.github/workflows/pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Install nix
17-
uses: cachix/install-nix-action@v25
17+
uses: cachix/install-nix-action@V28
1818
with:
1919
extra_nix_config: access-tokens = github.com=${{ github.token }}
2020

2121
- name: Check formatting
2222
run: nix run nixpkgs#nixpkgs-fmt --inputs-from . -- {,lib/}*.nix --check
2323

2424
- name: Set up cachix
25-
uses: cachix/cachix-action@v14
25+
uses: cachix/cachix-action@v15
2626
with:
2727
name: nix-community
2828

.github/workflows/update.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
ref: staging
1616

1717
- name: Install nix
18-
uses: cachix/install-nix-action@v25
18+
uses: cachix/install-nix-action@V28
1919

2020
- name: Update everything
2121
run: |

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Fenix provides the `minimal`, `default`, and `complete` [profile](https://rust-lang.github.io/rustup/concepts/profiles.html) of rust toolchains, [`latest`](#latest) profile of nightly toolchains, nightly version of [rust analyzer](https://rust-analyzer.github.io) and [its vscode extension](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
44
It aims to be a replacement for [rustup](https://rustup.rs) and the rust overlay provided by [nixpkgs-mozilla](https://github.com/mozilla/nixpkgs-mozilla).
55

6-
Binary cache is available for `x86_64-darwin` and `x86_64-linux` on [cachix](https://nix-community.cachix.org/)
6+
Binary cache is available for `x86_64-darwin`, `aarch64-darwin` and `x86_64-linux` on [cachix](https://nix-community.cachix.org/)
77

88
```sh
99
cachix use nix-community

data/beta.json

+1,146-867
Large diffs are not rendered by default.

data/nightly.json

+903-762
Large diffs are not rendered by default.

data/rust-analyzer-vsix.zip

15.5 KB
Binary file not shown.

data/stable.json

+1,172-853
Large diffs are not rendered by default.

default.nix

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let
2525
mapAttrs' mapNullable nameValuePair optionalString optionals
2626
pathIsRegularFile unique zipAttrsWith;
2727

28-
v = pkgs.rust.toRustTarget pkgs.stdenv.buildPlatform;
28+
v = pkgs.stdenv.buildPlatform.rust.rustcTarget;
2929

3030
combine' = pkgs.callPackage ./lib/combine.nix { };
3131

@@ -173,6 +173,8 @@ nightlyToolchains.${v} // rec {
173173
];
174174
doCheck = false;
175175
CARGO_INCREMENTAL = 0;
176+
# ensure `rust-analyzer` is built in release mode https://github.com/rust-lang/rust-analyzer/blob/8772b865c913afd1510f69649f238b0f31eace3d/crates/rust-analyzer/build.rs#L9
177+
CFG_RELEASE = 1;
176178
RUST_ANALYZER_REV = rust-analyzer-rev;
177179
meta = {
178180
maintainers = with maintainers; [ figsoda ];
@@ -183,7 +185,7 @@ nightlyToolchains.${v} // rec {
183185
rust-analyzer-vscode-extension =
184186
let
185187
setDefault = k: v: ''
186-
.contributes.configuration.properties."rust-analyzer.${k}".default = "${v}"
188+
.contributes.configuration |= map(if .properties."rust-analyzer.${k}" != null then .properties."rust-analyzer.${k}".default = "${v}" end)
187189
'';
188190
in
189191
pkgs.vscode-utils.buildVscodeExtension {
@@ -197,7 +199,6 @@ nightlyToolchains.${v} // rec {
197199
postPatch = ''
198200
jq -e '
199201
${setDefault "server.path" "${rust-analyzer}/bin/rust-analyzer"}
200-
| ${setDefault "updates.channel" "nightly"}
201202
' package.json | sponge package.json
202203
'';
203204
meta.maintainers = with maintainers; [ figsoda ];

flake.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/combine.nix

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, symlinkJoin, stdenv }:
1+
{ lib, symlinkJoin, stdenv, rustc }:
22

33
let
44
inherit (lib) maintainers optionalString platforms;
@@ -35,4 +35,9 @@ symlinkJoin {
3535
maintainers = with maintainers; [ figsoda ];
3636
platforms = platforms.all;
3737
};
38+
passthru = {
39+
targetPlatforms = rustc.targetPlatform or lib.platforms.all;
40+
tier1TargetPlatforms = rustc.tier1TargetPlatforms or lib.platforms.all;
41+
badTargetPlatforms = rustc.badTargetPlatforms or [ ];
42+
};
3843
}

lib/mk-toolchain.nix

+11
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ let
108108
-add_rpath ${toolchain.rustc}/lib $out/bin/rustfmt || true
109109
''}
110110
''}
111+
112+
${optionalString (component == "rust-analyzer-preview") ''
113+
${optionalString stdenv.isLinux ''
114+
patchelf \
115+
--set-rpath ${toolchain.rustc}/lib $out/bin/rust-analyzer || true
116+
''}
117+
${optionalString stdenv.isDarwin ''
118+
install_name_tool \
119+
-add_rpath ${toolchain.rustc}/lib $out/bin/rust-analyzer || true
120+
''}
121+
''}
111122
'';
112123
dontStrip = true;
113124
meta = {

0 commit comments

Comments
 (0)