Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 33 commits into from
Closed

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

wants to merge 33 commits into from

Conversation

ghost
Copy link

@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 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 labels Jun 19, 2023
@ghost ghost mentioned this pull request Jun 20, 2023
12 tasks
@ghost ghost requested review from zowoq, winterqt and figsoda as code owners June 20, 2023 06:20
@ghost ghost requested a review from sternenseemann June 20, 2023 23:59
lib/tests/triples.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 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+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 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 and removed 10.rebuild-darwin: 1-10 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
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
Member

This is related to #50105 (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 8.has: clean-up 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10
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