Skip to content

Cannot set OPTIONS pragma --allow-unsolved-metas with safe flag. #5098

Open

Description

@andreasabel

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-metas per 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.

Cf. the discussion at #4649.

Activity

  1. added
    safe
    allow-unsolved-metas
    on Dec 15, 2020
  2. added this to the 2.6.2 milestone on Dec 15, 2020
  3. gallais commented on Dec 15, 2020

    @gallais
    Member

    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.

  4. andreasabel commented on Dec 15, 2020

    @andreasabel
    MemberAuthor

    @gallais : Well, this could be another solution: --safe will switch off --allow-unsolved-metas, but not vice versa.

  5. added 3 commits that reference this issue on Dec 15, 2020
  6. nad commented on Dec 16, 2020

    @nad
    Collaborator

    @gallais : Well, this could be another solution: --safe will switch off --allow-unsolved-metas, but not vice versa.

    Couldn't this lead to confusion? "I've enabled --allow-unsolved-metas, but Agda still complains!"

  7. gallais commented on Dec 16, 2020

    @gallais
    Member

    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.

  8. andreasabel commented on Dec 16, 2020

    @andreasabel
    MemberAuthor

    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.

  9. andreasabel commented on Jan 27, 2021

    @andreasabel
    MemberAuthor

    Not the most urgent issue, bumping milestone to 2.6.3.

  10. modified the milestones: 2.6.2, 2.6.3 on Jan 27, 2021
  11. modified the milestones: 2.6.3, icebox on Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    allow-unsolved-metassafe

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions