You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot set OPTIONS pragma --allow-unsolved-metas with safe flag. #5098
I want to generate HTML for some code with unfinished goals.
$ agda --html JVM.agda
Checking JVM (/Users/abel/Teaching/PLT/2017/www/live/2020/JVM.agda).
Unsolved interaction metas at the following locations:
/Users/abel/Teaching/PLT/2017/www/live/2020/JVM.agda:243,60-64
Well, then let's allow solved metas:
$ agda --html --allow-unsolved-metas JVM.agda
Checking JVM (/Users/abel/Teaching/PLT/2017/www/live/2020/JVM.agda).
Checking Relation.Binary.PropositionalEquality (/Users/abel/agda-erasure/std-lib/src/Relation/Binary/PropositionalEquality.agda).
Checking Axiom.Extensionality.Propositional (/Users/abel/agda-erasure/std-lib/src/Axiom/Extensionality/Propositional.agda).
Checking Function.Base (/Users/abel/agda-erasure/std-lib/src/Function/Base.agda).
Checking Level (/Users/abel/agda-erasure/std-lib/src/Level.agda).
/Users/abel/agda-erasure/std-lib/src/Function/Base.agda:13,1-18
Cannot set OPTIONS pragma --allow-unsolved-metas with safe flag.
when scope checking the declaration
open import Level
That's silly.
I think the current logic is a bit too crude, requiring the user to jump through hoops.
It is not unsafe to --allow-unsolved-metasper se, it is only unsafe to have unsolved metas.
So, the error should be thrown more lazily. It should be an error to have an unsolved meta either if --safe is on or if --allow-unsolved-metas is off, but it should not be an error just to have both --safe and --allow-unsolved-metas in sight.
In other words, --allow-unsolved-metas should simply have no effect in --safe modules.
It is quite handy to have an error when conflicting options are
set. The problem here IMO is that we do not differentiate between
CLI arguments and options set in a file. We should instead allow
the ones set in a file to make stricter requirements of the code.
IIRC at the moment we just combine the two lists of strings and
parse the result (?) as if it were all set in one place.
Well, yeah, but you've also enabled --safe (or are using a library that enabled
it but did not deliver safe code). It's just as confusing as the concept of
(co)infective options IMO.
Atm, --allow-unsolved-metas is next to obsolete as a command-line option, since it clashes with --safe in the most basic builtin modules.
$ echo "import Agda.Builtin.Nat" > Foo.agda
$ agda --allow-unsolved-metas Foo.agda
Checking Foo.
Foo.agda:1,1-24
Cannot set OPTIONS pragma --allow-unsolved-metas with safe flag.
when scope checking the declaration
import Agda.Builtin.Nat
I'd like to fix this without drilling up the whole option machinery.
If I go with my original proposal, this doesn't close the door to a more systematic overhaul of the options logic.
Activity
gallais commentedon Dec 15, 2020
It is quite handy to have an error when conflicting options are
set. The problem here IMO is that we do not differentiate between
CLI arguments and options set in a file. We should instead allow
the ones set in a file to make stricter requirements of the code.
IIRC at the moment we just combine the two lists of strings and
parse the result (?) as if it were all set in one place.
andreasabel commentedon Dec 15, 2020
@gallais : Well, this could be another solution:
--safewill switch off--allow-unsolved-metas, but not vice versa.[ cosmetics for #5098 ] use LambdaCase
[ code comprehension re #5098 ] rename SourceInfo to Source
[ code comprehension re #5098 ] rename SourceInfo to Source
nad commentedon Dec 16, 2020
Couldn't this lead to confusion? "I've enabled
--allow-unsolved-metas, but Agda still complains!"gallais commentedon Dec 16, 2020
Well, yeah, but you've also enabled
--safe(or are using a library that enabledit but did not deliver safe code). It's just as confusing as the concept of
(co)infective options IMO.
andreasabel commentedon Dec 16, 2020
Atm,
--allow-unsolved-metasis next to obsolete as a command-line option, since it clashes with--safein the most basic builtin modules.I'd like to fix this without drilling up the whole option machinery.
If I go with my original proposal, this doesn't close the door to a more systematic overhaul of the options logic.
andreasabel commentedon Jan 27, 2021
Not the most urgent issue, bumping milestone to 2.6.3.