8000 compiler: fix namespace elimination & separate compilation by gares · Pull Request #337 · LPCIC/elpi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

compiler: fix namespace elimination & separate compilation #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 74 additions & 2 deletions .github/workflows/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
branches: [ master ]

jobs:
test-users:
name: "test users"
test-users-mc:
name: "test users: math-comp"
runs-on: ubuntu-latest
env:
OPAMWITHTEST: true
Expand Down Expand Up @@ -39,3 +39,75 @@ jobs:
- run: opam pin --ignore-constraints-on elpi add rocq-mathcomp-algebra https://github.com/math-comp/math-comp.git#master
- run: opam pin --ignore-constraints-on elpi add rocq-mathcomp-solvable https://github.com/math-comp/math-comp.git#master
- run: opam pin --ignore-constraints-on elpi add rocq-mathcomp-field https://github.com/math-comp/math-comp.git#master

test-users-br:
name: "test users: bluerock.io"
runs-on: ubuntu-latest
env:
OPAMWITHTEST: true
OPAMVERBOSE: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: git setup
run: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git switch -c branch

- name: opam setup
run: |
sudo apt-get install swi-prolog libclang-dev
curl -fsSL https://opam.ocaml.org/install.sh > install-opam.sh
chmod a+x install-opam.sh
yes '' | ./install-opam.sh
opam init --bare --disable-sandboxing

- name: fm workspace setup
run: |
git clone https://github.com/bluerock-io/fm-workspace.git
cd fm-workspace
export OPAMYES=true
./setup-fmdeps.sh -p
opam switch set `opam switch list 2>&1| grep br|sed 's/ */ /g'| cut -d ' ' -f 2`
opam switch

- name: merge elpi
run: |
E="$PWD"
cd fm-workspace/fmdeps/elpi
git remote add this file://$E/
git remote update this
git merge this/branch -Xtheirs -m ci
git show HEAD

- name: overlay coq-elpi
run: |
cd fm-workspace/fmdeps/coq-elpi
git remote add this https://github.com/LPCIC/coq-elpi.git
git remote update this
git merge this/fix-elpi-3.0 -Xtheirs -m ci
git show HEAD

- name: overlay brick
run: |
cd fm-workspace/fmdeps/cpp2v-core
git remote add this https://github.com/gares/brick.git
git remote update this
git merge this/elpi-3.0 -Xtheirs -m ci
git show HEAD

- name: build bluerock-prelude/theories/elpi
run: |
cd fm-workspace
eval $(opam env)
opam switch
which ocamlc
dune build fmdeps/cpp2v-core/rocq-bluerock-prelude/theories/elpi/ --stop-on-first-error





2 changes: 1 addition & 1 deletion src/compiler/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ module Flatten : sig
| Const(Global { escape_ns = false },c,ty) -> let c' = f c in if c == c' then it else Const(Scope.mkGlobal (),c',ty)
| Spill(t,n) -> let t' = aux_loc t in if t' == t then it else Spill(t',n)
| App((scope,c,ty),x,xs) ->
let c' = if scope = Scope.mkGlobal () then f c else c in
let c' = match scope with Global { escape_ns = false } -> f c | _ -> c in
let x' = aux_loc x in
let xs' = smart_map aux_loc xs in
if c == c' && x == x' && xs == xs' then it
Expand Down
6 changes: 5 additions & 1 deletion src/compiler/compiler_data.ml
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,11 @@ end = struct
let resolve env r s =
match !r with
| None -> r := Some s
| Some s' -> assert(TypingEnv.same_symbol env s' s); r := Some s
| Some s' ->
if not @@ TypingEnv.same_symbol env s' s then
anomaly ("SymbolResolver: new " ^ Symbol.show s ^ " != old " ^ Symbol.show s');
r := Some s

let resolved_to env r =
match !r with
| None -> None
Expand Down
Loading
0