Skip to content

Conversation

@ivanperez-keera
Copy link
Member

Remove the deprecated fields of the type Copilot.Core.Expr.UExpr, as prescribed in the solution proposed for #636.

@ivanperez-keera
Copy link
Member Author

Change Manager: The commit message for the main commit has a grammatical error (singular instead of plural).

Copilot-Language#636.

The record fields uExprExpr and uExprType, part of Copilot.Core.Expr,
are never really used within the module or in any other part of Copilot
or, as far as we know, by any user of Copilot. The record fields were
deprecated in Copilot 4.2 and no messages have been received requesting
that they be kept in this library. As per our internal policy of waiting
3 versions from deprecation until a public interface declaration can be
removed, these definitions can now be removed.

This commit removes the fields uExprType and uExprExpr from the
definition of Copilot.Core.Expr.UExpr, making the type no longer a
record.
@ivanperez-keera ivanperez-keera force-pushed the develop-remove-UExpr-fields branch from e8ee7e4 to 2f4cc73 Compare June 28, 2025 20:02
@ivanperez-keera
Copy link
Member Author

Implementor: Fix implemented, review requested.

@ivanperez-keera
Copy link
Member Author

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/275614061
    • The solution proposed produces the expected result. Details:
      The following Dockerfile tries to import the deprecated record fields, succeeding only when the import fails, after which prints the message "Success":
      FROM ubuntu:focal
      
      ENV DEBIAN_FRONTEND=noninteractive
      RUN apt-get update
      
      RUN apt-get install --yes \
            libz-dev \
            git \
            curl \
            gcc \
            g++ \
            make \
            libgmp3-dev  \
            pkg-config \
            z3
      
      RUN mkdir -p $HOME/.ghcup/bin
      RUN curl https://downloads.haskell.org/~ghcup/0.1.40.0/x86_64-linux-ghcup-0.1.40.0 -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/
      
      SHELL ["/bin/bash", "-c"]
      
      RUN ghcup install ghc 9.10.1
      RUN ghcup install cabal 3.2
      RUN ghcup set ghc 9.10.1
      RUN cabal update
      
      SHELL ["/bin/bash", "-c"]
      CMD git clone $REPO && cd $NAME && git checkout $COMMIT && cd .. \
        && cabal v1-sandbox init \
        && cabal v1-install alex happy --constraint='happy <= 2' \
        && cabal v1-install $NAME/copilot/ \
                            $NAME/copilot-c99/ \
                            $NAME/copilot-core/ \
                            $NAME/copilot-prettyprinter/ \
                            $NAME/copilot-interpreter/ \
                            $NAME/copilot-language/ \
                            $NAME/copilot-libraries/ \
                            $NAME/copilot-theorem/ \
        && ! cabal v1-exec -- runhaskell <<< 'import Copilot.Core(uExprExpr, uExprType); main = return ()' \
        && echo "Success"
      Command (substitute variables based on new path after merge):
      $ docker run -e REPO=https://github.com/ivanperez-keera/copilot -e NAME=copilot -e COMMIT=2f4cc73a5f6db04fdd3bbabca6e52d35d011836e copilot-verify-634
      
  • Implementation is documented. Details:
    No updates needed; change removes definitions not mentioned in the documentation.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No updates needed; change removes definitions not mentioned in the examples.
  • Author is internal or has provided signed CLA.
  • Required version bumps are evaluated. Details:
    Bump required; change affects the API.

@ivanperez-keera ivanperez-keera merged commit 59fec12 into Copilot-Language:master Jun 28, 2025
1 check passed
@ivanperez-keera ivanperez-keera deleted the develop-remove-UExpr-fields branch June 28, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant