Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

Add Windows support #38

Closed
pkorotkov opened this issue Feb 19, 2014 · 7 comments · Fixed by #191
Closed

Add Windows support #38

pkorotkov opened this issue Feb 19, 2014 · 7 comments · Fixed by #191
Assignees
Milestone

Comments

@pkorotkov
Copy link

Hello,
Thanks for a great project, I'm really happy that I encountered it lately.
Do you have plans to add Windows to the list of supported OSes? Correct me if I'm wrong, currently the only sticking point to port bolt is a bit tricky memory-mapping mechanism in Windows not given out of the box (standard Go syscall library). Well, if that's the case, a proper implementation of _syscall interface for Windows might not be a problem. Here you'll find a working package for handy dealing with memory-mapped files in a portable way.

Best regards,
Pavel

@benbjohnson
Copy link
Member

@pkorotkov Thanks for adding the bug report. LMDB has the Windows mmap calls in there but I decided to forgo Windows support for the v0.1.0 release. It shouldn't be hard to add though since the syscalls are fairly isolated but I want to make sure the Bolt design is solid first.

I also need to find a good Windows CI that I can run continuous tests against. Do you know of any?

@pkorotkov
Copy link
Author

@benbjohnson Oh, cool! I wish you push the support somewhat quicker :)

Well, our in-company Windows (along with Linux) CI is made on drone.io. We didn't even seek for Windows-only solution in the wild. Just created a few instances with Lin-n-Win (with Windows 7 X86_64) and coupled them with the drone.io service. That's it. Perhaps there is a better way but we are still fine with that one.

@benbjohnson benbjohnson added this to the v0.2.0 milestone Apr 4, 2014
@benbjohnson benbjohnson self-assigned this Apr 4, 2014
@calmh
Copy link

calmh commented Jun 10, 2014

Any movement on this? Bolt looks like the nicest Go KV store, but dropping Windows support by using is not always an option. :/

@benbjohnson
Copy link
Member

@calmh I tried adding in Windows support this morning to this branch but I'm hitting an error on the file mapping. I'm not entirely sure why. It's been a while since I've even booted my Windows VM so I'm a little rusty.

Here's the error:

Not enough storage is available to process this command. 

And the full stack trace from the test:

Y:\>go test -v github.com/boltdb/bolt
seed: 26500
quick settings: count=5, items=1000, ksize=1024, vsize=1024
=== RUN TestBucket_Get_NonExistent
--- FAIL: TestBucket_Get_NonExistent (4.42 seconds)
panic: cannot open db: CreateFileMapping: Not enough storage is available to process this command. [recovered]
        panic: cannot open db: CreateFileMapping: Not enough storage is available to process this command.

goroutine 3 [running]:
runtime.panic(0x542e80, 0xc084004620)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease155988687/go/src/pkg/runtime/panic.c:266 +0xc8
testing.func┬╖005()
        C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease155988687/go/src/pkg/testing/testing.go:385 +0xeb
runtime.panic(0x542e80, 0xc084004620)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease155988687/go/src/pkg/runtime/panic.c:248 +0x11b
github.com/boltdb/bolt.func┬╖205(0xc0840067c0, 0x33)
        Y:/go/src/github.com/boltdb/bolt/db_test.go:497 +0xda
github.com/boltdb/bolt.withTempPath(0x3acf28)
        Y:/go/src/github.com/boltdb/bolt/db_test.go:489 +0x6d
github.com/boltdb/bolt.withOpenDB(0x3acf48)
        Y:/go/src/github.com/boltdb/bolt/db_test.go:509 +0x4d
github.com/boltdb/bolt.TestBucket_Get_NonExistent(0xc084039000)
        Y:/go/src/github.com/boltdb/bolt/bucket_test.go:27 +0x4d
testing.tRunner(0xc084039000, 0x782f40)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease155988687/go/src/pkg/testing/testing.go:391 +0x8e
created by testing.RunTests
        C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease155988687/go/src/pkg/testing/testing.go:471 +0x8b5

goroutine 1 [chan receive]:
testing.RunTests(0x5f6508, 0x782f40, 0x7e, 0x7e, 0x1)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease155988687/go/src/pkg/testing/testing.go:472 +0x8d8
testing.Main(0x5f6508, 0x782f40, 0x7e, 0x7e, 0x783c60, ...)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease155988687/go/src/pkg/testing/testing.go:403 +0x87
main.main()
        github.com/boltdb/bolt/_test/_testmain.go:313 +0x9f
exit status 2
FAIL    github.com/boltdb/bolt  4.458s

I don't have any more time this morning to commit to this. If you have any ideas, let me know. Some of the mmap code is borrowed from @edsrzf's mmap-go and merged with LMDB's Windows mapping code. I'll try to take another look tomorrow.

@benbjohnson
Copy link
Member

Support for Windows added: #191

@benbjohnson
Copy link
Member

I landed the Windows Support PR this morning. You should be good to go. :)

@calmh
Copy link

calmh commented Jun 13, 2014

Awesome! 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants