Vagrantfile 21 KB

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