Skip to content
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

Distributable binaries #165

Merged
merged 58 commits into from
Jul 20, 2020
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
69b4f07
WIP
lukel97 Jun 12, 2020
0e30291
WIP 2
lukel97 Jun 12, 2020
43c8076
WIP 3
lukel97 Jun 12, 2020
8ba974b
WIP 4
lukel97 Jun 12, 2020
cde25d7
WIP 5
lukel97 Jun 12, 2020
c328c80
WIP 6
lukel97 Jun 12, 2020
2a5b400
WIP 7
lukel97 Jun 12, 2020
ffe3d4e
WIP 8
lukel97 Jun 12, 2020
7c7c207
WIP 9 Use patched hie-bios to get libdir dynamically
lukel97 Jun 13, 2020
bf59f29
Try building the wrapper
lukel97 Jun 13, 2020
0ace84b
Try to fix build_wrapper env variable not being picked up
lukel97 Jun 13, 2020
32c5937
Try again
lukel97 Jun 13, 2020
1a66953
Give up on the env var idea
lukel97 Jun 13, 2020
5d3fed7
Try out static optimised builds?
lukel97 Jun 13, 2020
191272a
Try squashing the working dir
lukel97 Jun 15, 2020
a3b309c
Woops
lukel97 Jun 15, 2020
a626ffc
Try squashing the builddir
lukel97 Jun 15, 2020
4219d51
Try going into the parent directory
lukel97 Jun 15, 2020
dc99a50
Radical approach - don't use such a long name for the wrapper
lukel97 Jun 15, 2020
277f20e
Use dist-binary flag
lukel97 Jun 15, 2020
4feadad
Debug why floskell fails to build on windows
lukel97 Jun 16, 2020
f4a7fb8
haskell-language-server => hls on CI
lukel97 Jun 16, 2020
a91ae03
Employ extreme path saving measures
lukel97 Jun 16, 2020
d53fb6e
sed time :(
lukel97 Jun 16, 2020
7e0402b
Try making sed command portable
lukel97 Jun 16, 2020
505ee0a
Compress artefacts
lukel97 Jun 17, 2020
304f4c3
Tidy up wrapper logging
lukel97 Jun 17, 2020
0c48be8
Use version checking logic in hie-bios
lukel97 Jun 18, 2020
65eb6c4
Add documentation on the releases process
lukel97 Jun 18, 2020
c1a1228
Remove unused code
lukel97 Jun 19, 2020
d0aa2fa
Append .exe to windows binaries
lukel97 Jun 23, 2020
edf2cc5
Try out building remaining supported ghc configurations
lukel97 Jun 23, 2020
322e6ad
Add wrapper tests and update hie-bios
lukel97 Jun 25, 2020
8063c33
Merge remote-tracking branch 'origin/master' into github-action-builds
lukel97 Jun 26, 2020
997e6b0
Use index timestamp that exists on hackage
lukel97 Jun 26, 2020
0df1168
Update hie-bios
lukel97 Jun 29, 2020
74468f7
Update hie-bios
lukel97 Jun 29, 2020
06abcf4
Try building windows jobs on -j1
lukel97 Jun 30, 2020
f84d4a7
Skip windows 8.8.2
lukel97 Jun 30, 2020
dc3a61a
Update ghc-check to use hie-bios runtime ghc libdir
lukel97 Jul 1, 2020
c76a69e
Upload binaries as an artifact too
lukel97 Jul 1, 2020
18c4082
Try flicking on enable-executable-static
lukel97 Jul 7, 2020
90b286e
Fix artifact upload
lukel97 Jul 7, 2020
b24390f
Merge remote-tracking branch 'origin/master' into github-action-builds
lukel97 Jul 14, 2020
1e9b6e7
Merge remote-tracking branch 'origin/master' into github-action-builds
lukel97 Jul 14, 2020
a5c5608
Update to latest ghcide and reuse loadSession
lukel97 Jul 15, 2020
cf05aa9
Check if the tool is installed in --project-ghc-version in the wrapper
lukel97 Jul 16, 2020
773ec86
Fix wrapper tests by copying to temporary directory
lukel97 Jul 16, 2020
bcfa908
Try caching
lukel97 Jul 16, 2020
53c3676
Tidy up and switch back to cabal helper implicit cradle
lukel97 Jul 16, 2020
54ce0ec
use split sections
amesgen Jul 16, 2020
c162fca
Merge pull request #1 from amesgen/use-split-sections
lukel97 Jul 16, 2020
7156e45
Remove cabal-helper and replace it with hie-bios implicit logic
lukel97 Jul 17, 2020
72abb71
Merge branch 'github-action-builds' of github.com:bubba/haskell-langu…
lukel97 Jul 17, 2020
1cd5016
Merge remote-tracking branch 'origin/master' into github-action-builds
lukel97 Jul 17, 2020
9238ced
Undo agpl common stanza change
lukel97 Jul 17, 2020
ebe5ef1
Add release number
lukel97 Jul 17, 2020
3e2ac6f
Merge remote-tracking branch 'origin/master' into github-action-builds
lukel97 Jul 20, 2020
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
Prev Previous commit
Next Next commit
Fix wrapper tests by copying to temporary directory
lukel97 committed Jul 16, 2020
commit 773ec8658ec192435419fa630d9509f0211dbc4b
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ stack*.yaml.lock
shake.yaml.lock

# ignore hie.yaml's for testdata
test/**/*.yaml
test/testdata/**/hie.yaml

# metadata files on macOS
.DS_Store
1 change: 1 addition & 0 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
@@ -217,6 +217,7 @@ common hls-test-utils
, lsp-test
, stm
, tasty-hunit
, temporary
, text
, transformers
, unordered-containers
31 changes: 30 additions & 1 deletion test/utils/Test/Hls/Util.hs
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ module Test.Hls.Util
, setupBuildToolFiles
, withFileLogging
, findExe
, withCurrentDirectoryInTmp
-- , makeRequest
-- , runIGM
-- , runIGM'
@@ -46,6 +47,7 @@ import System.Directory
import System.Environment
import System.FilePath
import qualified System.Log.Logger as L
import System.IO.Temp
-- import Test.Hspec
import Test.Hspec.Runner
import Test.Hspec.Core.Formatters
@@ -332,6 +334,33 @@ findExeRecursive exe dir = do
findExe :: String -> IO FilePath
findExe name = do
fp <- fmap fromJust $ runMaybeT $
MaybeT (findExecutable name) <|>
MaybeT (findExecutable name) <|>
MaybeT (findExeRecursive name "dist-newstyle")
makeAbsolute fp

-- | Like 'withCurrentDirectory', but will copy the directory over to the system
-- temporary directory first to avoid haskell-language-server's source tree from
-- interfering with the cradle
withCurrentDirectoryInTmp :: FilePath -> IO a -> IO a
withCurrentDirectoryInTmp dir f =
withTempCopy dir $ \newDir ->
withCurrentDirectory newDir f

withTempCopy :: FilePath -> (FilePath -> IO a) -> IO a
withTempCopy srcDir f = do
withSystemTempDirectory "hls-test" $ \newDir -> do
copyDir srcDir newDir
f newDir

copyDir :: FilePath -> FilePath -> IO ()
copyDir src dst = do
cnts <- listDirectory src
forM_ cnts $ \file -> do
unless (file `elem` ignored) $ do
let srcFp = src </> file
dstFp = dst </> file
isDir <- doesDirectoryExist srcFp
if isDir
then createDirectory dstFp >> copyDir srcFp dstFp
else copyFile srcFp dstFp
where ignored = ["dist", "dist-newstyle", ".stack-work"]
11 changes: 5 additions & 6 deletions test/wrapper/Main.hs
Original file line number Diff line number Diff line change
@@ -3,14 +3,14 @@ import Data.Char
import Test.Hls.Util
import Test.Tasty
import Test.Tasty.HUnit
import System.Directory
import System.Process

main :: IO ()
main = defaultMain $
testGroup "haskell-language-server-wrapper" [projectGhcVersionTests]
main = do
flushStackEnvironment
defaultMain $
testGroup "haskell-language-server-wrapper" [projectGhcVersionTests]

--TODO: WAIT ON HIE-BIOS STOP FILES
projectGhcVersionTests :: TestTree
projectGhcVersionTests = testGroup "--project-ghc-version"
[ testCase "stack with ghc 8.10.1" $
@@ -25,10 +25,9 @@ projectGhcVersionTests = testGroup "--project-ghc-version"
testDir :: FilePath -> String -> Assertion
testDir dir expectedVer = do
wrapper <- findExe "haskell-language-server-wrapper"
withCurrentDirectory dir $ do
withCurrentDirectoryInTmp dir $ do
actualVer <- trim <$> readProcess wrapper ["--project-ghc-version"] ""
actualVer @?= expectedVer

trim :: String -> String
trim = dropWhileEnd isSpace

1 change: 1 addition & 0 deletions test/wrapper/testdata/stack-8.10.1/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: ghc-8.10.1
1 change: 1 addition & 0 deletions test/wrapper/testdata/stack-8.8.3/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: ghc-8.8.3