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

Fix #98209. Test all agda packages #98214

Merged
merged 3 commits into from Oct 19, 2021

Conversation

turion
Copy link
Contributor

@turion turion commented Sep 18, 2020

Motivation for this change

Test all agda packages

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@alexarice This is WIP still.

@turion
Copy link
Contributor Author

turion commented Sep 18, 2020

Currently rebased onto #98199 to get a feeling whether this is feasible.

@alexarice
Copy link
Contributor

I'm not sure this achieves what you want in that I don't think these tests will be ran by ofBorg when you update standard-library

@turion
Copy link
Contributor Author

turion commented Sep 18, 2020

Yes, true :/ Do you have an idea how to go about this?

@alexarice
Copy link
Contributor

Disclaimer that I am not sure about this but this is what I believe happens:

  • When you submit the PR, by default ofBorg just checks that the nix evaluates (i.e. doesn't build anything)
  • If the user is recognised(?) by ofBorg (via putting in a pr to ofBorg) and the pr title has a certain format, or if someone types ofBorg build (but actually tagging ofBorg), it tries to build the package and runs any tests contained in passthru.tests

However the CI checks have looked a bit different recently, and I'm not sure if there is a detailed description of what they do somewhere

@turion
Copy link
Contributor Author

turion commented Oct 19, 2020

@alexarice Does that mean this is still useful? Maybe one of us can get ofBorg rights to trigger the build.

@alexarice
Copy link
Contributor

I have ofBorg rights, that is not the problem. The problem is that as I understand it you want:
PR put in for standard library -> ofBorg tests all downstream packages.

The test you have added does not do this. It adds checking all agda packages to the agda test, which can only be run manually.

@turion
Copy link
Contributor Author

turion commented Oct 19, 2020

Right now it's fine for me if the packages are built either automatically or by triggering ofBorg manually. These PRs are still rare enough that we'll always notice. I'm fine with going with the solution that is most likely to be merged.

I could even imagine an allPackages derivation that simply has all agda packages as build inputs and does nothing otherwise, and when reviewing one can simply build that locally to verify that nothing was broken.

@alexarice
Copy link
Contributor

Maybe there is a standard way to check for breakages in downstream packages?

@alexarice
Copy link
Contributor

I just don't feel this test is checking if the agda infrastructure is broken which shouldn't be the case if one leaf package is a bit dodgy

@turion
Copy link
Contributor Author

turion commented Oct 19, 2020

Maybe there is a standard way to check for breakages in downstream packages?

How is it done in Haskell?

@alexarice
Copy link
Contributor

They update the whole package set with cabal2nix at one time and then I guess build the whole thing manually and see what packages broke though I am not an expert

@turion
Copy link
Contributor Author

turion commented Oct 19, 2020

Ok, we can't quite copy that workflow yet (see #87903 though for an initial idea how to do that). How about the easiest way, just make a set allUnbrokenPackages, document it, and we can remind people on PRs to build it locally in order to ensure that there are no breakages?

@alexarice
Copy link
Contributor

Does anything else do this?

@turion
Copy link
Contributor Author

turion commented Oct 19, 2020

Does anything else do this?

I don't know, I'm not really involved in any other language frameworks.

@alexarice
Copy link
Contributor

I'm not really against it, just seems odd to have a meta-package in the package set, really feels like it should be a test

@turion
Copy link
Contributor Author

turion commented Oct 19, 2020

Understandable.

So a separate test? In nixos/tests/agda/allUnbrokenPackages.nix? How would it look like? It wouldn't do anything in the body, it just has all unbroken packages as dependencies?

@alexarice
Copy link
Contributor

I'm afraid I don't really know enough about testing

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-test-all-agda-packages/9545/1

@turion turion force-pushed the dev_test_all_agda_packages branch 2 times, most recently from 876f72b to 5e29b1d Compare June 9, 2021 09:38
@turion
Copy link
Contributor Author

turion commented Jun 9, 2021

@ofborg build agdaPackages.standard-library.passthru.tests

@turion
Copy link
Contributor Author

turion commented Jun 9, 2021

@alexarice @neosimsim what do you think about this? I'd like to merge this before the next standard library is released (in the next days), so we can test the workflow.

@alexarice
Copy link
Contributor

I'm not sure about all the changes to the documentation, as I believe that is aimed more at users, but I am happy with all the code changes

@turion
Copy link
Contributor Author

turion commented Jun 9, 2021

I'm not sure about all the changes to the documentation, as I believe that is aimed more at users, but I am happy with all the code changes

Yes, I understand. That's why this section is at the end, so mere users will stop reading at some point and not miss anything important. However my impression is that nixpkgs is a rabbit hole, and after some time of using, users automatically evolve into maintainers, and then it's great if they have some docs to get started. (I remember having a hard time starting to contribute to the Haskell ecosystem in nixpkgs, and I'd like to prevent that for future maintainers.) Also, sometimes Agda library authors might want to have their library included, so they can directly jump to that place.

Should I maybe add a sentence saying something to the effect of "If you just want to use Agda, you don't need to read this"?

@turion turion force-pushed the dev_test_all_agda_packages branch from 5e29b1d to 7c1b016 Compare August 2, 2021 07:28
@turion
Copy link
Contributor Author

turion commented Aug 2, 2021

I'm not sure about all the changes to the documentation, as I believe that is aimed more at users

For example python also has a section about how python is packaged in nixpkgs. So I think it's fine to have a separate section on that.

@turion
Copy link
Contributor Author

turion commented Aug 2, 2021

@ofborg build agdaPackages.standard-library.passthru.tests
@ofborg build agdaPackages.passthru.tests

@turion
Copy link
Contributor Author

turion commented Aug 2, 2021

@ofborg build agda.passthru.tests.all

@turion
Copy link
Contributor Author

turion commented Aug 3, 2021

@alexarice @neosimsim Comments? Otherwise I'm going to go find someone to merge ;)

@turion turion force-pushed the dev_test_all_agda_packages branch from 7c1b016 to 8c0be16 Compare August 3, 2021 11:34
@turion
Copy link
Contributor Author

turion commented Aug 3, 2021

@ofborg build agdaPackages.standard-library.passthru.tests
@ofborg build agdaPackages.passthru.tests.allPackages

@turion
Copy link
Contributor Author

turion commented Aug 3, 2021

@ofborg build agda.passthru.tests.allPackages

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/394

@turion turion merged commit 7a135ab into NixOS:master Oct 19, 2021
@turion turion deleted the dev_test_all_agda_packages branch October 19, 2021 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants