Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Iohk nix #4183

Merged
merged 4 commits into from
Jul 12, 2019
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
8 changes: 4 additions & 4 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
steps:
- label: 'stack2nix'
command: 'scripts/check-stack2nix.sh'
- label: Check Hydra evaluation of release.nix
command: 'nix-build -A check-hydra lib.nix -o check-hydra.sh && ./check-hydra.sh'
agents:
system: x86_64-linux

- label: 'release.nix'
command: 'scripts/ci/check-hydra.sh'
disassembler marked this conversation as resolved.
Show resolved Hide resolved
- label: Check auto-generated Nix
command: 'nix-build -A check-nix-tools lib.nix -o check-nix-tools.sh && ./check-nix-tools.sh'
agents:
system: x86_64-linux

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,4 @@ nix/.stack.nix/*.nix linguist-generated=true
.stack-to-nix.cache linguist-generated=true
nix/.stack-pkgs.nix linguist-generated=true
script-runner/states
test-state
33 changes: 0 additions & 33 deletions .stack-to-nix.cache

This file was deleted.

170 changes: 1 addition & 169 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,173 +3,5 @@ image: Visual Studio 2015

build: off

environment:
global:
# Avoid long paths on Windows
STACK_ROOT: "c:\\s"
STACK_WORK: ".w"
WORK_DIR: "c:\\w"
# Override the temp directory to avoid sed escaping issues
# See https://github.com/haskell/cabal/issues/5386
TMP: "c:\\tmp"
CACHE_S3_VERSION: v0.1.4
CACHE_S3_MAX_SIZE: 1600MB # AppVeyor limits the amount uploaded to approx 2GB
AWS_REGION: us-west-1
S3_BUCKET: appveyor-ci-cache
AWS_ACCESS_KEY_ID:
secure: sQWt5CpaN0H+jwUVoTsrET46pADUDEcrJ5D9MHmKX0M=
AWS_SECRET_ACCESS_KEY:
secure: m5sQYd16K8HA0zoZaD0gOl4EEWUso1D51L5rp+kT3hLaIE3tt4iT+b+iW8F4F0FU

init:
- ps: $env:CACHE_S3_READY = (("$env:CACHE_S3_VERSION" -ne "") -and ("$env:S3_BUCKET" -ne "") -and ("$env:AWS_ACCESS_KEY_ID" -ne "") -and ("$env:AWS_SECRET_ACCESS_KEY" -ne ""))

before_test:
# Avoid long paths not to each MAX_PATH of 260 chars
- xcopy /q /s /e /r /k /i /v /h /y "%APPVEYOR_BUILD_FOLDER%" "%WORK_DIR%"
- cd "%WORK_DIR%"
# Restore cache
- Echo %APPVEYOR_BUILD_VERSION% > build-id
- ps: >-
Write-Host "in pagefile script" ;
$c = Get-WmiObject Win32_computersystem -EnableAllPrivileges ;
if($c.AutomaticManagedPagefile){
Write-Host "disabling managed page file settings"
$c.AutomaticManagedPagefile = $false
$c.Put() | Out-Null
} ;
$new_page_size=25000 ;
$CurrentPageFile = Get-WmiObject -Class Win32_PageFileSetting ;
if ($CurrentPageFile.InitialSize -ne $new_page_size) {
Write-Host "setting new page file size to $new_page_size"
$CurrentPageFile.InitialSize=$new_page_size
$CurrentPageFile.MaximumSize=$new_page_size
$CurrentPageFile.Put() | Out-Null
} ;
if ( $env:CACHE_S3_READY -eq $true ) {
Start-FileDownload https://github.com/fpco/cache-s3/releases/download/$env:CACHE_S3_VERSION/cache-s3-$env:CACHE_S3_VERSION-windows-x86_64.zip -FileName cache-s3.zip
7z x cache-s3.zip cache-s3.exe
.\cache-s3 --max-size=$env:CACHE_S3_MAX_SIZE --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -v info -c restore stack --base-branch=develop
.\cache-s3 --max-size=$env:CACHE_S3_MAX_SIZE --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -v info -c restore stack work --base-branch=develop
}

# Get custom GHC
- ps: >-
mkdir C:\ghc

Invoke-WebRequest "https://s3.eu-central-1.amazonaws.com/ci-static/ghc-8.4.4-x86_64-unknown-mingw32-20181113-b907eb0f9b.tar.xz" -OutFile "C:\ghc\ghc.tar.xz" -UserAgent "Curl"

7z x C:\ghc\ghc.tar.xz -oC:\ghc

7z x C:\ghc\ghc.tar -oC:\ghc

$env:PATH="$env:PATH;C:\ghc\ghc-8.4.4\bin"

# Install OpenSSL 1.0.2 (see https://github.com/appveyor/ci/issues/1665)
- ps: (New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_0_2r.exe', "$($env:USERPROFILE)\Win64OpenSSL.exe")
- ps: cmd /c start /wait "$($env:USERPROFILE)\Win64OpenSSL.exe" /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-Win64-v102
- ps: Install-Product node 6
# Install stack
- ps: Start-FileDownload http://www.stackage.org/stack/windows-x86_64 -FileName stack.zip
- 7z x stack.zip stack.exe


# Install rocksdb
- git clone https://github.com/facebook/rocksdb.git --branch v4.13.5
- ps: Start-FileDownload 'https://s3.eu-central-1.amazonaws.com/ci-static/serokell-rocksdb-haskell-325427fc709183c8fdf777ad5ea09f8d92bf8585.zip' -FileName rocksdb.zip
- 7z x rocksdb.zip

# CSL-1509: After moving the 'cardano-sl' project itself into a separate folder ('lib/'), the 'cardano-text.exe' executable fails on AppVeyor CI.
# After some investigation, it was discovered that this was because 'rocksdb.dll' has to be located in this folder as well, or else the test executable doesn't work.
- copy rocksdb.dll node
- copy rocksdb.dll lib
- copy rocksdb.dll wallet

# Install liblzma/xz
- ps: Start-FileDownload https://tukaani.org/xz/xz-5.2.3-windows.zip -Filename xz-5.2.3-windows.zip
- 7z -oC:\xz_extracted x xz-5.2.3-windows.zip

test_script:
- cd "%WORK_DIR%"
- stack config --system-ghc set system-ghc --global true
- stack exec -- ghc-pkg recache
- stack --verbosity warn setup --no-reinstall > nul
# Install happy separately: https://github.com/commercialhaskell/stack/issues/3151#issuecomment-310642487. Also install cpphs because it's a build-tool and Stack can't figure out by itself that it should be installed
- scripts\ci\appveyor-retry call stack --verbosity warn install happy cpphs
-j 2
--no-terminal
--local-bin-path %SYSTEMROOT%\system32
--extra-include-dirs="C:\OpenSSL-Win64-v102\include"
--extra-lib-dirs="C:\OpenSSL-Win64-v102"
--extra-include-dirs="C:\xz_extracted\include"
--extra-lib-dirs="C:\xz_extracted\bin_x86-64"
--extra-include-dirs="%WORK_DIR%\rocksdb\include"
--extra-lib-dirs="%WORK_DIR%"
--ghc-options="-copy-libs-when-linking"
# TODO: CSL-1133. To be reenabled.
# - stack test --coverage
# - stack hpc report cardano-sl cardano-sl-txp cardano-sl-core cardano-sl-db cardano-sl-update cardano-sl-infra cardano-sl-lrc cardano-sl-ssc
# Retry transient failures due to https://github.com/haskell/cabal/issues/4005
# We intentionally don't build auxx here, because this build is for installer.
- scripts\ci\appveyor-retry call stack --dump-logs install cardano-sl cardano-sl-tools cardano-wallet
-j 3
--no-terminal
--local-bin-path %WORK_DIR%
--no-haddock-deps
--flag cardano-sl-core:-asserts
--flag cardano-sl-tools:for-installer
--extra-include-dirs="C:\OpenSSL-Win64-v102\include"
--extra-lib-dirs="C:\OpenSSL-Win64-v102"
--extra-include-dirs="C:\xz_extracted\include"
--extra-lib-dirs="C:\xz_extracted\bin_x86-64"
--extra-include-dirs="%WORK_DIR%\rocksdb\include"
--extra-lib-dirs="%WORK_DIR%"
--ghc-options="-copy-libs-when-linking"
# Cardano pieces, modulo the frontend
- mkdir daedalus
# log config is called `log-config-prod.yaml` just in case, it's the old name
- copy log-configs\daedalus.yaml daedalus\log-config-prod.yaml
- copy lib\configuration.yaml daedalus\
- copy lib\*genesis*.json daedalus\
- copy cardano-launcher.exe daedalus\
- copy cardano-node.exe daedalus\
- copy cardano-x509-certificates.exe daedalus\
- copy wallet-extractor.exe daedalus\
- cd daedalus
- Echo %APPVEYOR_BUILD_VERSION% > build-id
- Echo %APPVEYOR_REPO_COMMIT% > commit-id
- Echo https://ci.appveyor.com/project/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%/build/%APPVEYOR_BUILD_VERSION% > ci-url

after_test:
- xcopy /q /s /e /r /k /i /v /h /y "%WORK_DIR%\daedalus" "%APPVEYOR_BUILD_FOLDER%\daedalus"
- cd "%WORK_DIR%/daedalus"
- 7z a "%APPVEYOR_REPO_COMMIT%.zip" *
- appveyor PushArtifact "%APPVEYOR_REPO_COMMIT%.zip"
- cd "%WORK_DIR%" # Get back to where cache-s3.exe is located
- ps: >-
if ( ($env:CACHE_S3_READY -eq $true) -and (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) ) {
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -Or $env:APPVEYOR_REPO_BRANCH -eq "develop" -Or $env:APPVEYOR_REPO_BRANCH -like "release*") {
Write-Host "saving stack"
.\cache-s3 --max-size=$env:CACHE_S3_MAX_SIZE --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -c -v info save stack
Write-Host "done stack"
}
Write-Host "saving stack work"
.\cache-s3 --max-size=$env:CACHE_S3_MAX_SIZE --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -c -v info save stack work
Write-Host "done stack work"
}
artifacts:
- path: daedalus/
name: CardanoSL
type: zip

deploy:
provider: S3
access_key_id:
secure: IEky6PsMzHaKHNBMxR8tQaQI8X7qWRB9+HuEroTVRBk=
secret_access_key:
secure: cqjzG96hWB1x3JDbVSbF9E+aJ5jKvIGacJRUDWATHaTOYfSt6Rvive/NrF4lKBIm
bucket: appveyor-ci-deploy
region: ap-northeast-1
set_public: true
folder: cardano-sl
artifact: $(APPVEYOR_REPO_COMMIT).zip
- ps: echo "No Longer Used, windows binaries cross compiled in hydra"
19 changes: 10 additions & 9 deletions auxx/src/Lang/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ import Test.QuickCheck.Arbitrary.Generic (Arbitrary (..),
genericArbitrary, genericShrink)
import qualified Test.QuickCheck.Gen as QC
import Test.QuickCheck.Instances ()
import Text.Megaparsec (Parsec, SourcePos (..), between, choice, eof,
getPosition, manyTill, notFollowedBy, parseMaybe,
skipMany, takeP, takeWhile1P, try, unPos, (<?>))
import Text.Megaparsec.Char (anyChar, char, satisfy, spaceChar,
import Text.Megaparsec (Parsec, SourcePos (..), anySingle, between,
choice, eof, getSourcePos, manyTill, notFollowedBy,
parseMaybe, satisfy, skipMany, takeP, takeWhile1P, try,
unPos, (<?>))
import Text.Megaparsec.Char (char, spaceChar,
string)
import Text.Megaparsec.Char.Lexer (decimal, scientific, signed)

Expand Down Expand Up @@ -177,13 +178,13 @@ pToken = withPosition (try pToken' <|> pUnknown) <* pSkip
( fromIntegral . unPos $ sourceLine
, fromIntegral . unPos $ sourceColumn)
withPosition p = do
pos1 <- posToLoc <$> getPosition
pos1 <- posToLoc <$> getSourcePos
t <- p
pos2 <- posToLoc <$> getPosition
pos2 <- posToLoc <$> getSourcePos
return (spanFromTo pos1 pos2, t)

pUnknown :: Lexer Token
pUnknown = TokenUnknown . UnknownChar <$> anyChar
pUnknown = TokenUnknown . UnknownChar <$> anySingle

pSkip :: Lexer ()
pSkip = skipMany (void spaceChar)
Expand Down Expand Up @@ -223,7 +224,7 @@ pText = do
where
loop :: [Char] -> Lexer [Char]
loop !acc = do
next <- anyChar
next <- anySingle
case next of
-- Check for double double quotes. If it's a single double quote,
-- it's the end of the string.
Expand Down Expand Up @@ -287,7 +288,7 @@ pFilePath = FilePath' <$> do
where
pFilePathChar :: Lexer Char
pFilePathChar =
char '\\' *> anyChar <|>
char '\\' *> anySingle <|>
satisfy isFilePathChar

pIdent :: Lexer Token
Expand Down
Loading