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

New nix infrastructure #87

Closed
wants to merge 17 commits into from

Conversation

CohenCyril
Copy link
Contributor

@CohenCyril CohenCyril commented Dec 10, 2020

CC @Zimmi48

  • Update ref.yml

@CohenCyril CohenCyril marked this pull request as draft December 10, 2020 17:39
Copy link
Member

@Zimmi48 Zimmi48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to git add config.nix and shellHook.sh?

default.nix.mustache Outdated Show resolved Hide resolved
generate.sh Outdated Show resolved Hide resolved
@CohenCyril CohenCyril force-pushed the nix-toolbox branch 3 times, most recently from ed683f3 to 2dcbdb9 Compare February 11, 2021 11:45
@CohenCyril CohenCyril marked this pull request as ready for review February 11, 2021 13:35
@CohenCyril
Copy link
Contributor Author

@Zimmi48 I reached something satisfactory, want to talk about it?

@Zimmi48
Copy link
Member

Zimmi48 commented Feb 11, 2021

Sure! I'm available anytime tomorrow, Tuesday or next Thursday/Friday.

Copy link
Member

@Zimmi48 Zimmi48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some typos in the documentation of config.nix.

fallback-config.nix.mustache Outdated Show resolved Hide resolved
fallback-config.nix.mustache Outdated Show resolved Hide resolved
fallback-config.nix.mustache Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
@CohenCyril
Copy link
Contributor Author

woops ;)

- documenting the config file
- entries in ref.yml
nix-action.yml.mustache Outdated Show resolved Hide resolved
nix-action.yml.mustache Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
@CohenCyril
Copy link
Contributor Author

It seems to me that the instructions on how to define / extend tasks should still be present even if the initial list of tasks was generated from meta.yml given that as soon as you copy the file into config.nix, you are on your own and you cannot rely on this generation process to edit them anymore.

I think there should be two distinct docs anyway: one on coq-community/template functionalities and one on the coq-community/coq-nix-toolbox functionalities. When one copies fallback-config.nix to config.nix they should be warned that by doing so 1. the handling of task should be removed from meta.yml and 2. they must now refer to coq-nix-toolbox documentation.

Anyway meta.yml is now able to generate everything that most user may want from config.nix. The missing feature is code factoring as in
https://github.com/math-comp/analysis/pull/345/files#diff-a4e04df48252cabe60d40e7d9b7417d7c5f9259e81e4be5e86f18430a22d011aR1-R8
or using overrideAttrs instead of override (which I never had to use because I prefer overlays).

@CohenCyril
Copy link
Contributor Author

BTW, now that tasks generation is also handled by the templates, what is the remaining justification for leaving the possibility to the user to copy and manually edit the fallback-config.nix file?

I'm not sure anymore (I did not expect to reach that level of automated generation when I started...)

CohenCyril and others added 2 commits March 16, 2021 20:39
Co-authored-by: Théo Zimmermann <theo.zimmi@gmail.com>
Co-authored-by: Théo Zimmermann <theo.zimmi@gmail.com>
@Zimmi48
Copy link
Member

Zimmi48 commented Mar 16, 2021

I'm not sure anymore (I did not expect to reach that level of automated generation when I started...)

Yeah, me neither! Anyway, my opinion is that having to copy the template fallback config to a new file was fine when you couldn't do most things except by hand but now it doesn't really make sense anymore. So what I suggest is to have config.yml auto-generated and some option in meta.yml to disable its generation when people want to switch to manually editing this file. We should anyway have a general mechanism to disable a list of files from the auto-generation process (beyond listing explicitly all the files that you want to get, which doesn't scale).

nix-action.yml.mustache Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
Copy link
Member

@Zimmi48 Zimmi48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check that this is still compatible with the latest version of the toolbox.

coq-nix-toolbox.nix.mustache Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
ref.yml Outdated Show resolved Hide resolved
Copy link
Member

@Zimmi48 Zimmi48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes are needed to default.nix.mustache to use the latest version of the toolbox.

/!\ is discouraged in favor of `token` below.
example:
- "CACHIX_SIGNING_KEY"
- token:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we could set a default value for this token if community is true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I tried with this patch but it didn't work:

diff --git a/nix-action.yml.mustache b/nix-action.yml.mustache
index 3f67a5c..60a4e9f 100644
--- a/nix-action.yml.mustache
+++ b/nix-action.yml.mustache
@@ -39,6 +39,21 @@ jobs:
 <%# token%>
         authToken: '${{ secrets.<%token%> }}'
 <%/ token%>
+<%/ cachix%>
+<%^ cachix%>
+<%# community%>
+    - name: Cachix setup coq
+      uses: cachix/cachix-action@v8
+      with:
+        # Name of a cachix cache to pull/substitute
+        name: coq
+    - name: Cachix setup coq-community
+      uses: cachix/cachix-action@v8
+      with:
+        # Name of a cachix cache to pull/substitute
+        name: coq-community
+        authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+<%/ community%>
 <%/ cachix%>
     - name: Git checkout
       uses: actions/checkout@v2
@@ -87,6 +102,21 @@ jobs:
 <%# token%>
         authToken: '${{ secrets.<%token%> }}'
 <%/ token%>
+<%/ cachix%>
+<%^ cachix%>
+<%# community%>
+    - name: Cachix setup coq
+      uses: cachix/cachix-action@v8
+      with:
+        # Name of a cachix cache to pull/substitute
+        name: coq
+    - name: Cachix setup coq-community
+      uses: cachix/cachix-action@v8
+      with:
+        # Name of a cachix cache to pull/substitute
+        name: coq-community
+        authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+<%/ community%>
 <%/ cachix%>
     - name: Git checkout
       uses: actions/checkout@v2

My Mustache is too rusty for me to understand what the problem is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did manage to do something similar with default Cachix instances and default Cachix pushing for coq-community projects in #99.

default.nix.mustache Outdated Show resolved Hide resolved
default.nix.mustache Outdated Show resolved Hide resolved
Co-authored-by: Théo Zimmermann <theo.zimmi@gmail.com>
required: false
type: string
description: Change the pinned rev of coq-nix-toolbox
- nix-dependencies:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be provided as the nix field of the dependencies list. Would it be possible to reuse this (less conversion of projects using the former infrastructure)? If not, we should remove this unused field from the documentation.

@Zimmi48
Copy link
Member

Zimmi48 commented Jul 8, 2021

This PR cannot be merged until coq-community/coq-nix-toolbox#49 is fixed.

@Zimmi48 Zimmi48 marked this pull request as draft July 8, 2021 09:53
@Zimmi48
Copy link
Member

Zimmi48 commented Aug 7, 2021

At this stage, my opinion is that it's better if we don't have to maintain three different complex CI generation procedures, so it would make sense to only focus on the generation mechanism of the standalone installation procedure, and to only provide a lightweight CI template here like in #99. So I propose to close this.

@Zimmi48
Copy link
Member

Zimmi48 commented Aug 31, 2021

@CohenCyril: do you agree with my suggestion of closing this and recommending either a full Coq Nix Toolbox setup with a standalone installation or a lightweight CI generation mechanism with the current version of the templates (following #99)?

@CohenCyril CohenCyril closed this Aug 31, 2021
@CohenCyril
Copy link
Contributor Author

Ok! I'd rather keep the branch though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants