Commit Graph

60 Commits

Author SHA1 Message Date
Andrea Bedini
b35bbd26c9 More resiliant code 2023-03-03 08:15:19 +08:00
Ben Gamari
e3e34324ff Don't use lazy IO when reading .cabal files
Lazy IO tends to keep file handles open until the entire file is read,
which in this case may never happen. This leads to the process exceeding
the system's file descriptor limit, resulting in #35.
2023-03-01 13:42:52 -05:00
Andrea Bedini
b12a27a984 Use dir query parameter to include subdir into url 2023-02-20 13:42:28 +08:00
Andrea Bedini
1e45bfc0fa List package name and version separately in metadata 2023-02-20 12:15:08 +08:00
Andrea Bedini
2631bf6067 Implement metadata output.
Implement a new flag "--write-metadata" which will create, in the output
directory, a file "foliage/packages.json" with metadata about the
package provenance.

The file package.json file looks like this

```
{
  "Win32-network-0.1.0.0": {
    "source": {
      "url": "github:input-output-hk/Win32-network/3825d3abf75f83f406c1f7161883c438dac7277d"
    },
    "timestamp": "2022-10-17T00:00:00Z"
  },
  "Win32-network-0.1.1.0": {
    ...
```

The idea is that tools fetching the repo can also fetch this file to
obtain information about the package provenance.
2023-02-14 10:29:16 +08:00
Andrea Bedini
9995734db5 Write json metedata to output dir 2023-02-13 16:54:39 +08:00
Andrea Bedini
0993761f7f Clean up 2023-01-29 12:27:04 +08:00
Michael Peyton Jones
33a645bc3b
Build in parallel
This cuts the time to build `cardano-haskell-packages` down to 30s from
>2mins.
2022-12-16 15:15:42 +00:00
Andrea Bedini
72f2efc615 Improve web pages 2022-10-27 12:19:37 +08:00
Andrea Bedini
37022542cc Rename summary to contents 2022-10-26 17:18:36 +08:00
Andrea Bedini
c0714b1b3d Finish off pages
- Summary page has the list of all packages available (with details of the latest version)
- Timeline page has the list of all entries as they appear in the index

Also:
- Rebuild sdists is they are missing
2022-10-26 14:12:40 +08:00
Andrea Bedini
db3fe215de Restore index/ paths creation 2022-10-24 16:55:58 +08:00
Andrea Bedini
e57d6ba5a6 Index page 2022-10-21 16:46:50 +08:00
Andrea Bedini
f697629717 WIP fix botched rebase 2022-10-21 12:30:55 +08:00
Andrea Bedini
9f22d7295d First go at generating html pages 2022-10-21 11:37:20 +08:00
Andrea Bedini
572e37cb8e WIP 2022-10-21 11:36:47 +08:00
Andrea Bedini
9cc19c70ea Move json stuff to its own module 2022-10-14 09:28:31 +08:00
Andrea Bedini
678943d4b6 WIP 2022-10-14 07:56:59 +08:00
Andrea Bedini
1b3969a4f5 Drop PackageRule 2022-10-10 11:27:29 +08:00
Andrea Bedini
889e0b0ba0 Rework prepareSdist 2022-10-05 16:34:22 +08:00
Andrea Bedini
b13ecafb31 Merge remote-tracking branch 'new' 2022-10-05 15:13:15 +08:00
Andrea Bedini
9151ec36b2 Implement GitHub backend 2022-09-29 15:49:42 +02:00
Andrea Bedini
cbb726a6f5 Avoid partial functions 2022-09-29 15:49:07 +02:00
Andrea Bedini
e7399e5402 Remember sdist hash 2022-09-23 19:37:30 +02:00
Andrea Bedini
0f22847c90 More custom rules 2022-09-23 19:36:39 +02:00
Andrea Bedini
20b55ba655 Switch to forward mode 2022-09-23 16:38:30 +02:00
Andrea Bedini
301cb1781d Refactor readKeysAt' 2022-09-23 12:05:22 +02:00
Andrea Bedini
32d1345276 Removing cabal.project is now unnecessary 2022-09-22 13:32:23 +02:00
Andrea Bedini
5c24681da8 Make sdist with cabal-install internals 2022-09-22 12:12:16 +02:00
Andrea Bedini
c0811e6037 Remove leftover 2022-09-22 11:32:55 +02:00
Andrea Bedini
f41412a65a Factor out current package description 2022-09-22 11:27:27 +02:00
Andrea Bedini
2da1cffdb7 Introduce some path helpers 2022-09-22 11:22:17 +02:00
Andrea Bedini
c166412ff9 Fix issues with outputdir 2022-09-19 16:28:14 +02:00
Andrea Bedini
03a8fe471d Add option to not sign the index 2022-09-19 15:33:50 +02:00
Andrea Bedini
203e9a0fb3 Fix rewritePackageVersion 2022-08-31 13:17:05 +02:00
Andrea Bedini
ed579a6b20
Give user explicit control over signatures expiry 2022-06-08 10:39:46 +08:00
Andrea Bedini
6489104a91
Tweaks 2022-05-26 11:09:23 +08:00
Andrea Bedini
4ff84f10db
Remove leftover file 2022-05-19 15:03:43 +08:00
Andrea Bedini
6d346c5212
Rename ImportHackage to ImportIndex 2022-05-19 15:03:42 +08:00
Andrea Bedini
da34087e9a
Don't reinvent Cabal types 2022-05-19 14:51:27 +08:00
Andrea Bedini
f9fc67df4d
Start work to support preferred versions 2022-05-19 14:42:41 +08:00
Andrea Bedini
ec63788bdb
Use Cabal to rewrite package versions 2022-05-18 12:12:20 +08:00
Andrea Bedini
88e7bba9d5
Make revisions timestamps mandatory
Also introduce sanity checks for the following cases

- Package timestamp is later than any revision timestamp
- Package has no timestamp but has revisions

The above cases do not make any sense and are considered invalid.
2022-05-16 17:23:18 +08:00
Andrea Bedini
934e4e8261
Tweaks 2022-05-16 16:55:43 +08:00
Andrea Bedini
8a2e571404
Use a custom rule for remote assets 2022-05-16 14:48:02 +08:00
Andrea Bedini
5be1311662
Bail if no package metadata is found.
Closes #5.
2022-04-13 15:47:38 +08:00
Andrea Bedini
1851bf4756
force-version has to win over patches 2022-04-01 13:01:45 +08:00
Andrea Bedini
d7f78543d4
Fix force-version implementation.
Now the tarballs are downloaded only once but now each package name and
version is unpacked independently in its own directory. Then patches are
applied there.
2022-04-01 12:52:14 +08:00
Andrea Bedini
4e333ef49f
Implement force version
Doesn't quite work because srcDir is unique by url, so if you have the
same url with different versions, things will collide. This is a bug
that might affect patching too.
2022-03-31 15:02:00 +08:00
Andrea Bedini
3a0e89b41e
[build] fix patches
I was applying patches only when making the source distribution but
patches might modify the cabal file which goes into the index (yes one
should use revisions for that).

I am now applying patches right after I have the package source.
2022-03-30 15:05:08 +08:00