Vagrantfile 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # Automated creation of testing environments / binaries on misc. platforms
  4. $cpus = Integer(ENV.fetch('VMCPUS', '8')) # create VMs with that many cpus
  5. $xdistn = Integer(ENV.fetch('XDISTN', '8')) # dispatch tests to that many pytest workers
  6. $wmem = $xdistn * 256 # give the VM additional memory for workers [MB]
  7. def packages_debianoid(user)
  8. return <<-EOF
  9. export DEBIAN_FRONTEND=noninteractive
  10. # this is to avoid grub asking about which device it should install to:
  11. echo "set grub-pc/install_devices /dev/sda" | debconf-communicate
  12. apt-get -y -qq update
  13. apt-get -y -qq dist-upgrade
  14. # for building borgbackup and dependencies:
  15. apt install -y pkg-config
  16. apt install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev || true
  17. apt install -y libfuse-dev fuse || true
  18. apt install -y libfuse3-dev fuse3 || true
  19. apt install -y locales || true
  20. sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
  21. usermod -a -G fuse #{user}
  22. chgrp fuse /dev/fuse
  23. chmod 666 /dev/fuse
  24. apt install -y fakeroot build-essential git curl
  25. apt install -y python3-dev python3-setuptools virtualenv
  26. # for building python:
  27. apt install -y zlib1g-dev libbz2-dev libncurses5-dev libreadline-dev liblzma-dev libsqlite3-dev libffi-dev
  28. EOF
  29. end
  30. def packages_freebsd
  31. return <<-EOF
  32. # in case the VM has no hostname set
  33. hostname freebsd
  34. # install all the (security and other) updates, base system
  35. freebsd-update --not-running-from-cron fetch install
  36. # for building borgbackup and dependencies:
  37. pkg install -y xxhash liblz4 zstd pkgconf
  38. pkg install -y fusefs-libs || true
  39. pkg install -y fusefs-libs3 || true
  40. pkg install -y rust
  41. pkg install -y git bash # fakeroot causes lots of troubles on freebsd
  42. pkg install -y python39 py39-sqlite3
  43. pkg install -y python310 py310-sqlite3
  44. pkg install -y python311 py311-sqlite3 py311-pip py311-virtualenv
  45. # make sure there is a python3/pip3/virtualenv command
  46. ln -sf /usr/local/bin/python3.11 /usr/local/bin/python3
  47. ln -sf /usr/local/bin/pip-3.11 /usr/local/bin/pip3
  48. ln -sf /usr/local/bin/virtualenv-3.11 /usr/local/bin/virtualenv
  49. # make bash default / work:
  50. chsh -s bash vagrant
  51. mount -t fdescfs fdesc /dev/fd
  52. echo 'fdesc /dev/fd fdescfs rw 0 0' >> /etc/fstab
  53. # make FUSE work
  54. echo 'fuse_load="YES"' >> /boot/loader.conf
  55. echo 'vfs.usermount=1' >> /etc/sysctl.conf
  56. kldload fusefs
  57. sysctl vfs.usermount=1
  58. pw groupmod operator -M vagrant
  59. # /dev/fuse has group operator
  60. chmod 666 /dev/fuse
  61. # install all the (security and other) updates, packages
  62. pkg update
  63. yes | pkg upgrade
  64. echo 'export BORG_OPENSSL_PREFIX=/usr' >> ~vagrant/.bash_profile
  65. # (re)mount / with acls
  66. mount -o acls /
  67. EOF
  68. end
  69. def packages_openbsd
  70. return <<-EOF
  71. echo "https://ftp.eu.openbsd.org/pub/OpenBSD" > /etc/installurl
  72. pkg_add bash
  73. chsh -s bash vagrant
  74. pkg_add xxhash
  75. pkg_add lz4
  76. pkg_add zstd
  77. pkg_add git # no fakeroot
  78. pkg_add rust
  79. pkg_add openssl%3.0
  80. pkg_add py3-pip
  81. pkg_add py3-virtualenv
  82. echo 'export BORG_OPENSSL_NAME=eopenssl30' >> ~vagrant/.bash_profile
  83. EOF
  84. end
  85. def packages_netbsd
  86. return <<-EOF
  87. echo 'http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$arch/9.3/All' > /usr/pkg/etc/pkgin/repositories.conf
  88. pkgin update
  89. pkgin -y upgrade
  90. pkg_add zstd lz4 xxhash git
  91. pkg_add rust
  92. pkg_add bash
  93. chsh -s bash vagrant
  94. echo "export PROMPT_COMMAND=" >> ~vagrant/.bash_profile # bug in netbsd 9.3, .bash_profile broken for screen
  95. echo "export PROMPT_COMMAND=" >> ~root/.bash_profile # bug in netbsd 9.3, .bash_profile broken for screen
  96. pkg_add pkg-config
  97. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  98. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  99. pkg_add py311-sqlite3 py311-pip py311-virtualenv py311-expat
  100. ln -s /usr/pkg/bin/python3.11 /usr/pkg/bin/python
  101. ln -s /usr/pkg/bin/python3.11 /usr/pkg/bin/python3
  102. ln -s /usr/pkg/bin/pip3.11 /usr/pkg/bin/pip
  103. ln -s /usr/pkg/bin/pip3.11 /usr/pkg/bin/pip3
  104. ln -s /usr/pkg/bin/virtualenv-3.11 /usr/pkg/bin/virtualenv
  105. ln -s /usr/pkg/bin/virtualenv-3.11 /usr/pkg/bin/virtualenv3
  106. EOF
  107. end
  108. def packages_macos
  109. return <<-EOF
  110. # install all the (security and other) updates
  111. sudo softwareupdate --ignore iTunesX
  112. sudo softwareupdate --ignore iTunes
  113. sudo softwareupdate --ignore Safari
  114. sudo softwareupdate --ignore "Install macOS High Sierra"
  115. sudo softwareupdate --install --all
  116. # this box has openssl 1.1 installed
  117. export PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig
  118. # the box "as is" has troubles downloading ca-certificates, needs a better working curl:
  119. # https://curl.se/docs/install.html
  120. curl -L https://github.com/curl/curl/releases/download/curl-8_10_1/curl-8.10.1.tar.gz | tar -xz
  121. cd curl-8.10.1/
  122. export ARCH=x86_64
  123. export SDK=macosx
  124. export DEPLOYMENT_TARGET=10.12
  125. export CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
  126. ./configure --host=$ARCH-apple-darwin --prefix /usr/local --with-openssl --without-libpsl --disable-ldap
  127. make -j8
  128. sudo make install
  129. unset ARCH
  130. unset SDK
  131. unset DEPLOYMENT_TARGET
  132. unset CFLAGS
  133. cd ..
  134. export HOMEBREW_DEVELOPER=1
  135. export HOMEBREW_CURL_PATH=/usr/local/bin/curl
  136. echo "finished building curl from source"
  137. echo "----------------------------------"
  138. # now the self-built curl should work for homebrew:
  139. brew update
  140. brew install ca-certificates
  141. brew install openssl@3
  142. export LDFLAGS=-L/usr/local/opt/openssl@3/lib
  143. export CPPFLAGS=-I/usr/local/opt/openssl@3/include
  144. export PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig
  145. echo 'export LDFLAGS=-L/usr/local/opt/openssl@3/lib' >> ~vagrant/.bash_profile
  146. echo 'export CPPFLAGS=-I/usr/local/opt/openssl@3/include' >> ~vagrant/.bash_profile
  147. echo 'export PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig' >> ~vagrant/.bash_profile
  148. echo "finished building ca-certificates and openssl@3"
  149. echo "-----------------------------------------------"
  150. # install curl from homebrew and use it for homebrew:
  151. brew install curl
  152. export PATH="/usr/local/opt/curl/bin:$PATH"
  153. echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~vagrant/.bash_profile
  154. export HOMEBREW_FORCE_BREWED_CURL=1
  155. echo 'export HOMEBREW_FORCE_BREWED_CURL=1' >> ~vagrant/.bash_profile
  156. unset HOMEBREW_CURL_PATH
  157. unset HOMEBREW_DEVELOPER
  158. echo "finished install homebrew curl"
  159. echo "------------------------------"
  160. # now brew, curl, ca-certificates, openssl@3 should be all ok.
  161. brew update
  162. brew install pkgconf readline xxhash zstd lz4 xz
  163. brew install --cask macfuse
  164. # brew upgrade # upgrade everything (takes rather long)
  165. # pyenv shall use the openssl@3 from homebrew:
  166. echo 'export PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA=openssl@3' >> ~vagrant/.bash_profile
  167. EOF
  168. end
  169. def packages_openindiana
  170. return <<-EOF
  171. # needs separate provisioning step + reboot:
  172. #pkg update
  173. pkg install gcc-13 git pkg-config libxxhash pip virtualenv
  174. # let borg's pkg-config find openssl:
  175. pfexec pkg set-mediator -V 3.1 openssl
  176. EOF
  177. end
  178. def install_pyenv(boxname)
  179. return <<-EOF
  180. echo 'export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} --enable-shared"' >> ~/.bash_profile
  181. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
  182. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
  183. . ~/.bash_profile
  184. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  185. echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
  186. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
  187. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
  188. echo 'eval "$(pyenv init -)"' >> ~/.bashrc
  189. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
  190. EOF
  191. end
  192. def fix_pyenv_macos(boxname)
  193. return <<-EOF
  194. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  195. EOF
  196. end
  197. def install_pythons(boxname)
  198. return <<-EOF
  199. . ~/.bash_profile
  200. echo "PYTHON_CONFIGURE_OPTS: ${PYTHON_CONFIGURE_OPTS}"
  201. pyenv install 3.12.10
  202. pyenv rehash
  203. EOF
  204. end
  205. def build_sys_venv(boxname)
  206. return <<-EOF
  207. . ~/.bash_profile
  208. cd /vagrant/borg
  209. virtualenv --python=python3 borg-env
  210. EOF
  211. end
  212. def build_pyenv_venv(boxname)
  213. return <<-EOF
  214. . ~/.bash_profile
  215. cd /vagrant/borg
  216. # use the latest 3.12 release
  217. pyenv global 3.12.10
  218. pyenv virtualenv 3.12.10 borg-env
  219. ln -s ~/.pyenv/versions/borg-env .
  220. EOF
  221. end
  222. def install_borg(fuse)
  223. return <<-EOF
  224. . ~/.bash_profile
  225. cd /vagrant/borg
  226. . borg-env/bin/activate
  227. pip install -U wheel # upgrade wheel, might be too old
  228. cd borg
  229. pip install -r requirements.d/development.lock.txt
  230. python3 scripts/make.py clean
  231. # install borgstore WITH all options, so it pulls in the needed
  232. # requirements, so they will also get into the binaries built. #8574
  233. pip install borgstore[sftp,s3]
  234. pip install -e .[#{fuse}]
  235. EOF
  236. end
  237. def install_pyinstaller()
  238. return <<-EOF
  239. . ~/.bash_profile
  240. cd /vagrant/borg
  241. . borg-env/bin/activate
  242. pip install 'pyinstaller==6.11.1'
  243. EOF
  244. end
  245. def build_binary_with_pyinstaller(boxname)
  246. return <<-EOF
  247. . ~/.bash_profile
  248. cd /vagrant/borg
  249. . borg-env/bin/activate
  250. cd borg
  251. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  252. echo 'export PATH="/vagrant/borg:$PATH"' >> ~/.bash_profile
  253. cd .. && tar -czvf borg.tgz borg-dir
  254. EOF
  255. end
  256. def run_tests(boxname, skip_env)
  257. return <<-EOF
  258. . ~/.bash_profile
  259. cd /vagrant/borg/borg
  260. . ../borg-env/bin/activate
  261. if which pyenv 2> /dev/null; then
  262. # for testing, use the earliest point releases of the supported python versions:
  263. pyenv global 3.12.10
  264. pyenv local 3.12.10
  265. fi
  266. # otherwise: just use the system python
  267. # some OSes can only run specific test envs, e.g. because they miss FUSE support:
  268. export TOX_SKIP_ENV='#{skip_env}'
  269. if which fakeroot 2> /dev/null; then
  270. echo "Running tox WITH fakeroot -u"
  271. fakeroot -u tox --skip-missing-interpreters
  272. else
  273. echo "Running tox WITHOUT fakeroot -u"
  274. tox --skip-missing-interpreters
  275. fi
  276. EOF
  277. end
  278. def fs_init(user)
  279. return <<-EOF
  280. # clean up (wrong/outdated) stuff we likely got via rsync:
  281. rm -rf /vagrant/borg/borg/.tox 2> /dev/null
  282. rm -rf /vagrant/borg/borg/borgbackup.egg-info 2> /dev/null
  283. rm -rf /vagrant/borg/borg/__pycache__ 2> /dev/null
  284. find /vagrant/borg/borg/src -name '__pycache__' -exec rm -rf {} \\; 2> /dev/null
  285. chown -R #{user} /vagrant/borg
  286. touch ~#{user}/.bash_profile ; chown #{user} ~#{user}/.bash_profile
  287. echo 'export LANG=en_US.UTF-8' >> ~#{user}/.bash_profile
  288. echo 'export LC_CTYPE=en_US.UTF-8' >> ~#{user}/.bash_profile
  289. echo 'export XDISTN=#{$xdistn}' >> ~#{user}/.bash_profile
  290. EOF
  291. end
  292. Vagrant.configure(2) do |config|
  293. # use rsync to copy content to the folder
  294. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "--exclude", ".python-version"], :rsync__chown => false
  295. # do not let the VM access . on the host machine via the default shared folder!
  296. config.vm.synced_folder ".", "/vagrant", disabled: true
  297. config.vm.provider :virtualbox do |v|
  298. #v.gui = true
  299. v.cpus = $cpus
  300. end
  301. config.vm.define "noble" do |b|
  302. b.vm.box = "bento/ubuntu-24.04"
  303. b.vm.provider :virtualbox do |v|
  304. v.memory = 1024 + $wmem
  305. end
  306. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  307. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  308. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("noble")
  309. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  310. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("noble", ".*none.*")
  311. end
  312. config.vm.define "jammy" do |b|
  313. b.vm.box = "ubuntu/jammy64"
  314. b.vm.provider :virtualbox do |v|
  315. v.memory = 1024 + $wmem
  316. end
  317. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  318. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  319. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jammy")
  320. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  321. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jammy", ".*none.*")
  322. end
  323. config.vm.define "bookworm32" do |b|
  324. b.vm.box = "generic-x32/debian12"
  325. b.vm.provider :virtualbox do |v|
  326. v.memory = 1024 + $wmem
  327. end
  328. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  329. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  330. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bookworm32")
  331. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bookworm32")
  332. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bookworm32")
  333. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  334. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  335. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bookworm32")
  336. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bookworm32", ".*none.*")
  337. end
  338. config.vm.define "bookworm" do |b|
  339. b.vm.box = "debian/bookworm64"
  340. b.vm.provider :virtualbox do |v|
  341. v.memory = 1024 + $wmem
  342. end
  343. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  344. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  345. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bookworm")
  346. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bookworm")
  347. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bookworm")
  348. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  349. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  350. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bookworm")
  351. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bookworm", ".*none.*")
  352. end
  353. config.vm.define "bullseye" do |b|
  354. b.vm.box = "debian/bullseye64"
  355. b.vm.provider :virtualbox do |v|
  356. v.memory = 1024 + $wmem
  357. end
  358. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  359. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  360. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bullseye")
  361. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bullseye")
  362. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bullseye")
  363. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  364. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  365. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bullseye")
  366. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bullseye", ".*none.*")
  367. end
  368. config.vm.define "freebsd13" do |b|
  369. b.vm.box = "generic/freebsd13"
  370. b.vm.provider :virtualbox do |v|
  371. v.memory = 1024 + $wmem
  372. end
  373. b.ssh.shell = "sh"
  374. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  375. b.vm.provision "packages freebsd", :type => :shell, :inline => packages_freebsd
  376. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd13")
  377. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd13")
  378. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd13")
  379. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  380. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  381. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd13")
  382. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd13", ".*(fuse3|none).*")
  383. end
  384. config.vm.define "freebsd14" do |b|
  385. b.vm.box = "generic/freebsd14"
  386. b.vm.provider :virtualbox do |v|
  387. v.memory = 1024 + $wmem
  388. end
  389. b.ssh.shell = "sh"
  390. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  391. b.vm.provision "packages freebsd", :type => :shell, :inline => packages_freebsd
  392. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd14")
  393. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd14")
  394. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd14")
  395. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  396. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  397. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd14")
  398. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd14", ".*(fuse3|none).*")
  399. end
  400. config.vm.define "openbsd7" do |b|
  401. b.vm.box = "generic/openbsd7"
  402. b.vm.provider :virtualbox do |v|
  403. v.memory = 1024 + $wmem
  404. end
  405. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  406. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  407. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd7")
  408. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("nofuse")
  409. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd7", ".*fuse.*")
  410. end
  411. config.vm.define "netbsd9" do |b|
  412. b.vm.box = "generic/netbsd9"
  413. b.vm.provider :virtualbox do |v|
  414. v.memory = 4096 + $wmem # need big /tmp tmpfs in RAM!
  415. end
  416. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  417. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  418. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd9")
  419. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  420. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd9", ".*fuse.*")
  421. end
  422. config.vm.define "macos1012" do |b|
  423. b.vm.box = "macos-sierra"
  424. b.vm.provider :virtualbox do |v|
  425. v.memory = 8192 + $wmem
  426. v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
  427. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  428. v.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
  429. # Adjust CPU settings according to
  430. # https://github.com/geerlingguy/macos-virtualbox-vm
  431. v.customize ['modifyvm', :id, '--cpuidset',
  432. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  433. # Disable USB variant requiring Virtualbox proprietary extension pack
  434. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  435. end
  436. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  437. b.vm.provision "packages macos", :type => :shell, :privileged => false, :inline => packages_macos
  438. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("macos1012")
  439. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_macos("macos1012")
  440. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("macos1012")
  441. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("macos1012")
  442. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  443. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  444. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("macos1012")
  445. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("macos1012", ".*(fuse3|none).*")
  446. end
  447. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  448. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  449. config.vm.define "openindiana" do |b|
  450. b.vm.box = "openindiana/hipster"
  451. b.vm.provider :virtualbox do |v|
  452. v.memory = 2048 + $wmem
  453. end
  454. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  455. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  456. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana")
  457. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("nofuse")
  458. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana", ".*fuse.*")
  459. end
  460. end