Skip to content

Comments

fix(packages): compact compiler script#148

Merged
0xisk merged 1 commit intomainfrom
enhance/compact-compiler-script
Jul 22, 2025
Merged

fix(packages): compact compiler script#148
0xisk merged 1 commit intomainfrom
enhance/compact-compiler-script

Conversation

@0xisk
Copy link
Member

@0xisk 0xisk commented Jun 17, 2025

Description

Blocked By #172

This PR fixes the runCompiler script to show the output of the compilation results.

After:

> @midnight-dapps/math-contracts@1.0.0-alpha.1 build /home/iskander/Projects/midnight-dapps/contracts/math
> pnpm exec compact-builder && tsc

ℹ [BUILD] Compact Builder started
ℹ [COMPILE] COMPACT_HOME: /home/iskander/Downloads/compactc-linux-0.23.0
ℹ [COMPILE] COMPACTC_PATH: /home/iskander/Downloads/compactc-linux-0.23.0/compactc
ℹ [COMPILE] Found 15 .compact file(s) to compile
  [COMPILE] [1/15] compactc Index.compact
Compactc version: 0.23.0
✔ [COMPILE] [1/15] ✓ Index.compact
  [COMPILE] [2/15] compactc MathU128.compact
Compactc version: 0.23.0
✔ [COMPILE] [2/15] ✓ MathU128.compact
  [COMPILE] [3/15] compactc MathU256.compact
Compactc version: 0.23.0
✔ [COMPILE] [3/15] ✓ MathU256.compact
  [COMPILE] [4/15] compactc MathU64.compact
Compactc version: 0.23.0
✔ [COMPILE] [4/15] ✓ MathU64.compact
  [COMPILE] [5/15] compactc Max.compact
Compactc version: 0.23.0
✔ [COMPILE] [5/15] ✓ Max.compact
  [COMPILE] [6/15] compactc interfaces/IMath.compact
Compactc version: 0.23.0
✔ [COMPILE] [6/15] ✓ interfaces/IMath.compact
  [COMPILE] [7/15] compactc interfaces/IMathU128.compact
Compactc version: 0.23.0
✔ [COMPILE] [7/15] ✓ interfaces/IMathU128.compact
  [COMPILE] [8/15] compactc interfaces/IMathU256.compact
Compactc version: 0.23.0
✔ [COMPILE] [8/15] ✓ interfaces/IMathU256.compact
  [COMPILE] [9/15] compactc interfaces/IMathU64.compact
Compactc version: 0.23.0
✔ [COMPILE] [9/15] ✓ interfaces/IMathU64.compact
  [COMPILE] [10/15] compactc interfaces/IUint128.compact
Compactc version: 0.23.0
✔ [COMPILE] [10/15] ✓ interfaces/IUint128.compact
  [COMPILE] [11/15] compactc interfaces/IUint256.compact
Compactc version: 0.23.0
✔ [COMPILE] [11/15] ✓ interfaces/IUint256.compact
  [COMPILE] [12/15] compactc test/mock/MockMathU128.compact
Compactc version: 0.23.0
Compiling 15 circuits:
  circuit "add" (k=10, rows=575)  
  circuit "addU128" (k=10, rows=451)  
  circuit "div" (k=12, rows=2763)  
  circuit "divRem" (k=12, rows=2804)  
  circuit "divRemU128" (k=12, rows=2680)  
  circuit "divU128" (k=12, rows=2626)  
  circuit "isMultiple" (k=12, rows=2744)  
  circuit "isMultipleU128" (k=12, rows=2620)  
  circuit "mul" (k=11, rows=1874)  
  circuit "mulU128" (k=11, rows=1750)  
  circuit "rem" (k=12, rows=2763)  
  circuit "remU128" (k=12, rows=2626)  
  circuit "sqrt" (k=12, rows=3525)  
  circuit "sqrtU128" (k=12, rows=3453)  
  circuit "toU128" (k=10, rows=158)  
✔ [COMPILE] [12/15] ✓ test/mock/MockMathU128.compact                               
  [COMPILE] [13/15] compactc test/mock/MockMathU256.compact
