Commit Graph

2287 Commits

Author SHA1 Message Date
rvcas
1dea348a2e chore: rust rover error 2023-09-13 21:29:05 -04:00
rvcas
7b915b7dcf chore: allow clippy::arc_with_non_send_sync in tests 2023-09-13 19:07:45 -04:00
rvcas
d808197507 chore: clippy fix 2023-09-13 18:17:59 -04:00
rvcas
bc0824f4eb chore: new aiken.lock files for examples 2023-09-13 18:17:40 -04:00
rvcas
9a4f181a0f chore: clippy fix 2023-09-13 17:19:31 -04:00
KtorZ
06347c3efa Add CHANGELOG entry. 2023-09-13 17:17:32 -04:00
KtorZ
c711a97e69 Throttle calls to package registry for version resolution
The 'HEAD' call that is done to resolve package revisions from
  unpinned versions is already quite cheap, but it would still be better
  to avoid overloading Github with such calls; especially for users of a
  language-server that would compile on-the-fly very often. Upstream
  packages don't change often so there's no need to constantly check the
  etag.

  So we now keep a local version of etags that we fetched, as well as a
  timestamp from the last time we fetched them so that we only re-fetch
  them if more than an hour has elapsed. This should be fairly resilient
  while still massively improving the UX for people showing up after a
  day and trying to use latest 'main' features.

  This means that we now effectively have two caching levels:

  - In the manifest, we store previously fetched etags.
  - In the filesystem, we have a cache of already downloaded zip archives.

  The first cache is basically invalidated every hour, while the second
  cache is only invalidated when a etag changes. For pinned versions,
  nothing is invalidated as they are considered immutable.
2023-09-13 17:17:32 -04:00
KtorZ
15efeb3069 Remove unused code & data-type 'UseManifest'
If it's unused, it shall be gone. It obfuscate what functions are
  doing and require managing extra complexity for no reason.
2023-09-13 17:17:32 -04:00
KtorZ
5381762e50 Rework logs around dependency fetching. 2023-09-13 17:17:32 -04:00
KtorZ
76ff09ba0e Ensure that version resolution works offline
And so, even for unpinned package. In this case, we can't do a HEAD request. So we fallback by looking at what's available in the cache and using the most recently downloaded version from the cache. This is only a best effort as the most recently downloaded one may not be the actual latest. But common, this is a case where (a) someone didn't pin any version, (b) is trying to build on in an offline setup. We could possibly make that edge-case better but, let's see if anyone ever complains about it first.
2023-09-13 17:17:32 -04:00
KtorZ
87087a1811 Always check package status when version is not pinned
When the version isn't a git sha or a tag, we always check that we got
  the last version of a particular dependency before building. This is
  to avoid those awkward moments where someone try to use something from
  the stdlib that is brand new, and despite using 'main' they get a
  strange build failure regarding how it's not available.

  An important note is that we don't actually re-download the package
  when the case occurs; we merely check an HTTP ETag from a (cheap) 'HEAD'
  request on the package registry. If the tag hasn't changed then that
  means the local version is correct.

  The behavior is completely bypassed if the version is specified using
  a git sha or a tag, as here, we can assume that fetching it once it
  enough (and that it can change). If a package maintainer force-pushed
  a tag however, there may be discrepency and the only way around that
  is to `rm -r ./build`.
2023-09-13 17:17:32 -04:00
KtorZ
3c3a7f2423 Define 'is_git_sha_or_version' to assert whether a version is 'immutable'
Best-effort to assert whether a version refers is a git sha digest or a tag. When it is, we
avoid re-downloading it if it's already fetched. But when it isn't, and thus refer to a branch,
we always re-download it. Note however that the download might be short-circuited by the
system-wide package cache, so a download doesn't actually mean a network request.

The package cache is however smart-enough to assert whether a package in the cache must be
re-downloaded (using HTTP ETag). So this is mostly about delegating the re-downloading logic to
the global packages cache.
2023-09-13 17:17:32 -04:00
KtorZ
65fb3a640a Remove dead-code. 2023-09-13 17:17:32 -04:00
KtorZ
a72628a4dc Auto-derive 'Debug' trait instance for types in deps
Actually useful to debug / troubleshoot things.
2023-09-13 17:17:32 -04:00
microproofs
a45001376d fix: is_record was used incorrectly in code gen,
the real solution was to look up the datatype and check constructors length
2023-09-13 00:33:02 -04:00
microproofs
d042d55d42 fix clippy warnings in code gen 2023-09-12 21:25:05 -04:00
KtorZ
9782c094b7 Fix clippy suggestions. 2023-09-08 16:21:07 +02:00
KtorZ
8ba5946c32 Preserve escape sequence after formatting
Bumped into this randomly. We do correctly parse escape sequence, but
  the format would simply but the unescaped string back on save. Now it
  properly re-escapes strings before flushing them back. I also removed
  the escape sequence for 'backspace' and 'new page' form feed as I
  don't see any use case for those in an Aiken program really...
