Skip to content

Commit

Permalink
Update flake lock + fix consequences
Browse files Browse the repository at this point in the history
After a flake lock update, some errors needed fixes:

- Updated Topiary input and formatted Nickel files
- Merging manual: remove line number-dependent part of the error
- Upgrade markdownlint config file to schema change
- Fix flake.nix
  • Loading branch information
yannham committed May 17, 2024
1 parent e8ea946 commit 3b2250e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"tables": false
},
"MD024": {
"allow_different_nesting": true
"siblings_only": true
}
}
3 changes: 2 additions & 1 deletion core/benches/arrays/fold.ncl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let letter | Number -> std.string.Character = fun n =>
let letter | Number -> std.string.Character
= fun n =>
let letters = std.string.characters "abcdefghijklmnopqrstuvwxyz" in
std.array.at (n % 26) letters
in
Expand Down
3 changes: 2 additions & 1 deletion core/benches/arrays/generate.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ let g = fun n => n * 2 + 5 in
run = fun n => generate n g,
},
checked = {
generate_with_contract | forall a. Number -> (Number -> a) -> Array a = fun n g =>
generate_with_contract | forall a. Number -> (Number -> a) -> Array a
= fun n g =>
if n == 0 then
[]
else
Expand Down
3 changes: 1 addition & 2 deletions core/stdlib/std.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,7 @@
|> blame,

# Outside of lazy data structures, we just use (==)
_ =>
fun ctr_label value =>
_ => fun ctr_label value =>
value
|> check_typeof_eq ctr_label
|> from_predicate ((==) constant) ctr_label,
Expand Down
6 changes: 1 addition & 5 deletions doc/manual/merging.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ argument), we do get a contract violation error:
{ foo | FooContract }
& { foo.required_field1 = "here" }
in
intermediate
& { foo.required_field2 = "here" }
|> std.deep_seq intermediate
Expand All @@ -624,10 +623,7 @@ error: missing definition for `required_field2`
8 │ & { foo.required_field1 = "here" }
│ ------------------------ in this record
┌─ <stdlib/std.ncl>:3255:18
3255 │ = fun x y => %deep_seq% x y,
│ ------------ accessed here
[...]
```

#### Example
Expand Down
6 changes: 4 additions & 2 deletions examples/arrays/arrays.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
# Example array functions. This code is illustrative: prefer using the array
# stdlib functions `std.array.map` and `std.array.fold_right` instead.
let my_array_lib = {
map : forall a b. (a -> b) -> Array a -> Array b = fun f arr =>
map : forall a b. (a -> b) -> Array a -> Array b
= fun f arr =>
if arr == [] then
[]
else
let head = std.array.first arr in
let tail = std.array.drop_first arr in
[f head] @ map f tail,

fold : forall a b. (a -> b -> b) -> b -> Array a -> b = fun f first arr =>
fold : forall a b. (a -> b -> b) -> b -> Array a -> b
= fun f first arr =>
if arr == [] then
first
else
Expand Down
15 changes: 6 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
Expand Down Expand Up @@ -154,6 +153,7 @@

markdownlint = {
enable = true;
# settings.configuration = builtins.fromJSON (builtins.readFile ./.markdownlint.json);
excludes = [
"notes/(.+)\\.md$"
"^RELEASES\\.md$"
Expand Down Expand Up @@ -394,13 +394,11 @@
inherit env;
CARGO_BUILD_TARGET = pkgs.rust.toRustTarget pkgs.pkgsMusl.stdenv.hostPlatform;
# For some reason, the rust build doesn't pick up the paths
# to `libcxx` and `libcxxabi` from the stdenv. So we specify
# them explicitly. Also, `libcxx` expects to be linked with
# `libcxxabi` at the end, and we need to make the rust linker
# aware of that.
# to `libcxx`. So we specify them explicitly.
#
# We also explicitly add `libc` because of https://github.com/rust-lang/rust/issues/89626.
RUSTFLAGS = "-L${pkgs.pkgsMusl.llvmPackages.libcxx}/lib -L${pkgs.pkgsMusl.llvmPackages.libcxxabi}/lib -lstatic=c++abi -C link-arg=-lc";
# We also explicitly add `libc` because of
# https://github.com/rust-lang/rust/issues/89626.
RUSTFLAGS = "-L${pkgs.pkgsMusl.llvmPackages.libcxx}/lib -lstatic=c++abi -C link-arg=-lc";
# Explain to `cc-rs` that it should use the `libcxx` C++
# standard library, and a static version of it, when building
# C++ libraries. The `cc-rs` crate is typically used in
Expand Down

0 comments on commit 3b2250e

Please sign in to comment.