Compactc version: 0.23.0
Compiling 8 circuits:
  circuit "add" (k=11, rows=1305)  
  circuit "div" (k=14, rows=10878)  
  circuit "divRem" (k=14, rows=10986)  
  circuit "isMultiple" (k=14, rows=10863)  
  circuit "mul" (k=14, rows=9249)  
  circuit "rem" (k=14, rows=10878)  
  circuit "sqrt" (k=14, rows=11693)  
  circuit "sub" (k=11, rows=1271)  
✔ [COMPILE] [13/15] ✓ test/mock/MockMathU256.compact                               
  [COMPILE] [14/15] compactc test/mock/MockMathU64.compact
Compactc version: 0.23.0
Compiling 5 circuits:
  circuit "div" (k=10, rows=240)  
  circuit "divRem" (k=10, rows=277)  
  circuit "isMultiple" (k=10, rows=243)  
  circuit "rem" (k=10, rows=240)  
  circuit "sqrt" (k=10, rows=122)  
✔ [COMPILE] [14/15] ✓ test/mock/MockMathU64.compact                                
  [COMPILE] [15/15] compactc test/mock/MockMax.compact
Compactc version: 0.23.0
✔ [COMPILE] [15/15] ✓ test/mock/MockMax.compact
✔ [BUILD] [1/3] Compiling TypeScript
✔ [BUILD] [2/3] Copying artifacts
✔ [BUILD] [3/3] Copying and cleaning .compact files

@0xisk 0xisk requested a review from a team as a code owner June 17, 2025 11:45
@0xisk 0xisk changed the title enhance: compact compiler script fix(packages): compact compiler script Jun 17, 2025
@0xisk 0xisk force-pushed the enhance/compact-compiler-script branch from 6ca7f6d to f0a4de8 Compare June 17, 2025 12:10
@0xisk 0xisk moved this to In review in OZ Development for Midnight Jun 17, 2025
@0xisk 0xisk added the bug label Jun 17, 2025
@0xisk 0xisk self-assigned this Jun 17, 2025
Copy link
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting the output now! Though, there's a ton of repetition. I assume this is not expected bc it differs from the PR comment output?—I'm running pnpm install && pnpm run compact (I also tried pnpm build:contracts with the same result). Can you confirm?

@midnight-dapps/access-contract:compact: > pnpm exec compact-compiler
@midnight-dapps/access-contract:compact: 
ℹ [COMPILE] Compact Compiler startedact: 
ℹ [COMPILE] COMPACT_HOME: /Users/johngalt/my-binaries
ℹ [COMPILE] COMPACTC_PATH: /Users/johngalt/my-binaries/compactc
ℹ [COMPILE] Found 3 .compact file(s) to compile
  [COMPILE] [1/3] compactc AccessControl.compact
@midnight-dapps/access-contract:compact: (node:73762) [DEP0178] DeprecationWarning: dirent.path is deprecated in favor of dirent.parentPath
@midnight-dapps/access-contract:compact: (Use `node --trace-deprecation ...` to show where the warning was created)
ℹ [COMPILE] Compact Compiler started 
ℹ [COMPILE] COMPACT_HOME: /Users/johngalt/my-binaries
ℹ [COMPILE] COMPACTC_PATH: /Users/johngalt/my-binaries/compactc
ℹ [COMPILE] Found 1 .compact file(s) to compile
  [COMPILE] [1/1] compactc Index.compact
@midnight-dapps/compact-std:compact: (node:73763) [DEP0178] DeprecationWarning: dirent.path is deprecated in favor of dirent.parentPath
@midnight-dapps/compact-std:compact: (Use `node --trace-deprecation ...` to show where the warning was created)
ℹ [COMPILE] Compact Compiler startedmpact: 
ℹ [COMPILE] COMPACT_HOME: /Users/johngalt/my-binaries
ℹ [COMPILE] COMPACTC_PATH: /Users/johngalt/my-binaries/compactc
ℹ [COMPILE] Found 2 .compact file(s) to compile
  [COMPILE] [1/2] compactc Queue.compact
@midnight-dapps/structs-contracts:compact: (node:73764) [DEP0178] DeprecationWarning: dirent.path is deprecated in favor of dirent.parentPath
@midnight-dapps/structs-contracts:compact: (Use `node --trace-deprecation ...` to show where the warning was created)
@midnight-dapps/access-contract:compact: Compactc version: 0.23.0
@midnight-dapps/compact-std:compact: Compactc version: 0.23.0
@midnight-dapps/structs-contracts:compact: Compactc version: 0.23.0
✔ [COMPILE] [1/3] ✓ AccessControl.compact
  [COMPILE] [2/3] compactc Index.compact
