1
0
Fork 0
mirror of https://github.com/NixOS/ofborg synced 2024-10-18 14:56:36 -04:00
Commit graph

1465 commits

Author SHA1 Message Date
abysssol 5a4e743f19 rewrite Display::fmt() to prevent many allocations 2024-08-08 11:55:03 -07:00
abysssol 29bae01c22 replace String::from_utf8() with std::str::from_utf8()
allocation should be avoided when possible since it's relatively slow
2024-08-08 11:55:03 -07:00
abysssol f362b08678 move to_lowercase() to relevant format! argument 2024-08-08 11:55:03 -07:00
abysssol 368c2a083b rename variables 2024-08-08 11:55:03 -07:00
abysssol c832d88698 inline format symbols 2024-08-08 11:55:03 -07:00
abysssol b9a19c0e86 replace mixed quotes using backtick and singlequote with just backticks
Why was this used in the first place? Does anyone depend on this particular format?
2024-08-08 11:55:03 -07:00
abysssol 7ad28dac41 update edition to "2021" 2024-08-08 11:55:03 -07:00
abysssol 54cccade52 remove write(true) from OpenOptions builder
`append(true)` implies `write(true)`
2024-08-08 11:55:03 -07:00
abysssol 610453d531 replace comparison to None with call to is_none() 2024-08-08 11:55:03 -07:00
abysssol 8c5bf51e17 remove call to into_iter() on ranges
all ranges are already iterators
2024-08-08 11:55:03 -07:00
abysssol da1aa4a890 combine str::replace() calls together 2024-08-08 11:55:03 -07:00
abysssol 48ec78cf39 simplify explicit default value 2024-08-08 11:55:03 -07:00
abysssol 8f1c3b4490 simplify iteration on map keys
replace `Vec<String>` with `Vec<&str>` to reduce allocation
2024-08-08 11:55:03 -07:00
abysssol f67e8c4d8b merge trait bound from where clause with inline bound 2024-08-08 11:55:03 -07:00
abysssol cf2790bdc6 replace assert_eq!(true, x) with assert!(x) 2024-08-08 11:55:03 -07:00
abysssol 0fc4d05b06 remove unnecessary argument references in calls 2024-08-08 11:55:03 -07:00
abysssol fb3d581ce4 remove useless parameter dereferences in closures 2024-08-08 11:55:03 -07:00
abysssol 50a89a8fe7 switch from filter_map() to map_while()
It's possible for a call to `File::open()` to succeed even if reading from
that `File` isn't actually possible due to the `File` being a directory.
In such cases, `Lines` can return `Err` infinitely,
causing `filter_map()` to diverge while searching for a nonexistant `Ok`.

This is a semantic change.
`filter_map()` can filter multiple errors before returning lines again,
while `map_while()` will stop iterating entirely at the first `Err`.

However, errors are unlikely at all since the `file` argument is currently
always a preallocated temporary file for collecting `Command` output.
This merely mitigates the worst case if `lines_from_file()` is ever used
in a way where this error could occur.
2024-08-08 11:55:03 -07:00
abysssol 973b6c4293 fix incorrect test that fails to compare lists
A test tries to compare equality of `Vec`s, approximately `x.sort() == y.sort()`,
but `sort()` uses in-place mutation, and returns `unit`, not the input `slice`,
so the lists are never actually compared.
2024-08-08 11:55:03 -07:00
Cole Helbling 1d74f577a1 php: update svanderburg/composer2nix and php-amqplib/php-amqplib 2024-05-19 16:41:18 -07:00
Cole Helbling 0cd3543bc1 fixup: flake-compat 2024-05-19 16:41:18 -07:00
Cole Helbling 5d4d9c3904 Drop unused installation_id parameter
We auto-discover the correct installation ID absed on the repostory
context.
2024-05-19 16:41:18 -07:00
Cole Helbling 2aeca1fb72 Get GitHub token from file instead of static string 2024-05-19 16:41:18 -07:00
Cole Helbling aa70c3db6e Get rabbitmq password from file instead of static string 2024-05-19 16:41:18 -07:00
Cole Helbling 9254a448b7 Use rustls instead of openssl 2024-05-19 16:41:18 -07:00
Cole Helbling 8ba47c1e06 factoids.toml: remove
As far as I can tell, this hasn't been used anywhere in years.
2024-05-19 16:40:16 -07:00
Harsh Shandilya 3fd6b66cd3 README: remove stale advice about cargo2nix 2024-03-29 07:46:43 -07:00
Cole Helbling eb120ff74c build: send Ack if HEAD failed to fetch
Nothing we can do.
2024-02-01 20:14:09 -08:00
Cole Helbling f6159fbdd2 clone: also cleanup checkout with git gc 2024-02-01 20:14:09 -08:00
Cole Helbling bd6b7f8846 Support multiple evaluators on a single machine 2024-02-01 20:14:09 -08:00
Sergei Trofimovich 7db074df7b ofborg/src/maintainers.nix: look up files pointed by "pos" attribute
Sometimes most of attributes for a package are defined outside the file
that defines it. Examples are `openjdk` and `nix`.

