Skip to content

Commit

Permalink
Merge branch 'develop' into no-group
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Sep 26, 2024
2 parents fc51b29 + 34eb4a5 commit c481166
Show file tree
Hide file tree
Showing 31 changed files with 433 additions and 195 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,21 @@ on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.1', '9.2.2']
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.1', '9.2.5', '9.4.5', '9.6.1', '9.8.2', '9.10.1']
os: ['ubuntu-latest', 'macos-latest']
exclude:
# There are some linker warnings in 802 on darwin that
# cause compilation to fail
# See https://github.com/NixOS/nixpkgs/issues/25139
- ghc: '8.0.2'
os: 'macos-latest'
runs-on: ${{ matrix.os }}

name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.10.1.0'
- name: Cache
uses: actions/cache@v1
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
Expand All @@ -36,12 +32,13 @@ jobs:
${{ runner.os }}
- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test --enable-tests all
- name: Build Docs
# We don't run hlint tests, because different versions of hlint have different suggestions, and we don't want to worry about satisfying them all.
run: cabal test --enable-tests -f-hlint all
- if: matrix.ghc != '8.4.4'
# docs aren't built on ghc 8.4.4 because some dependency docs don't build on older GHCs
name: Build Docs
run: cabal haddock
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dist
cabal.sandbox.config
cabal.project.local
.cabal-sandbox/
dist-*
cabal-dev
Expand Down Expand Up @@ -32,7 +33,7 @@ tags
hsenv.log
\#*#
.#*
/shell.nix
/ghci-tmp
*.dump-*
*.verbose-core2core
.nix
19 changes: 19 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
orphan for backwards compat, temporarily, but it should eventually be removed
everywhere.

* Add support for GHC 9.8 and 9.10

* Replace partial `Map.lookup` with proper custom error for internal error.
(This would make debugging a bug in the implementation easier.)

## 0.0.8.2

* Add support for GHC 9.6

## 0.0.8.1

* Add support for GHC 9.2 and 9.4

## 0.0.8.0 - 2022-12-09

