mirror of
https://github.com/luxfi/zapdb.git
synced 2026-10-30 15:12:20 +00:00
This commit fixes windows build issues. There were 4 issues
1. Trying to truncate a mmapped file.
On linux, we can truncate a mmapped file but on windows this
operation is invalid. We should unmap the file before truncating it.
2. Removing a file that has open file descriptor.
On windows we cannot delete a file if it has an open file descriptor.
The following functions would increment the ref for a table but never
decrease it.
- getTableInfo function in levels.go
The getTableInfo function would create an iterator but never
close it and because of this we would have issues trying to
delete the file.
- CreateTable function in stream writer
The createTable function calls OpenTable which sets the ref of a
table to 1 but we would never decrement this ref.
3. AppVeyor file checksum mismatch error (iterator errors)
These errors were caused because we were trying to create a file with
a random name but on appVeyor the `rand.Int63()` would return the same
value for multiple calls. The problem was that `rand.Seed` was called
with a `time.Now()` timestamp which wasn't always unique on AppVeyor.
4. AppVeyor out of disk space error.
In some of the tests we weren't closing the DB and trying to remove
the directory. This meant the directory would never get deleted and
thus AppVeyor would run out of disk space.
With this commit, the AppVeyor build should succeed.
(cherry picked from commit 7508749c8d)
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
# version format
|
|
version: "{build}"
|
|
|
|
# Operating system (build VM template)
|
|
os: Windows Server 2012 R2
|
|
|
|
# Platform.
|
|
platform: x64
|
|
|
|
clone_folder: c:\gopath\src\github.com\dgraph-io\badger
|
|
|
|
# Environment variables
|
|
environment:
|
|
GOVERSION: 1.12
|
|
GOPATH: c:\gopath
|
|
GO111MODULE: on
|
|
|
|
# scripts that run after cloning repository
|
|
install:
|
|
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
|
|
- go version
|
|
- go env
|
|
- python --version
|
|
|
|
# To run your custom scripts instead of automatic MSBuild
|
|
build_script:
|
|
# We need to disable firewall - https://github.com/appveyor/ci/issues/1579#issuecomment-309830648
|
|
- ps: Disable-NetFirewallRule -DisplayName 'File and Printer Sharing (SMB-Out)'
|
|
- cd c:\gopath\src\github.com\dgraph-io\badger
|
|
- git branch
|
|
- go get -t ./...
|
|
|
|
# To run your custom scripts instead of automatic tests
|
|
test_script:
|
|
# Unit tests
|
|
- ps: Add-AppveyorTest "Unit Tests" -Outcome Running
|
|
- go test -v github.com/dgraph-io/badger/...
|
|
- go test -v -vlog_mmap=false github.com/dgraph-io/badger/...
|
|
- ps: Update-AppveyorTest "Unit Tests" -Outcome Passed
|
|
|
|
notifications:
|
|
- provider: Email
|
|
to:
|
|
- [email protected]
|
|
on_build_failure: true
|
|
on_build_status_changed: true
|
|
# to disable deployment
|
|
deploy: off
|
|
|