At least `openjdk` defined `pos` attribute to guide `nix edit` to open
the right file. Let's extend `ofborg` to do the same.

Before the change (with `pos` applied to `nix_2_3`):

    $ printf '[["nix_2_3"]]' > attrs.json; \
      printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
      nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
    { }

After the change:

    $ printf '[["nix_2_3"]]' > attrs.json; \
      printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
      nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
    { flokli = <CODE>; raitobezarius = <CODE>; }
2024-01-16 10:19:23 -08:00
Cole Helbling de415d3729 eval/nixpkgs: add note about why the extra curly braces are necessary 2023-09-15 11:19:19 -07:00
Ryan Hendrickson e043e3d9dd Update README.md
Co-authored-by: Artturi <Artturin@artturin.com>
2023-09-15 11:19:19 -07:00
Ryan Hendrickson 7101ab45ba eval/nixpkgs: parse Bash-braces in commits
Add support for expanding the Bash-like brace syntax.
2023-09-15 11:19:19 -07:00
Lily Foster 653829c95e clone: more forcefully clean clones of untracked files and empty dirs 2023-09-14 23:05:17 +02:00
Lily Foster cda5aa2ac7 eval/nixpkgs: eval package list once with aliases 2023-06-16 12:40:06 -07:00
Lily Foster 74f38efa7e eval/nixpkgs,outpaths: disable aliases by default
Co-Authored-By: Artturin <Artturin@artturin.com>
2023-06-16 12:40:06 -07:00
Cole Helbling 0f34038feb Emergency domain migration, nix.ci -> ofborg.org 2023-04-08 09:35:42 -07:00
Cole Helbling e0ccca94f9 log_message_collector: open log handle to ensure log file exists
This fixes the test in the previous commit.
2023-03-28 08:50:16 -07:00
Cole Helbling 64af23ec6c log_message_collector: assert that the log file exists if it has only started
This will fail, because that is currently not the case. However, the
following commit will make the tests pass.
2023-03-28 08:50:16 -07:00
Cole Helbling cf2c6712bd config: convert PEM to DER format on the fly
hubcaps requires a DER formatted key, but their instructions for
converting PEM to DER didn't work for me. So, we rely on rustls-pemfile
to parse the PEM key into DER bytes and hand that to hubcaps.
2023-02-14 12:59:49 -08:00
Naïm Favier 2beea85aed use nixosTests for tests
The current approach runs e.g. `nix-build nixos/release.nix -A tests.installer`,
which is a no-op because `tests.installer` is a set of sets of
derivations (e.g. `tests.installer.simple.x86_64-linux`).

Use `nixosTests` instead, which doesn't have this extra nesting.
2023-01-03 07:42:21 -08:00
Cole Helbling 6d5ad2f34b nix: use extra-experimental-features instead
If we ever set experimental-features in the machines' configs, this
could break things, so let's guard against that.
2022-12-22 11:03:28 -08:00
Cole Helbling bc70305de9 nix: rustfmt 2022-12-22 11:03:28 -08:00
Cole Helbling 686d469dba nix: forbid url literals in Operation::Instantiate as well 2022-12-22 11:03:28 -08:00
Artturin 9194ace589 nix: run all operations with "--option extra-experimental-features 'no-url-literals'" 2022-12-22 11:03:28 -08:00
Artturin 12f7ba6a3d flake: add nixpkgs-for-php
last nixpkgs version that has php74 is 22.05

error: php74 has been dropped due to the lack of maintanence from upstream for future releases

there's hardly any testing possible with php so i won't mess with it
2022-12-22 07:59:08 -08:00
Artturin 0bae3a0259 bump nixpkgs to 22.11 2022-12-22 07:59:08 -08:00
Artturin 0260aa1cea clone: force checkout
cole-h > Somehow, some evaluators have had dirty git checkouts, causing them to continually crash.
2022-12-21 12:18:59 -08:00
Cole Helbling 6daa9f8f94 Enable tokio1 compatibility
Fixes the following issue:

    thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime', /build/cargo-vendor-dir/hyper-0.14.23/src/client/connect/dns.rs:121:24
2022-12-03 13:50:13 -08:00