Skip to content

Commit

Permalink
Merge pull request #285 from PrivateStorageio/281.test-against-tahoe-…
Browse files Browse the repository at this point in the history
…lafs-master

Also test against Tahoe-LAFS master on CI
  • Loading branch information
exarkun authored Jan 14, 2022
2 parents 635f9d8 + 7aadcfe commit 744a063
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,16 @@ workflows:
py-version: "39"
tahoe-lafs-source: "tahoe-lafs"

- "linux-tests":
name: "Linux tests python 3.9, Tahoe-LAFS master"
py-version: "39"
# This is usually not master@HEAD because it is still pinned to a
# certain revision. The intent is to update it frequently and
# discover fixable incompatibilities in small groups and unfixable
# incompatibilities early enough to prevent them from going into a
# release.
tahoe-lafs-source: "tahoe-lafs-master"

# https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
- "macos-tests":
name: "macOS tests python 3.8 xcode 11.7.0"
Expand Down
38 changes: 31 additions & 7 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Python Dependencies
...................

We use `mach-nix <https://github.com/DavHau/mach-nix/>`_ to build python packages.
It uses a snapshot of pypi to expose python dependencies to nix,
It uses a snapshot of PyPI to expose python dependencies to nix,
thus our python depedencies (on nix) are automatically pinned.
To update the pypy snapshot (and thus our python dependencies), run
To update the PyPI snapshot (and thus our python dependencies), run

.. code:: shell
Expand All @@ -42,22 +42,46 @@ To update the pypy snapshot (and thus our python dependencies), run
tahoe-lafs
..........

We depend on pinned commit of tahoe-lafs.
To update to the latest commit, run
ZKAPAuthorizer declares a dependency on Tahoe-LAFS with a narrow version range.
This means that Tahoe-LAFS will be installed when ZKAPAuthorizer is installed.
It also means that ZKAPAuthorizer exerts a great deal of control over the version of Tahoe-LAFS chosen.

When installing using native Python packaging mechanisms
(for example, pip)
the relevant Tahoe-LAFS dependency declaration is in ``setup.cfg``.
See the comments there about the narrow version constraint used.

When installing the Nix package the version of Tahoe-LAFS is determined by the "tahoe-lafs" entry in the niv-managed ``nix/sources.json``.
When feasible this is a released version of Tahoe-LAFS.
To update to a new release, run:

.. code:: shell
nix-shell --run 'niv update --rev tahoe-lafs-A.B.C tahoe-lafs'
When it is not feasible to use a released version of Tahoe-LAFS,
niv's ``--branch`` or ``--rev`` features can be used to update this dependency.

It is also possible to pass a revision of ``pull/<pr-number>/head`` to test against a specific PR.

We test against a pinned commit of Tahoe-LAFS master.
To update to the current master@HEAD revision, run:

.. code:: shell
nix-shell --run 'niv update tahoe-lafs --branch master'
nix-shell --run 'niv update tahoe-lafs-master --branch master'
It is also possible to pass ``pull/<pr-number>/head`` to test against a specific PR.
We intend for these updates to be performed periodically.
At the moment, they must be performed manually.
It might be worthwhile to `automate this process <https://github.com/PrivateStorageio/ZKAPAuthorizer/issues/287>` in the future.

.. note::

Since tahoe-lafs doesn't have correct version information when installed from a github archive,
the packaging in ``default.nix`` includes a fake version number.
This will need to be update manually at least when the minor version of tahoe-lafs changes.

If you want to test multiple versions, you can add an additional source, pointing at other version
If you want to test additional versions, you can add an additional source, pointing at other version.

.. code:: shell
Expand Down
12 changes: 12 additions & 0 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,17 @@
"type": "tarball",
"url": "https://github.com/tahoe-lafs/tahoe-lafs/archive/tahoe-lafs-1.17.1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"tahoe-lafs-master": {
"branch": "master",
"description": "The Tahoe-LAFS decentralized secure filesystem.",
"homepage": "https://tahoe-lafs.org/",
"owner": "tahoe-lafs",
"repo": "tahoe-lafs",
"rev": "766a53b5208c03c45ca0a98e97eee76870276aa1",
"sha256": "16mvh5ypgv9a5vhjnc78jjf4v5yzyyz19af2vixrc4zqb0ikxrxa",
"type": "tarball",
"url": "https://github.com/tahoe-lafs/tahoe-lafs/archive/766a53b5208c03c45ca0a98e97eee76870276aa1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

0 comments on commit 744a063

Please sign in to comment.