* Drop support for GHC 8.0 and 8.2. It may still be possible to use this library with those versions of GHC, but we do not guarantee or test it anymore.
* Fix an issue where (<>) crashed for some `PatchMapWithPatchingMove`s.
* Change `DecidablyEmpty` for `Sum` and `Product` to use `Num` and `Eq` rather than delegating to the argument type's `DecidablyEmpty` class. Since `Sum` and `Product` have `Monoid` actions and units that are inherently based on `Num`, it makes sense to have a `DecidablyEmpty` instances that inherently agree with that. Also, since `Int` and other numeric types don't have (and can't reasonably have) `DecidablyEmpty` instances, this is necessary to make them actually usable in this context.

## 0.0.7.0 - 2022-06-23

* Use `commutative-semigroups` for `Commutative`, making `Additive` a
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# patch

[![Haskell](https://img.shields.io/badge/language-Haskell-orange.svg)](https://haskell.org) [![Hackage](https://img.shields.io/hackage/v/patch.svg)](https://hackage.haskell.org/package/patch) [![Hackage CI](https://matrix.hackage.haskell.org/api/v2/packages/patch/badge)](https://matrix.hackage.haskell.org/#/package/patch) [![Travis CI](https://api.travis-ci.org/reflex-frp/patch.svg?branch=develop)](https://travis-ci.org/reflex-frp/patch) [![BSD3 License](https://img.shields.io/badge/license-BSD3-blue.svg)](https://github.com/reflex-frp/patch/LICENSE)
[![Haskell](https://img.shields.io/badge/language-Haskell-orange.svg)](https://haskell.org) [![Hackage](https://img.shields.io/hackage/v/patch.svg)](https://hackage.haskell.org/package/patch) [![BSD3 License](https://img.shields.io/badge/license-BSD3-blue.svg)](https://github.com/reflex-frp/patch/LICENSE)

Data structures for describing changes to other data structures.

Expand Down
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
packages: .

if arch(javascript)
extra-packages: ghci
8 changes: 0 additions & 8 deletions dep/reflex-platform/github.json

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions nix/deps/nix-haskell-ci/github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"owner": "reflex-frp",
"repo": "nix-haskell-ci",
"branch": "main",
"private": false,
"rev": "17d1de24e89b9ca2c769d467b093d9c7fe58854e",
"sha256": "01f0dm2rjyiz6dfx8sshdyipmp6vvzx671qnvv88sk6947l0v3cr"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import <nixpkgs> {}).fetchFromGitHub {
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
Expand Down
2 changes: 2 additions & 0 deletions nix/deps/nixpkgs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DO NOT HAND-EDIT THIS FILE
import (import ./thunk.nix)
8 changes: 8 additions & 0 deletions nix/deps/nixpkgs/github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"owner": "NixOS",
"repo": "nixpkgs",
"branch": "nixpkgs-unstable",
"private": false,
"rev": "c7eb65213bd7d95eafb8c5e2e181f04da103d054",
"sha256": "1glf6j13hbwi459qrc8kkkhfw27a08vdg17sr3zwhadg4bkxz5ia"
}
12 changes: 12 additions & 0 deletions nix/deps/nixpkgs/thunk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT HAND-EDIT THIS FILE
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
in fetch json
2 changes: 2 additions & 0 deletions nix/deps/reflex-platform/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DO NOT HAND-EDIT THIS FILE
import (import ./thunk.nix)
8 changes: 8 additions & 0 deletions nix/deps/reflex-platform/github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"owner": "reflex-frp",
"repo": "reflex-platform",
"branch": "develop",
"private": false,
"rev": "34c75631e7f2dd1409847b9df57252b96737e73a",
"sha256": "1nwyybjy65b7qnb62wcm74nqfndr8prr2xsfvaianps0yzm366d0"
}
12 changes: 12 additions & 0 deletions nix/deps/reflex-platform/thunk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT HAND-EDIT THIS FILE
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
in fetch json
8 changes: 8 additions & 0 deletions nix/project/haskell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ compiler ? "ghc910" }:

{
project = {
src = ../../.;
compiler-nix-name = compiler;
};
}
5 changes: 5 additions & 0 deletions nix/release/haskell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ haskellNix ? null }:

let ci = import ../deps/nix-haskell-ci (if haskellNix != null then { inherit haskellNix; } else {});
project = import ../project/haskell.nix {};
in with ci.haskell-nix; buildMatrix { inherit project; targets = matrix.default; }
66 changes: 66 additions & 0 deletions nix/release/reflex-platform.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{ reflex-platform-fun ? import ../deps/reflex-platform
}:

let native-reflex-platform = reflex-platform-fun { __useNewerCompiler = true; };
inherit (native-reflex-platform.nixpkgs) lib;
systems = [
"x86_64-linux"
# "x86_64-darwin"
];

perPlatform = lib.genAttrs systems (system: let
srcFilter =
builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
"release.nix"
".git"
"dist"
"dist-newstyle"
"cabal.haskell-ci"
"cabal.project"
".travis.yml"
]));
reflex-platform = reflex-platform-fun { inherit system; __useNewerCompiler = true; };
compilers = [
"ghc"
"ghcjs"
] ++ lib.optionals (reflex-platform.androidSupport) [
"ghcAndroidAarch64"
"ghcAndroidAarch32"
] ++ lib.optionals (reflex-platform.iosSupport) [
"ghcIosAarch64"
];
nixpkgsGhcs =
let
pkgs = import ../deps/nixpkgs { inherit system; };
nixGhc945 = pkgs.haskell.packages.ghc945.override {
};
nixGhc961 = pkgs.haskell.packages.ghc961.override {
};
in
{
ghc945 = nixGhc945.callCabal2nix "patch" srcFilter {};
ghc961 = nixGhc961.callCabal2nix "patch" srcFilter {};
};
compilerPkgs = lib.genAttrs compilers (ghc: let
reflex-platform = reflex-platform-fun {
inherit system;
__useNewerCompiler = true;
haskellOverlays = [
# Use this package's source for reflex
(self: super: {
_dep = super._dep // {
patch = srcFilter ../../.;
};
})
];
};
in reflex-platform.${ghc}.patch);
in compilerPkgs // nixpkgsGhcs // {
cache = reflex-platform.pinBuildInputs "patch-${system}"
(builtins.attrValues compilerPkgs);
});

metaCache = native-reflex-platform.pinBuildInputs "patch-everywhere"
(map (a: a.cache) (builtins.attrValues perPlatform));

in perPlatform // { inherit metaCache; }
6 changes: 6 additions & 0 deletions nix/shell/haskell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ haskellNix ? null }:

let ci = import ../deps/nix-haskell-ci (if haskellNix != null then { inherit haskellNix; } else {});
haskell = ci.nix-haskell;
project = import ../project/haskell.nix {};
in haskell.project project
15 changes: 15 additions & 0 deletions nix/shell/reflex-platform.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
let
rp = import ../deps/reflex-platform { __useNewerCompiler = true; };
pkgs = rp.nixpkgs;
system = builtins.currentSystem;
in
pkgs.mkShell {
name = "shell";
buildInputs = [
pkgs.cabal-install
pkgs.ghcid
];
inputsFrom = [
(import ../release/reflex-platform.nix {}).${system}.ghc.env
];
}
Loading

0 comments on commit c481166

Please sign in to comment.