✔ [COMPILE] [1/1] ✓ Index.compactct: 
@midnight-dapps/compact-std:compact: 
✔ [COMPILE] [1/2] ✓ Queue.compact:compact: 
  [COMPILE] [2/2] compactc test/mock/MockQueue.compact
@midnight-dapps/access-contract:compact: Compactc version: 0.23.0
@midnight-dapps/structs-contracts:compact: Compactc version: 0.23.0
✔ [COMPILE] [2/3] ✓ Index.compactompact: 
  [COMPILE] [3/3] compactc test/mock/MockAccessControl.compact
@midnight-dapps/access-contract:compact: Compactc version: 0.23.0
@midnight-dapps/structs-contracts:compact: Compiling 3 circuits:
@midnight-dapps/structs-contracts:compact:   circuit "dequeue" |                                                                               
                                             circuit "dequeue" (k=10) |                                                                        
                                             circuit "dequeue" (k=10, rows=250) |                                                              
                                             circuit "dequeue" (k=10, rows=250) |
@midnight-dapps/access-contract:compact: Compiling 1 circuits:
                                             circuit "dequeue" (k=10, rows=250) |
                                             circuit "dequeue" (k=10, rows=250) |
                                             circuit "dequeue" (k=10, rows=250) |
                                             circuit "dequeue" (k=10, rows=250) |
                                             circuit "dequeue" (k=10, rows=250) |
                                             circuit "dequeue" (k=10, rows=250) |
                                             circuit "dequeue" (k=10, rows=250) |
                                             circuit "dequeue" (k=10, rows=250) /
                                             circuit "dequeue" (k=10, rows=250) -
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
@midnight-dapps/structs-contracts:compact:   circuit "enqueue" (k=10, rows=54)  
@midnight-dapps/structs-contracts:compact:   circuit "isEmpty" (k=10, rows=37) /
@midnight-dapps/access-contract:compact:   circuit "testGrantRole" |                                                                           
                                           circuit "testGrantRole" (k=16) |                                                                    
                                           circuit "testGrantRole" (k=16, rows=58342) |                                                        
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                             circuit "dequeue" (k=10, rows=250)  
@midnight-dapps/structs-contracts:compact:   circuit "enqueue" (k=10, rows=54)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
                                             circuit "dequeue" (k=10, rows=250)  
@midnight-dapps/structs-contracts:compact:   circuit "enqueue" (k=10, rows=54)  
@midnight-dapps/structs-contracts:compact:   circuit "isEmpty" (k=10, rows=37)  
@midnight-dapps/structs-contracts:compact: Overall progress [====================] 3/3                                                         ✔ [COMPILE] [2/2] ✓ test/mock/MockQueue.compact
@midnight-dapps/structs-contracts:compact: 
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342) -
                                           circuit "testGrantRole" (k=16, rows=58342) \
                                           circuit "testGrantRole" (k=16, rows=58342) |
                                           circuit "testGrantRole" (k=16, rows=58342) /
                                           circuit "testGrantRole" (k=16, rows=58342)  
                                           circuit "testGrantRole" (k=16, rows=58342)  
                                           circuit "testGrantRole" (k=16, rows=58342)  
                                           circuit "testGrantRole" (k=16, rows=58342)  
@midnight-dapps/access-contract:compact: Overall progress [====================] 1/1                                                           ✔ [COMPILE] [3/3] ✓ test/mock/MockAccessControl.compact
@midnight-dapps/access-contract:compact:

@0xisk
Copy link
Member Author

0xisk commented Jun 17, 2025

I'm getting the output now! Though, there's a ton of repetition. I assume this is not expected bc it differs from the PR comment output?—I'm running pnpm install && pnpm run compact (I also tried pnpm build:contracts with the same result). Can you confirm?

@midnight-dapps/access-contract:compact: > pnpm exec compact-compiler
@midnight-dapps/access-contract:compact: 
ℹ [COMPILE] Compact Compiler startedact: 
ℹ [COMPILE] COMPACT_HOME: /Users/johngalt/my-binaries
ℹ [COMPILE] COMPACTC_PATH: /Users/johngalt/my-binaries/compactc
ℹ [COMPILE] Found 3 .compact file(s) to compile

