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

Examples: use GitHub cargo2nix URL, not relative path #355

Draft
wants to merge 2 commits into
base: release-0.11.0
Choose a base branch
from

Conversation

proski
Copy link
Collaborator

@proski proski commented Mar 31, 2024

The users are shown one thing and told to do another.

The use of parent directories in flake URLs is unreliable (that's why get-flake exists) and should be avoided in examples.

Referring to the parent directory creates a circular dependency in flake.lock files. nix flake lock keeps changing the sources every time it's run because the flake.lock files in the examples affect the checksum of the parent flake, which in turn goes to flake.lock in the examples.

With GitHub references, the locks would get out of date only when a new commit is merged to the branch used in the URL.

The users are shown one thing and told to do another.

The use of parent directories in flake URLs is unreliable (that's why
`get-flake` exists) and should be avoided in examples.

Referring to the parent directory creates a circular dependency in `flake.lock`
files. `nix flake lock` keeps changing the sources every time it's run because
the `flake.lock` files in the examples affect the checksum of the parent flake,
which in turn goes to `flake.lock` in the examples.

With GitHub references, the locks would get out of date only when a new commit
is merged to the branch used in the URL.
@proski proski changed the title Examples: use cargo2nix from GitHub rather that from ../.. Examples: use GitHub cargo2nix URL, not relative path Mar 31, 2024
@proski
Copy link
Collaborator Author

proski commented Apr 2, 2024

This needs some care, as we probably don't want to endorse a broken branch. Either the ref branch should be the current branch, or it should be the latest release.

@proski proski marked this pull request as draft April 2, 2024 16:40
@proski
Copy link
Collaborator Author

proski commented Apr 3, 2024

Also, the examples are used in CI. The CI should be using the current code under test, not a GitHub reference.

@psionic-k
Copy link
Member

Design considerations are just that local testing and that CI is useful / works.

Version mismatch between test workspace Cargo.nix and the cargo overlay will often cause breakage.

Perhaps the flakes should be overridden via automation and scripts. At the time of CI, the rev under test is available via git.

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.

None yet

2 participants