Skip to content

Commit

Permalink
Standardize optimization flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Oct 23, 2024
1 parent 3420cf3 commit a85132c
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bundle-ucm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
tries=5
for (( i = 0; i < $tries; i++ )); do
stack build :unison \
--flag unison-parser-typechecker:optimized \
--ghc-options='-O2' \
--local-bin-path ucm-bin \
--copy-bins \
&& break;
Expand Down
2 changes: 1 addition & 1 deletion lib/unison-hash/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: unison-hash
github: unisonweb/unison
copyright: Copyright (C) 2013-2021 Unison Computing, PBC and contributors

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

dependencies:
- base
Expand Down
4 changes: 2 additions & 2 deletions lib/unison-hash/unison-hash.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -49,7 +49,7 @@ library
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base
, bytestring
Expand Down
2 changes: 1 addition & 1 deletion lib/unison-hashing/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: unison-hashing
github: unisonweb/unison
copyright: Copyright (C) 2013-2021 Unison Computing, PBC and contributors

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

dependencies:
- base
Expand Down
4 changes: 2 additions & 2 deletions lib/unison-hashing/unison-hashing.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.35.2.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -48,7 +48,7 @@ library
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base
, unison-hash
Expand Down
11 changes: 1 addition & 10 deletions lib/unison-pretty-printer/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ default-extensions:
- TypeApplications
- ViewPatterns

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

flags:
optimized:
manual: true
default: true

when:
- condition: flag(optimized)
ghc-options: -funbox-strict-fields -O2
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

library:
when:
Expand Down
18 changes: 4 additions & 14 deletions lib/unison-pretty-printer/unison-pretty-printer.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -17,10 +17,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: True

library
exposed-modules:
Unison.PrettyTerminal
Expand Down Expand Up @@ -54,7 +50,7 @@ library
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
ListLike
, ansi-terminal
Expand All @@ -70,8 +66,6 @@ library
, unison-syntax
, unliftio
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2

executable prettyprintdemo
main-is: Main.hs
Expand Down Expand Up @@ -99,14 +93,12 @@ executable prettyprintdemo
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base
, text
, unison-pretty-printer
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2

test-suite pretty-printer-tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -139,7 +131,7 @@ test-suite pretty-printer-tests
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-depends:
base
, code-page
Expand All @@ -149,5 +141,3 @@ test-suite pretty-printer-tests
, unison-pretty-printer
, unison-syntax
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2
11 changes: 1 addition & 10 deletions parser-typechecker/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@ name: unison-parser-typechecker
github: unisonweb/unison
copyright: Copyright (C) 2013-2021 Unison Computing, PBC and contributors

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

flags:
optimized:
manual: true
default: true

when:
- condition: flag(optimized)
ghc-options: -funbox-strict-fields -O2
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

library:
source-dirs: src
Expand Down
14 changes: 3 additions & 11 deletions parser-typechecker/unison-parser-typechecker.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -17,10 +17,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: True

library
exposed-modules:
U.Codebase.Branch.Diff
Expand Down Expand Up @@ -195,7 +191,7 @@ library
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
ListLike
, aeson
Expand Down Expand Up @@ -256,8 +252,6 @@ library
, vector
, witherable
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2

test-suite parser-typechecker-tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -317,7 +311,7 @@ test-suite parser-typechecker-tests
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-depends:
base
, code-page
Expand All @@ -339,5 +333,3 @@ test-suite parser-typechecker-tests
, unison-util-relation
, unison-util-rope
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ allow-newer-deps:

ghc-options:
# All packages
"$locals": -Wall -Werror -Wno-name-shadowing -Wno-missing-pattern-synonym-signatures -fprint-expanded-synonyms -fwrite-ide-info -Wunused-packages #-freverse-errors
"$locals": -Wall -Werror -Wno-name-shadowing -Wno-missing-pattern-synonym-signatures -fprint-expanded-synonyms -fwrite-ide-info -Wunused-packages -funbox-strict-fields #-freverse-errors

# See https://github.com/haskell/haskell-language-server/issues/208
"$everything": -haddock
Expand Down
9 changes: 0 additions & 9 deletions unison-cli-integration/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: unison-cli-integration
github: unisonweb/unison
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors

flags:
optimized:
manual: true
default: false

ghc-options: -Wall

executables:
Expand All @@ -28,10 +23,6 @@ executables:
build-tools:
- unison-cli-main:unison

when:
- condition: flag(optimized)
ghc-options: -O2 -funbox-strict-fields

default-extensions:
- ApplicativeDo
- BangPatterns
Expand Down
8 changes: 1 addition & 7 deletions unison-cli-integration/unison-cli-integration.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -15,10 +15,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: False

executable cli-integration-tests
main-is: Suite.hs
other-modules:
Expand Down Expand Up @@ -70,5 +66,3 @@ executable cli-integration-tests
, process
, time
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
9 changes: 0 additions & 9 deletions unison-cli-main/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: unison-cli-main
github: unisonweb/unison
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors

flags:
optimized:
manual: true
default: false

ghc-options: -Wall

executables:
Expand All @@ -24,10 +19,6 @@ executables:
- text
- unison-cli

when:
- condition: flag(optimized)
ghc-options: -O2 -funbox-strict-fields

default-extensions:
- ApplicativeDo
- BangPatterns
Expand Down
8 changes: 1 addition & 7 deletions unison-cli-main/unison-cli-main.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -17,10 +17,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: False

executable unison
main-is: Main.hs
other-modules:
Expand Down Expand Up @@ -68,5 +64,3 @@ executable unison
, text
, unison-cli
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
9 changes: 0 additions & 9 deletions unison-cli/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: unison-cli
github: unisonweb/unison
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors

flags:
optimized:
manual: true
default: false

ghc-options: -Wall

dependencies:
Expand Down Expand Up @@ -148,10 +143,6 @@ executables:
- unison-cli
- unliftio

when:
- condition: flag(optimized)
ghc-options: -O2 -funbox-strict-fields

default-extensions:
- ApplicativeDo
- BangPatterns
Expand Down
12 changes: 1 addition & 11 deletions unison-cli/unison-cli.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -17,10 +17,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: False

library
exposed-modules:
ArgParse
Expand Down Expand Up @@ -274,8 +270,6 @@ library
, witch
, witherable
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
if !os(windows)
build-depends:
unix
Expand Down Expand Up @@ -333,8 +327,6 @@ executable transcripts
, unison-prelude
, unliftio
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields

test-suite cli-tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -406,5 +398,3 @@ test-suite cli-tests
, unison-syntax
, unison-util-recursion
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
Loading

0 comments on commit a85132c

Please sign in to comment.