2023-09-08 12:12:15 +02:00
KtorZ
5cfc3de7bf Add CODEOWNERS 2023-09-08 10:21:33 +02:00
rvcas
6b70292dfb chore: cargo fmt 2023-09-06 21:10:50 -04:00
rvcas
1de7b2866a feat(cli): add --deny to build, check, and docs
This is useful for CI, where people that may have
a stricter workflow want to force CI to fail if any warnings
are detected.
2023-09-06 17:19:44 -04:00
microproofs
819a0a20e6 add tests for case and constr
Fix a minor issue with decoding order
2023-09-03 11:52:49 -04:00
microproofs
c9b01ab365 chore: fill in cost model
test: Add case and constr eval tests
2023-09-03 11:52:49 -04:00
microproofs
85901dc141 chore: update cost model with placeholders for new terms to pass tests 2023-09-03 11:52:49 -04:00
microproofs
40e1d39f8b Add placeholders for cost model 2023-09-03 11:52:49 -04:00
microproofs
33d6d3049e add compute for the new terms constr and case 2023-09-03 11:52:49 -04:00
microproofs
e566c4e1de feat(uplc): add Case and Const terms
- parsering
- interning
- flat encoding and decoding
- pretty printing
- debruijn conversion

Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-09-03 11:52:49 -04:00
rvcas
dfe433ea46 fix: trim whitespace when loading hex strings from files closes #720 2023-08-31 18:22:09 -04:00
rvcas
097d1fa893 chore: update changelog 2023-08-31 18:01:52 -04:00
rvcas
437a95bfe8 fix: behave like rust with hyphens closes #722 closes #690 2023-08-31 18:00:21 -04:00
rvcas
a87a8a7b35 chore: update changelog 2023-08-31 17:41:36 -04:00
rvcas
dca09811c1 fix: empty records crashing code gen closes #728 2023-08-31 17:39:38 -04:00
rvcas
fb967d4c7b fix: uplc formatter of Data closes #716 2023-08-31 17:20:48 -04:00
microproofs
51c44c6a30 fix: add an assert for better error messages when doing empty types 2023-08-30 13:50:37 -04:00
waalge
cd3a02416f chore: rm unused pub function 2023-08-29 22:30:06 -04:00
waalge
756e16c14b fix: rename assert to expect 2023-08-29 22:30:06 -04:00
microproofs
baa6917af5 Fix: Change type map length assert to check for greater than equals instead of equals to argument length 2023-08-29 21:59:15 -04:00
Matthias Benkort
d01766d735 Merge pull request #721 from waalge/waalge/rm-mut
rm unnecessary mut
2023-08-29 21:00:05 +02:00
Chris Gianelloni
67986d9416 chore: build static binaries for Linux/Windows
Signed-off-by: Chris Gianelloni <cgianelloni@applause.com>
2023-08-29 00:46:50 -04:00
waalge
d4b9f22ac3 rm unnecessary mut 2023-08-26 16:30:44 +00:00
rvcas
1715496d5b chore: update resolver in virtual workspace 2023-08-24 15:51:39 -06:00
rvcas
0e7f1597bf chore: add release instructions in contributing.md 2023-08-24 15:43:26 -06:00
rvcas
b075d85b40 chore: Release 2023-08-24 15:05:12 -06:00
rvcas
b3494a7f63 chore: fix versions 2023-08-24 15:04:52 -06:00
rvcas
a7062ccb88 chore: fix versions 2023-08-24 15:04:19 -06:00
rvcas
747e057d05 fix: tags 2023-08-24 15:00:09 -06:00
KtorZ
379368c530 Fix clippy. 2023-08-22 13:30:30 +02:00
KtorZ
2f0211a7b1 Bump all version manually because cargo workspaces didn't work. 2023-08-22 13:27:10 +02:00
KtorZ
780a61e3e8 Release 1.0.16-alpha
aiken@1.0.16-alpha

Generated by cargo-workspaces
2023-08-22 13:18:48 +02:00
KtorZ
d3fe241ccd Wrap-up CHANGELOG 2023-08-22 13:14:35 +02:00