Skipping compilation for up-to-date files results in mis-compilation
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- haskell
- Domain
- build-system, tooling
Research direction
Start by reading the compilation path that handles up-to-date files and the generated Haskell for Issue486.File1 and Issue486.File2. Reproduce the sequence in the issue: compile from scratch, remove the generated Issue486.File2.hs, then compile again. Done means the regenerated file correctly compiles away Vec and num, as it does on a clean build.
Written by the indexing model from the issue text.
Description
Consider the following files:
module Issue486.File1 where
open import Haskell.Prelude
private variable
@0 n : Nat
data Vec (a : Type) : @0 Nat → Type where
[] : Vec a zero
_∷_ : a → Vec a n → Vec a (suc n)
{-# COMPILE AGDA2HS Vec to List #-}
foo : Vec a 0
foo = []
{-# COMPILE AGDA2HS foo #-}
num : Nat
num = 42
{-# COMPILE AGDA2HS num inline #-}
module Issue486.File2 where
open import Haskell.Prelude
open import Issue486.File1
bar : Vec a 0
bar = foo
{-# COMPILE AGDA2HS bar #-}
num' : Nat
num' = num
{-# COMPILE AGDA2HS num' #-}
agda2hs generates correct code if we start from scratch. However, if we then remove Issue485.File2.hs and compile again, agda2hs generates this invalid code in which Vec and num aren't compiled away:
module Issue486.File2
(bar, num')
where
import Issue486.File1 (Vec, foo, num)
import Numeric.Natural (Natural)
bar :: Vec a
bar = foo
num' :: Natural
num' = num
- Dominant language
- Agda
- Stars
- 211
- Forks
- 51
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from agda/agda2hs
-
Refine the fix of #142Possibly taken @jespercockx claimed this 1 day ago. Openenhancement
agda/agda2hs#494 · 1 assignee ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 8/100
Maintainers usually reply within 1 day
-
bug library
Difficulty 4/5 3-5 days Newbie friendliness 45/100
agda/agda2hs#488 · 1 comment ·
Maintainers usually reply within 1 day
-
bug library
Difficulty 4/5 3-5 days Newbie friendliness 49/100
agda/agda2hs#487 · 3 comments ·
Maintainers usually reply within 1 day
-
Compile reexport of individual itemsPossibly taken @wasabi315 claimed this 10 days ago. Openenhancement
agda/agda2hs#484 · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
ready-for-agent tech-debt
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
DigiBanks99/menlo#640 ·
Maintainers usually reply within 1 day
-
releases.rb silent failure cascades into NoMethodError crashes in downstream extensionsPossibly taken @Rucha0901 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jenkins-infra/jenkins.io#9598 ·
Maintainers usually reply within 1 day