Skip to content

lib/tests/triples.nix: add test suite and fix our parser so it passes#235230

Closed
ghost wants to merge 33 commits intostagingfrom
unknown repository
Closed

lib/tests/triples.nix: add test suite and fix our parser so it passes#235230
ghost wants to merge 33 commits intostagingfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented May 31, 2023

As promised; sorry it took so long. Probably best reviewed one commit at a time.

Closes #165836

Closes #230160

Description of changes

This PR adds lib/tests/triples.nix, which exhaustively tests that our platform triple parse-then-unparse roundtrip agrees with gnu-config for all inputs that it accepts (it may -- and does -- reject triples which gnu-config accepts).

This PR also includes the commits needed in order to get the test suite to pass.

There are only two major exceptions in nixpkgs to agreement with gnu-config -- these are triples which we accept but gnu-config rejects:

  1. vc4-elf (for vc4-{gcc,binutils}, reverse engineered fork for broadcom's gpu)
  2. javascript-unknown-ghcjs (for ghc) fixed upstream 6c78704d542cebfb56d17474fe9f8395e9defb94

There is one minor exception: we canonicalize ""-linux to unknown-linux rather than pc-linux as gnu-config does in some cases.

Things done

CC: @sternenseemann @alyssais @Ericson2314

@ghost ghost changed the title lib/tests/systems.nix: add tests to verify agreement with gnu-config lib/tests/triples.nix: add gnu-config conformance test suite Jun 19, 2023
@ghost ghost marked this pull request as ready for review June 19, 2023 07:18
@ghost ghost mentioned this pull request Jun 19, 2023
16 tasks
@ofborg ofborg bot added 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 19, 2023
@ghost ghost mentioned this pull request Jun 20, 2023
12 tasks
@ghost ghost requested review from figsoda, winterqt and zowoq as code owners June 20, 2023 06:20
@github-actions github-actions bot added the 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. label Jun 20, 2023
@ghost ghost requested a review from sternenseemann June 20, 2023 23:59
@ofborg ofborg bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. label Jun 21, 2023
@ofborg ofborg bot requested a review from lovesegfault June 21, 2023 00:21
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. labels Jun 21, 2023
Adam Joseph added 22 commits December 1, 2023 13:43
gnu-config doesn't include this.
This commit fixes the logic for handling missing/unknown vendor
fields in triples, and extends it to handle mmix and microblaze
CPU-types.
This commit adds lib/tests/triples.nix, which exhaustively tests
that our platform triple parse-then-unparse round-trip agrees with
gnu-config for all inputs that it accepts (it may -- and does --
reject triples which `gnu-config` accepts).
With this commit, we now parse or reject the following identically
to gnu-config:

- aarch64-solo5-none (accept)
- aarch64-solo5-none-elf (reject)

Closes #165836.
This commit adds support for triples with a missing kernel, rather
than kernel="none".  It also adds a parser case for triples which
have a vendor and abi, but no kernel.

This allows to parse "*-unknown-elf" triples.

Closes #230160.
…g now understands it)

gnu-config commit 6c78704d542cebfb56d17474fe9f8395e9defb94 added
upstream support for ghc's javascript triple, so we can remove the
exception now.
This reverts commit 20a384ee5c642021786bb5981bb613d95273bb6e.
@ghost ghost marked this pull request as ready for review December 1, 2023 21:43
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Dec 2, 2023
@ghost ghost closed this Jan 23, 2024
@ghost ghost deleted the pr/lib/systems/parser-tests branch January 23, 2024 06:48
@x10an14
Copy link
Copy Markdown
Contributor

x10an14 commented Jan 23, 2024

Hey! Sorry to see this closed, was looking forward to seeing this in action =/

Can I inquire as to what's the plan going forward on this? Is this abandoned/halted for some (afaict) unspecified reason?

@RaitoBezarius
Copy link
Copy Markdown
Member

This is related to NixOS/nixpkgs-committers#60 (comment) and I suppose someone will have to pick the work to get it to finish line themselves.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: lib The Nixpkgs function library 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embedded target triplets (system, config) are used and interpreted incorrectly

6 participants