Comments (16)
Thanks @ivanperez-keera I'll try putting that patch in tonight.
from copilot.
Thanks @ivanperez-keera, I can confirm this patch gets copilot back to a green board in Debian (ignore mips64el). :-)
from copilot.
Thanks a lot! Will review it and get back to you.
from copilot.
Are you able to reproduce this one locally, or do you need any more info from me on it?
from copilot.
I'm trying to reproduce it in a docker container with GHC 9.4.7 and Cabal 3.8. Cabal is giving me headaches: haskell/cabal#9444.
from copilot.
I managed to reproduce the problem.
from copilot.
Hey Ivan, just checking in to see if this was looking relatively easy to fix, or whether it might take a bit to sort out. I think this is the last (known) blocker in getting copilot updated in Debian. Obviously not the most urgent issue in the world, though. :-)
from copilot.
Hi. I'm hoping we'll be able to fix this soon. I don't know if I'll be able to find time this week but I'll do everything I can. If not, I'll prioritize fixing this by next week.
And thanks for following up on this! Having Copilot in Debian is a big deal for us and your support to make that happen is invaluable :)
from copilot.
@swt2c I was able to find the solution. I'll try to push this soon.
If you want to backport this change to Copilot 3.17 on Debian, here's the diff:
diff --git a/copilot-language/tests/Test/Copilot/Language/Reify.hs b/copilot-language/tests/Test/Copilot/Language/Reify.hs
index e056d946..d724df73 100644
--- a/copilot-language/tests/Test/Copilot/Language/Reify.hs
+++ b/copilot-language/tests/Test/Copilot/Language/Reify.hs
@@ -31,7 +31,7 @@ import qualified Copilot.Language.Operators.Integral as Copilot
import qualified Copilot.Language.Operators.Mux as Copilot
import qualified Copilot.Language.Operators.Ord as Copilot
import Copilot.Language.Reify (reify)
-import Copilot.Language.Spec (observer)
+import Copilot.Language.Spec (Spec, observer)
import Copilot.Language.Stream (Stream)
import qualified Copilot.Language.Stream as Copilot
@@ -732,7 +732,8 @@ semanticsShowK steps (SemanticsP (expr, exprList)) =
checkSemanticsP :: Int -> [a] -> SemanticsP -> IO Bool
checkSemanticsP steps _streams (SemanticsP (expr, exprList)) = do
-- Spec with just one observer of one expression.
- let spec = observer testObserverName expr
+ let spec :: Spec
+ spec = observer testObserverName expr
-- Reified stream (low-level)
llSpec <- reify spec
from copilot.
Description
copilot-language
's tests fail to compile with GHC 9.4. Prior versions made arbitrary decisions during type interfence, and the new type checker will simply reject such programs.
Type
- Bug: test fails to compile.
Additional context
None.
Requester
- Scott Talbert (Debian Developer & Debian Haskell Group)
Method to check presence of bug
Compiling copilot-language
's tests with GHC 9.4.7 results in an error message:
# cabal test .
Build profile: -w ghc-9.4.7 -O1
In order, the following will be built (use -v for more details):
- copilot-language-3.17 (test:unit-tests) (first run)
Preprocessing test suite 'unit-tests' for copilot-language-3.17..
Building test suite 'unit-tests' for copilot-language-3.17..
[2 of 3] Compiling Test.Copilot.Language.Reify ( tests/Test/Copilot/Language/Reify.hs, /root/copilot/dist-newstyle/build/x86_64-linux/ghc-9.4.7/copilot-language-3.17/t/unit-tests/build/unit-tests/unit-tests-tmp/Test/Copilot/Language/Reify.o )
tests/Test/Copilot/Language/Reify.hs:737:16: error:
* Could not deduce (Copilot.Core.Type.Struct t)
arising from a superclass required to satisfy `Typed t',
arising from a use of `observer'
from the context: (Read t, Eq t, Typed t, Arbitrary t)
bound by a pattern with constructor:
SemanticsP :: forall t.
(Typeable t, Read t, Eq t, Show t, Typed t, Arbitrary t) =>
((Typeable t, Read t, Eq t, Show t, Typed t, Arbitrary t) =>
(Stream t, [t]))
-> SemanticsP,
in an equation for `checkSemanticsP'
at tests/Test/Copilot/Language/Reify.hs:734:33-59
Possible fix:
add (Copilot.Core.Type.Struct t) to the context of
the data constructor `SemanticsP'
* In the expression: observer testObserverName expr
In an equation for `spec': spec = observer testObserverName expr
In the expression:
do let spec = observer testObserverName expr
llSpec <- reify spec
let trace = eval Haskell steps llSpec
let expectation = take steps exprList
....
|
737 | spec = observer testObserverName expr
Expected result
The above tests should compile without errors.
Desired result
The above tests should compile without errors.
Proposed solution
Add type annotations in checkSemanticsP
.
Further notes
None.
from copilot.
Change Manager: Confirmed that the issue manifests with GHC 9.4.
from copilot.
Technical Lead: Confirmed that the issue should be addressed.
from copilot.
Technical Lead: Bug scheduled for fixing in Copilot 3.18.
Fix assigned to: @ivanperez-keera.
from copilot.
Implementor: Solution implemented, review requested.
from copilot.
Change Manager: Verified that:
- Solution is implemented:
- The code proposed compiles and passes all tests. Details:
Build log: https://app.travis-ci.com/github/Copilot-Language/copilot/builds/267903584 - The solution proposed produces the expected result. Details:
The following Dockerfile checks that copilot-language compiles with GHC 9.4, in which case it prints the message Success:Command (substitute variables based on new path after merge):FROM ubuntu:focal RUN apt-get update RUN apt-get install --yes libz-dev RUN apt-get install --yes git RUN apt-get install --yes wget RUN mkdir -p $HOME/.ghcup/bin RUN wget https://downloads.haskell.org/~ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 -O $HOME/.ghcup/bin/ghcup RUN chmod a+x $HOME/.ghcup/bin/ghcup ENV PATH=$PATH:/root/.ghcup/bin/ ENV PATH=$PATH:/root/.cabal/bin/ RUN apt-get install --yes curl RUN apt-get install --yes gcc make libgmp3-dev g++ SHELL ["/bin/bash", "-c"] RUN ghcup install ghc 9.4.7 RUN ghcup install cabal 3.8 RUN ghcup set ghc 9.4.7 RUN cabal update CMD git clone $REPO && \ cd $NAME && \ git checkout $COMMIT && \ cd copilot-language && \ cabal test . && \ echo Success
docker run -e "REPO=https://github.com/ivanperez-keera/copilot" -e "NAME=copilot" -e "COMMIT=e25c7afaf743a5fdc7a9638516f59b006383bef0" -it copilot-verify-469
- The code proposed compiles and passes all tests. Details:
- Implementation is documented. Details:
Internal change; no changes to the documentation are needed, and a comment is added to ensure that future revisions do not remove the change accidentally. - Change history is clear.
- Commit messages are clear.
- Changelogs are updated.
- Examples are updated. Details:
No updates needed. - Required version bumps are evaluated. Details:
Bump not needed (internal change to tests; does not affect API).
from copilot.
Change Manager: Implementation ready to be merged.
from copilot.
Related Issues (20)
- `copilot-c99`: test failure on non-Intel architectures HOT 21
- `copilot-language`: `Copilot.Language.Spec.forall` will be forbidden HOT 7
- `copilot-c99`: compiler warnings during tests HOT 10
- `copilot-c99`: compliance with MISRA C 2012 HOT 8
- `copilot-theorem`: Introduce testing infrastructure HOT 6
- `copilot-libraries`: Introduce testing infrastructure HOT 6
- `copilot`: Update README to reflect new contribution process
- `copilot-core`: record field `uTypeType` is unnecessary
- Release 3.18 HOT 6
- `copilot`: Extend range of versions `optparse-applicative` HOT 6
- `copilot-theorem`: Failure to compile with GHC 9.6.3 HOT 6
- Release 3.18.1 HOT 6
- `copilot-theorem`: `kind2Prover` gives parse error when disproving a property HOT 10
- ' ' is not a nondigit error HOT 4
- Formal methods with stateful functions HOT 4
- `copilot-core`: Remove deprecated functions in `Copilot.Core.Type` and `Copilot.Core.Type.Array` HOT 6
- `copilot-core`: Increase test coverage HOT 6
- Release 3.19 HOT 6
- `copilot-c99`: Can C99 generator declare stream functions as static? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from copilot.