Vagrantfile 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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. # older debian / ubuntu have no .pc file for these, so we need to point at the lib/header location:
  29. echo 'export BORG_LIBXXHASH_PREFIX=/usr' >> ~vagrant/.bash_profile
  30. EOF
  31. end
  32. def packages_freebsd
  33. return <<-EOF
  34. # in case the VM has no hostname set
  35. hostname freebsd
  36. # install all the (security and other) updates, base system
  37. freebsd-update --not-running-from-cron fetch install
  38. # for building borgbackup and dependencies:
  39. pkg install -y xxhash liblz4 zstd pkgconf
  40. pkg install -y fusefs-libs || true
  41. pkg install -y fusefs-libs3 || true
  42. pkg install -y git bash # fakeroot causes lots of troubles on freebsd
  43. # for building python (for the tests we use pyenv built pythons):
  44. pkg install -y python39 py39-sqlite3
  45. # make sure there is a python3 command
  46. ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3
  47. python3 -m ensurepip
  48. pip3 install 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. pkg_add bash
  72. chsh -s bash vagrant
  73. pkg_add xxhash
  74. pkg_add lz4
  75. pkg_add zstd
  76. pkg_add git # no fakeroot
  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 bash
  89. chsh -s bash vagrant
  90. echo "export PROMPT_COMMAND=" >> ~vagrant/.bash_profile # bug in netbsd 9.3, .bash_profile broken for screen
  91. echo "export PROMPT_COMMAND=" >> ~root/.bash_profile # bug in netbsd 9.3, .bash_profile broken for screen
  92. pkg_add pkg-config
  93. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  94. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  95. pkg_add python39 py39-sqlite3 py39-pip py39-virtualenv py39-expat
  96. pkg_add python310 py310-sqlite3 py310-pip py310-virtualenv py310-expat
  97. EOF
  98. end
  99. def packages_darwin
  100. return <<-EOF
  101. # install all the (security and other) updates
  102. sudo softwareupdate --ignore iTunesX
  103. sudo softwareupdate --ignore iTunes
  104. sudo softwareupdate --ignore Safari
  105. sudo softwareupdate --ignore "Install macOS High Sierra"
  106. sudo softwareupdate --install --all
  107. which brew || CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  108. brew update > /dev/null
  109. brew install pkg-config readline xxhash zstd lz4 xz openssl@1.1
  110. brew install --cask macfuse
  111. # brew upgrade # upgrade everything (takes rather long)
  112. echo 'export PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig' >> ~vagrant/.bash_profile
  113. EOF
  114. end
  115. def packages_openindiana
  116. return <<-EOF
  117. # needs separate provisioning step + reboot:
  118. #pkg update
  119. #pkg install gcc-7 python-39 setuptools-39
  120. ln -sf /usr/bin/python3.9 /usr/bin/python3
  121. python3 -m ensurepip
  122. ln -sf /usr/bin/pip3.9 /usr/bin/pip3
  123. pip3 install virtualenv
  124. EOF
  125. end
  126. # Build and install borg dependencies from source
  127. def install_source_dependencies(user)
  128. return <<-EOF
  129. set -e -o pipefail
  130. # Install in /usr/local
  131. export PREFIX=/usr/local
  132. # Make PKG_CONFIG_PATH explicit, even if /usr/local/lib/pkgconfig is enabled per default
  133. export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
  134. echo 'export PKG_CONFIG_PATH="'${PKG_CONFIG_PATH}'"' >> ~#{user}/.bash_profile
  135. # All source packages integrate with pkg-config, remove any previous overrides
  136. sed -i '/BORG_.*_PREFIX/d' ~#{user}/.bash_profile
  137. # Setup pyenv to pick up the custom openssl version (python >= 3.9 requires openssl >= 1.1.1)
  138. echo 'export PYTHON_CONFIGURE_OPTS="--with-openssl='"${PREFIX}"' --with-openssl-rpath=auto"' >> ~#{user}/.bash_profile
  139. echo 'export LDFLAGS=-Wl,-rpath,'"${PREFIX}"'/lib' >> ~#{user}/.bash_profile
  140. # Silence git warning about shallow clones
  141. git config --global advice.detachedHead false
  142. # libattr
  143. VERSION_LIBATTR=2.5.1
  144. curl -s -L https://download.savannah.nongnu.org/releases/attr/attr-${VERSION_LIBATTR}.tar.gz | tar xvz --strip-components=1 --one-top-level=attr -f - -C ${PREFIX}/src
  145. cd ${PREFIX}/src/attr
  146. ./configure --prefix=${PREFIX}
  147. make -j$(nproc) install
  148. # libacl
  149. VERSION_LIBACL=2.3.1
  150. curl -s -L https://download.savannah.nongnu.org/releases/acl/acl-${VERSION_LIBACL}.tar.gz | tar xvz --strip-components=1 --one-top-level=acl -f - -C ${PREFIX}/src
  151. cd ${PREFIX}/src/acl
  152. ./configure --prefix=${PREFIX}
  153. make -j$(nproc) install
  154. # liblz4
  155. VERSION_LIBLZ4=1.9.4
  156. git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBLZ4} https://github.com/lz4/lz4.git
  157. cd ${PREFIX}/src/lz4
  158. make -j$(nproc) install PREFIX=${PREFIX}
  159. # libzstd
  160. VERSION_LIBZSTD=1.5.5
  161. git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBZSTD} https://github.com/facebook/zstd.git
  162. cd ${PREFIX}/src/zstd
  163. make -j$(nproc) install PREFIX=${PREFIX}
  164. # xxHash
  165. VERSION_LIBXXHASH=0.8.2
  166. git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBXXHASH} https://github.com/Cyan4973/xxHash.git
  167. cd ${PREFIX}/src/xxHash
  168. make -j$(nproc) install PREFIX=${PREFIX}
  169. # openssl
  170. VERSION_OPENSSL=1_1_1w
  171. git -C ${PREFIX}/src clone --depth 1 --branch OpenSSL_${VERSION_OPENSSL} https://github.com/openssl/openssl.git
  172. cd ${PREFIX}/src/openssl
  173. ./config --prefix=${PREFIX} --openssldir=${PREFIX}/lib/ssl
  174. make -j$(nproc)
  175. make -j$(nproc) install
  176. # libfuse3 requires ninja
  177. VERSION_NINJA=1.11.1
  178. git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_NINJA} https://github.com/ninja-build/ninja.git
  179. cd ${PREFIX}/src/ninja
  180. python3 configure.py --bootstrap
  181. install --mode=755 --target-directory=${PREFIX}/bin ninja
  182. # libfuse3 requires meson >= 0.50; python3.5 support is dropped in meson >= 0.57
  183. VERSION_MESON=0.56.2
  184. git -C ${PREFIX}/src clone --depth 1 --branch ${VERSION_MESON} https://github.com/mesonbuild/meson.git
  185. ln -s ${PREFIX}/src/meson/meson.py ${PREFIX}/bin/meson
  186. # libfuse3
  187. VERSION_LIBFUSE=3.16.1
  188. git -C ${PREFIX}/src clone --depth 1 --branch fuse-${VERSION_LIBFUSE} https://github.com/libfuse/libfuse.git
  189. cd ${PREFIX}/src/libfuse
  190. mkdir build; cd build
  191. meson setup --prefix ${PREFIX} --libdir ${PREFIX}/lib ..
  192. ninja
  193. ninja install
  194. EOF
  195. end
  196. def install_pyenv(boxname)
  197. return <<-EOF
  198. echo 'export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} --enable-shared"' >> ~/.bash_profile
  199. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
  200. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
  201. . ~/.bash_profile
  202. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  203. echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
  204. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
  205. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
  206. echo 'eval "$(pyenv init -)"' >> ~/.bashrc
  207. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
  208. EOF
  209. end
  210. def fix_pyenv_darwin(boxname)
  211. return <<-EOF
  212. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  213. EOF
  214. end
  215. def install_pythons(boxname)
  216. return <<-EOF
  217. . ~/.bash_profile
  218. echo "PYTHON_CONFIGURE_OPTS: ${PYTHON_CONFIGURE_OPTS}"
  219. pyenv install 3.12.0 # tests
  220. pyenv install 3.11.5 # tests, binary build
  221. pyenv install 3.10.2 # tests
  222. pyenv install 3.9.10 # tests
  223. pyenv rehash
  224. EOF
  225. end
  226. def build_sys_venv(boxname)
  227. return <<-EOF
  228. . ~/.bash_profile
  229. cd /vagrant/borg
  230. virtualenv --python=python3 borg-env
  231. EOF
  232. end
  233. def build_pyenv_venv(boxname)
  234. return <<-EOF
  235. . ~/.bash_profile
  236. cd /vagrant/borg
  237. # use the latest 3.11 release
  238. pyenv global 3.11.5
  239. pyenv virtualenv 3.11.5 borg-env
  240. ln -s ~/.pyenv/versions/borg-env .
  241. EOF
  242. end
  243. def install_borg(fuse)
  244. return <<-EOF
  245. . ~/.bash_profile
  246. cd /vagrant/borg
  247. . borg-env/bin/activate
  248. pip install -U wheel # upgrade wheel, might be too old
  249. cd borg
  250. pip install -r requirements.d/development.lock.txt
  251. python setup.py clean
  252. python setup.py clean2
  253. pip install -e .[#{fuse}]
  254. EOF
  255. end
  256. def install_pyinstaller()
  257. return <<-EOF
  258. . ~/.bash_profile
  259. cd /vagrant/borg
  260. . borg-env/bin/activate
  261. pip install 'pyinstaller==5.13.2'
  262. EOF
  263. end
  264. def build_binary_with_pyinstaller(boxname)
  265. return <<-EOF
  266. . ~/.bash_profile
  267. cd /vagrant/borg
  268. . borg-env/bin/activate
  269. cd borg
  270. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  271. echo 'export PATH="/vagrant/borg:$PATH"' >> ~/.bash_profile
  272. cd .. && tar -czvf borg.tgz borg-dir
  273. EOF
  274. end
  275. def run_tests(boxname, skip_env)
  276. return <<-EOF
  277. . ~/.bash_profile
  278. cd /vagrant/borg/borg
  279. . ../borg-env/bin/activate
  280. if which pyenv 2> /dev/null; then
  281. # for testing, use the earliest point releases of the supported python versions:
  282. pyenv global 3.9.10 3.10.2 3.11.5 3.12.0
  283. pyenv local 3.9.10 3.10.2 3.11.5 3.12.0
  284. fi
  285. # otherwise: just use the system python
  286. # some OSes can only run specific test envs, e.g. because they miss FUSE support:
  287. export TOX_SKIP_ENV='#{skip_env}'
  288. if which fakeroot 2> /dev/null; then
  289. echo "Running tox WITH fakeroot -u"
  290. fakeroot -u tox --skip-missing-interpreters
  291. else
  292. echo "Running tox WITHOUT fakeroot -u"
  293. tox --skip-missing-interpreters
  294. fi
  295. EOF
  296. end
  297. def fs_init(user)
  298. return <<-EOF
  299. # clean up (wrong/outdated) stuff we likely got via rsync:
  300. rm -rf /vagrant/borg/borg/.tox 2> /dev/null
  301. rm -rf /vagrant/borg/borg/borgbackup.egg-info 2> /dev/null
  302. rm -rf /vagrant/borg/borg/__pycache__ 2> /dev/null
  303. find /vagrant/borg/borg/src -name '__pycache__' -exec rm -rf {} \\; 2> /dev/null
  304. chown -R #{user} /vagrant/borg
  305. touch ~#{user}/.bash_profile ; chown #{user} ~#{user}/.bash_profile
  306. echo 'export LANG=en_US.UTF-8' >> ~#{user}/.bash_profile
  307. echo 'export LC_CTYPE=en_US.UTF-8' >> ~#{user}/.bash_profile
  308. echo 'export XDISTN=#{$xdistn}' >> ~#{user}/.bash_profile
  309. EOF
  310. end
  311. Vagrant.configure(2) do |config|
  312. # use rsync to copy content to the folder
  313. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "--exclude", ".python-version"], :rsync__chown => false
  314. # do not let the VM access . on the host machine via the default shared folder!
  315. config.vm.synced_folder ".", "/vagrant", disabled: true
  316. config.vm.provider :virtualbox do |v|
  317. #v.gui = true
  318. v.cpus = $cpus
  319. end
  320. config.vm.define "lunar64" do |b|
  321. b.vm.box = "ubuntu/lunar64"
  322. b.vm.provider :virtualbox do |v|
  323. v.memory = 1024 + $wmem
  324. end
  325. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  326. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  327. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("lunar64")
  328. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  329. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("lunar64", ".*none.*")
  330. end
  331. config.vm.define "jammy64" do |b|
  332. b.vm.box = "ubuntu/jammy64"
  333. b.vm.provider :virtualbox do |v|
  334. v.memory = 1024 + $wmem
  335. end
  336. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  337. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  338. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jammy64")
  339. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  340. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jammy64", ".*none.*")
  341. end
  342. config.vm.define "bookworm64" do |b|
  343. b.vm.box = "debian/bookworm64"
  344. b.vm.provider :virtualbox do |v|
  345. v.memory = 1024 + $wmem
  346. end
  347. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  348. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  349. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bookworm64")
  350. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bookworm64")
  351. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bookworm64")
  352. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  353. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  354. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bookworm64")
  355. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bookworm64", ".*none.*")
  356. end
  357. config.vm.define "bullseye64" do |b|
  358. b.vm.box = "debian/bullseye64"
  359. b.vm.provider :virtualbox do |v|
  360. v.memory = 1024 + $wmem
  361. end
  362. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  363. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  364. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("bullseye64")
  365. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("bullseye64")
  366. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("bullseye64")
  367. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  368. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  369. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("bullseye64")
  370. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bullseye64", ".*none.*")
  371. end
  372. config.vm.define "buster64" do |b|
  373. b.vm.box = "debian/buster64"
  374. b.vm.provider :virtualbox do |v|
  375. v.memory = 1024 + $wmem
  376. end
  377. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  378. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  379. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("buster64")
  380. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("buster64")
  381. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("buster64")
  382. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  383. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  384. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("buster64")
  385. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("buster64", ".*none.*")
  386. end
  387. config.vm.define "stretch64" do |b|
  388. b.vm.box = "generic/debian9"
  389. b.vm.provider :virtualbox do |v|
  390. v.memory = 1024 + $wmem
  391. end
  392. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  393. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  394. b.vm.provision "install source dependencies", :type => :shell, :privileged => true, :inline => install_source_dependencies("vagrant")
  395. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("stretch64")
  396. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("stretch64")
  397. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("stretch64")
  398. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  399. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  400. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("stretch64")
  401. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64", ".*none.*")
  402. end
  403. config.vm.define "freebsd64" do |b|
  404. b.vm.box = "generic/freebsd13"
  405. b.vm.provider :virtualbox do |v|
  406. v.memory = 1024 + $wmem
  407. end
  408. b.ssh.shell = "sh"
  409. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  410. b.vm.provision "packages freebsd", :type => :shell, :inline => packages_freebsd
  411. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd64")
  412. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd64")
  413. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd64")
  414. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  415. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  416. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd64")
  417. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd64", ".*(fuse3|none).*")
  418. end
  419. config.vm.define "openbsd64" do |b|
  420. b.vm.box = "openbsd71-64"
  421. b.vm.provider :virtualbox do |v|
  422. v.memory = 1024 + $wmem
  423. end
  424. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  425. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  426. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  427. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("nofuse")
  428. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64", ".*fuse.*")
  429. end
  430. config.vm.define "netbsd64" do |b|
  431. b.vm.box = "generic/netbsd9"
  432. b.vm.provider :virtualbox do |v|
  433. v.memory = 4096 + $wmem # need big /tmp tmpfs in RAM!
  434. end
  435. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  436. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  437. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  438. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  439. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64", ".*fuse.*")
  440. end
  441. config.vm.define "darwin64" do |b|
  442. b.vm.box = "macos-sierra"
  443. b.vm.provider :virtualbox do |v|
  444. v.memory = 4096 + $wmem
  445. v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
  446. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  447. v.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
  448. # Adjust CPU settings according to
  449. # https://github.com/geerlingguy/macos-virtualbox-vm
  450. v.customize ['modifyvm', :id, '--cpuidset',
  451. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  452. # Disable USB variant requiring Virtualbox proprietary extension pack
  453. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  454. end
  455. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  456. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  457. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  458. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  459. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  460. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  461. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
  462. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  463. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  464. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64", ".*(fuse3|none).*")
  465. end
  466. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  467. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  468. config.vm.define "openindiana64" do |b|
  469. b.vm.box = "openindiana"
  470. b.vm.provider :virtualbox do |v|
  471. v.memory = 2048 + $wmem
  472. end
  473. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  474. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  475. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
  476. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("nofuse")
  477. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64", ".*fuse.*")
  478. end
  479. # TODO: create more VMs with python 3.9+ and openssl 1.1 or 3.0.
  480. # See branch 1.1-maint for a better equipped Vagrantfile (but still on py35 and openssl 1.0).
  481. end