Good catch, I spent sometime looking into that it seems an issue with Turbo output logging, as it deals with that looping animation as a new line for each loop. 😅

I tried with this command: "compact": "turbo run compact --log-prefix none --verbosity 0",

pnpm compact --force

> midnight-dapps@1.0.0 compact /home/iskander/Projects/midnight-dapps
> turbo run compact --log-prefix none --verbosity 0 --force

╭──────────────────────────────────────────────────────────────────────────╮
│                                                                          │
│                     Update available v2.5.3 ≫ v2.5.4                     │
│    Changelog: https://github.com/vercel/turborepo/releases/tag/v2.5.4    │
│          Run "pnpm dlx @turbo/codemod@latest update" to update           │
│                                                                          │
│          Follow @turborepo for updates: https://x.com/turborepo          │
╰──────────────────────────────────────────────────────────────────────────╯
turbo 2.5.3

• Packages in scope: @midnight-dapps/access-contract, @midnight-dapps/biome-config, @midnight-dapps/compact, @midnight-dapps/compact-std, @midnight-dapps/lunarswap-ui, @midnight-dapps/math-contracts, @midnight-dapps/structs-contracts
• Running compact in 7 packages
• Remote caching disabled
cache bypass, force executing b0440aed32b43f3e

cache bypass, force executing 50c585764742ff76

cache bypass, force executing 037f1082f388d5ad


> @midnight-dapps/access-contract@1.0.0-alpha.1 compact /home/iskander/Projects/midnight-dapps/contracts/access
> pnpm exec compact-compiler


> @midnight-dapps/compact-std@1.0.0-alpha.1 compact /home/iskander/Projects/midnight-dapps/packages/compact-std
> pnpm exec compact-compiler


> @midnight-dapps/structs-contracts@1.0.0-alpha.1 compact /home/iskander/Projects/midnight-dapps/contracts/structs
> pnpm exec compact-compiler

ℹ [COMPILE] Compact Compiler started
ℹ [COMPILE] COMPACT_HOME: /home/iskander/Downloads/compactc-linux-0.23.0
ℹ [COMPILE] COMPACTC_PATH: /home/iskander/Downloads/compactc-linux-0.23.0/compactc
ℹ [COMPILE] Found 2 .compact file(s) to compile
  [COMPILE] [1/2] compactc Queue.compact
ℹ [COMPILE] Compact Compiler started
ℹ [COMPILE] COMPACT_HOME: /home/iskander/Downloads/compactc-linux-0.23.0
ℹ [COMPILE] COMPACTC_PATH: /home/iskander/Downloads/compactc-linux-0.23.0/compactc
ℹ [COMPILE] Found 3 .compact file(s) to compile
  [COMPILE] [1/3] compactc AccessControl.compact
ℹ [COMPILE] Compact Compiler started
ℹ [COMPILE] COMPACT_HOME: /home/iskander/Downloads/compactc-linux-0.23.0
ℹ [COMPILE] COMPACTC_PATH: /home/iskander/Downloads/compactc-linux-0.23.0/compactc
ℹ [COMPILE] Found 1 .compact file(s) to compile
  [COMPILE] [1/1] compactc Index.compact
Compactc version: 0.23.0
Compactc version: 0.23.0
Compactc version: 0.23.0
✔ [COMPILE] [1/2] ✓ Queue.compact
  [COMPILE] [2/2] compactc test/mock/MockQueue.compact
✔ [COMPILE] [1/3] ✓ AccessControl.compact
  [COMPILE] [2/3] compactc Index.compact
✔ [COMPILE] [1/1] ✓ Index.compact

Compactc version: 0.23.0
Compactc version: 0.23.0
✔ [COMPILE] [2/3] ✓ Index.compact
  [COMPILE] [3/3] compactc test/mock/MockAccessControl.compact
Compiling 3 circuits:
  circuit "dequeue" (k=10, rows=250) |
  circuit "dequeue" (k=10, rows=250) -
  circuit "dequeue" (k=10, rows=250)  
  circuit "enqueue" (k=10, rows=54)  
  circuit "isEmpty" (k=10, rows=37)  
✔ [COMPILE] [2/2] ✓ test/mock/MockQueue.compact                                                          

  circuit "testGrantRole" (k=16, rows=58342)  
✔ [COMPILE] [3/3] ✓ test/mock/MockAccessControl.compact                                                  


 Tasks:    3 successful, 3 total
Cached:    0 cached, 3 total
  Time:    14.685s 

As you see it was not repeated in the testGrantRole, but it was repeated in dequeue, and I dont really know why!

@0xisk
Copy link
Member Author

0xisk commented Jun 17, 2025

I'm getting the output now! Though, there's a ton of repetition. I assume this is not expected bc it differs from the PR comment output?—I'm running pnpm install && pnpm run compact (I also tried pnpm build:contracts with the same result). Can you confirm?

BUT it works properly if you are running pnpm compact from inside each package,

pnpm compact

> @midnight-dapps/access-contract@1.0.0-alpha.1 compact /home/iskander/Projects/midnight-dapps/contracts/access
> pnpm exec compact-compiler

ℹ [COMPILE] Compact Compiler started
ℹ [COMPILE] COMPACT_HOME: /home/iskander/Downloads/compactc-linux-0.23.0
ℹ [COMPILE] COMPACTC_PATH: /home/iskander/Downloads/compactc-linux-0.23.0/compactc
ℹ [COMPILE] Found 3 .compact file(s) to compile
  [COMPILE] [1/3] compactc AccessControl.compact
Compactc version: 0.23.0
✔ [COMPILE] [1/3] ✓ AccessControl.compact
  [COMPILE] [2/3] compactc Index.compact
Compactc version: 0.23.0
✔ [COMPILE] [2/3] ✓ Index.compact
  [COMPILE] [3/3] compactc test/mock/MockAccessControl.compact
Compactc version: 0.23.0
Compiling 1 circuits:
  circuit "testGrantRole" (k=16, rows=58342)  
✔ [COMPILE] [3/3] ✓ test/mock/MockAccessControl.compact                       

@andrew-fleming
Copy link
Contributor

I'm getting the output now! Though, there's a ton of repetition. I assume this is not expected bc it differs from the PR comment output?—I'm running pnpm install && pnpm run compact (I also tried pnpm build:contracts with the same result). Can you confirm?

BUT it works properly if you are running pnpm compact from inside each package,

If it's okay with you, I think we should keep working on this so that it outputs correctly both ways. We're fixing a bug but introducing another haha LMK if you disagree

Copy link
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned offline, we can approve and merge this. The only thing though is I'd change the README on how to compile bc pnpm build:contracts is compiling from root where the crazy output bug is occurring. Let's update that and then we're good to go :)

@0xisk 0xisk force-pushed the enhance/compact-compiler-script branch from f0a4de8 to eca0c3e Compare July 8, 2025 09:10
@0xisk
Copy link
Member Author

0xisk commented Jul 8, 2025

As mentioned offline, we can approve and merge this. The only thing though is I'd change the README on how to compile bc pnpm build:contracts is compiling from root where the crazy output bug is occurring. Let's update that and then we're good to go :)

Updated, also opened this feature request: https://github.com/midnightntwrk/compactc/issues/1188

Copy link
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a tiny suggestion and a comment, but LGTM!

@0xisk 0xisk force-pushed the enhance/compact-compiler-script branch from 2c1cae6 to 72546a1 Compare July 16, 2025 10:20
@0xisk 0xisk requested a review from andrew-fleming July 16, 2025 10:21
@0xisk 0xisk force-pushed the enhance/compact-compiler-script branch from 72546a1 to 880ba88 Compare July 16, 2025 10:22
Copy link
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should def fix this CI issue but in case this is blocking other work :) Nice work!

@0xisk 0xisk force-pushed the enhance/compact-compiler-script branch 2 times, most recently from 633ac7f to cf70213 Compare July 17, 2025 13:27
@0xisk
Copy link
Member Author

0xisk commented Jul 17, 2025

We should def fix this CI issue but in case this is blocking other work :) Nice work!

Sure that is fixed now by this PR: #172

@0xisk 0xisk force-pushed the enhance/compact-compiler-script branch from cf70213 to 3893a92 Compare July 22, 2025 14:03
@0xisk 0xisk requested a review from andrew-fleming July 22, 2025 14:05
@0xisk 0xisk merged commit b6dea24 into main Jul 22, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from In review to Resolved in OZ Development for Midnight Jul 22, 2025
@0xisk 0xisk deleted the enhance/compact-compiler-script branch July 22, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Complete/Stable Release

Development

Successfully merging this pull request may close these issues.

2 participants