From 09e7e951a25653b19f0b8fcdaa4565435a54c405 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Mon, 30 Jun 2025 09:59:26 +0200 Subject: [PATCH] cmake(ci): Rework Vagrantfile ci: Rework BSD workflows ci: Bump freebsd Vagrantfile from python 3.9 to 3.11 --- .github/workflows/amd64_freebsd_cmake.yml | 54 ++++++++++++++--------- cmake/Makefile | 2 +- cmake/vagrant/freebsd/cpp/Vagrantfile | 10 ++++- cmake/vagrant/freebsd/dotnet/Vagrantfile | 10 ++++- cmake/vagrant/freebsd/java/Vagrantfile | 10 ++++- cmake/vagrant/freebsd/python/Vagrantfile | 14 ++++-- cmake/vagrant/netbsd/cpp/Vagrantfile | 4 +- cmake/vagrant/netbsd/dotnet/Vagrantfile | 6 +-- cmake/vagrant/netbsd/java/Vagrantfile | 6 +-- cmake/vagrant/netbsd/python/Vagrantfile | 8 ++-- 10 files changed, 81 insertions(+), 43 deletions(-) diff --git a/.github/workflows/amd64_freebsd_cmake.yml b/.github/workflows/amd64_freebsd_cmake.yml index 9cf860332a..81fa90da0b 100644 --- a/.github/workflows/amd64_freebsd_cmake.yml +++ b/.github/workflows/amd64_freebsd_cmake.yml @@ -1,3 +1,4 @@ +# ref: https://github.com/actions/runner-images name: amd64 FreeBSD CMake on: [push, pull_request, workflow_dispatch] @@ -6,31 +7,44 @@ concurrency: group: ${{github.workflow}}-${{github.ref}} cancel-in-progress: true -# Only macos-12 runner provide virtualisation with vagrant/virtualbox installed. -# ref: https://github.com/actions/runner-images/tree/main/images/macos -# ref: https://app.vagrantup.com/generic/boxes/freebsd13 +# Building using the github runner environement directly. jobs: vagrant: strategy: - fail-fast: false matrix: - distro: [freebsd] - lang: [cpp, python] - allow_failure: [false] - include: - - distro: freebsd - lang: dotnet - allow_failure: true - - distro: freebsd - lang: java - allow_failure: true - name: amd64•FreeBSD•CMake•${{matrix.lang}} - runs-on: macos-12 + distro: [ + freebsd, + #netbsd, + #openbsd, + ] + lang: [ + cpp, + dotnet, + java, + python, + ] + allow_failure: [true] + fail-fast: false + name: amd64•${{matrix.distro}}•CMake•${{matrix.lang}} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: vagrant version - run: Vagrant --version - - name: VirtualBox version - run: virtualbox -h + - name: Virtualbox install + run: | + sudo apt update -q + sudo apt install -yq virtualbox + virtualbox --help + - name: Vagrant install + run: | + sudo apt update -q + wget https://releases.hashicorp.com/vagrant/2.4.7/vagrant_2.4.7-1_amd64.deb + sudo apt install -y ./vagrant_2.4.7-1_amd64.deb + vagrant --version - name: Build run: make --directory=cmake ${{matrix.distro}}_${{matrix.lang}} + + amd64_bsd_cmake: + runs-on: ubuntu-latest + needs: vagrant + steps: + - uses: actions/checkout@v4 diff --git a/cmake/Makefile b/cmake/Makefile index f63de4d762..021c17fa42 100644 --- a/cmake/Makefile +++ b/cmake/Makefile @@ -803,4 +803,4 @@ clean: clean_all clean_platforms clean_toolchains clean_web clean_vagrant clean_ distclean: clean -docker container rm -f $$(docker container ls -aq) -docker image rm -f $$(docker image ls -aq) - -vagrant box remove -f generic/freebsd12 + -vagrant box remove -f generic/freebsd14 diff --git a/cmake/vagrant/freebsd/cpp/Vagrantfile b/cmake/vagrant/freebsd/cpp/Vagrantfile index 31e311c074..5440fd949e 100644 --- a/cmake/vagrant/freebsd/cpp/Vagrantfile +++ b/cmake/vagrant/freebsd/cpp/Vagrantfile @@ -14,6 +14,7 @@ Vagrant.configure("2") do |config| # boxes at https://vagrantcloud.com/search. config.vm.guest = :freebsd config.vm.box = "generic/freebsd14" + config.vm.box_version = "4.3.12" config.vm.provider "virtualbox" do |v| v.name = "ortools_freebsd_cpp" end @@ -48,9 +49,14 @@ Vagrant.configure("2") do |config| # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. - #config.vm.synced_folder "../../..", "/home/vagrant/project" - config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true + # config.vm.synced_folder "../data", "/vagrant_data" + # Disable the default share of the current code directory. Doing this + # provides improved isolation between the vagrant box and your host + # by making sure your Vagrantfile isn't accessible to the vagrant box. + # If you use this you may want to enable additional shared subfolders as + # shown above. + config.vm.synced_folder ".", "/vagrant", disabled: true # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. diff --git a/cmake/vagrant/freebsd/dotnet/Vagrantfile b/cmake/vagrant/freebsd/dotnet/Vagrantfile index 567bd27889..7648c0ae11 100644 --- a/cmake/vagrant/freebsd/dotnet/Vagrantfile +++ b/cmake/vagrant/freebsd/dotnet/Vagrantfile @@ -14,6 +14,7 @@ Vagrant.configure("2") do |config| # boxes at https://vagrantcloud.com/search. config.vm.guest = :freebsd config.vm.box = "generic/freebsd14" + config.vm.box_version = "4.3.12" config.vm.provider "virtualbox" do |v| v.name = "ortools_freebsd_dotnet" end @@ -48,9 +49,14 @@ Vagrant.configure("2") do |config| # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. - #config.vm.synced_folder "../../..", "/home/vagrant/project" - config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true + # config.vm.synced_folder "../data", "/vagrant_data" + # Disable the default share of the current code directory. Doing this + # provides improved isolation between the vagrant box and your host + # by making sure your Vagrantfile isn't accessible to the vagrant box. + # If you use this you may want to enable additional shared subfolders as + # shown above. + config.vm.synced_folder ".", "/vagrant", disabled: true # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. diff --git a/cmake/vagrant/freebsd/java/Vagrantfile b/cmake/vagrant/freebsd/java/Vagrantfile index c6584eb767..fff3664342 100644 --- a/cmake/vagrant/freebsd/java/Vagrantfile +++ b/cmake/vagrant/freebsd/java/Vagrantfile @@ -14,6 +14,7 @@ Vagrant.configure("2") do |config| # boxes at https://vagrantcloud.com/search. config.vm.guest = :freebsd config.vm.box = "generic/freebsd14" + config.vm.box_version = "4.3.12" config.vm.provider "virtualbox" do |v| v.name = "ortools_freebsd_java" end @@ -48,9 +49,14 @@ Vagrant.configure("2") do |config| # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. - #config.vm.synced_folder "../../..", "/home/vagrant/project" - config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true + # config.vm.synced_folder "../data", "/vagrant_data" + # Disable the default share of the current code directory. Doing this + # provides improved isolation between the vagrant box and your host + # by making sure your Vagrantfile isn't accessible to the vagrant box. + # If you use this you may want to enable additional shared subfolders as + # shown above. + config.vm.synced_folder ".", "/vagrant", disabled: true # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. diff --git a/cmake/vagrant/freebsd/python/Vagrantfile b/cmake/vagrant/freebsd/python/Vagrantfile index 73a6ba7b2a..7cd93bd1d5 100644 --- a/cmake/vagrant/freebsd/python/Vagrantfile +++ b/cmake/vagrant/freebsd/python/Vagrantfile @@ -14,6 +14,7 @@ Vagrant.configure("2") do |config| # boxes at https://vagrantcloud.com/search. config.vm.guest = :freebsd config.vm.box = "generic/freebsd14" + config.vm.box_version = "4.3.12" config.vm.provider "virtualbox" do |v| v.name = "ortools_freebsd_python" end @@ -48,9 +49,14 @@ Vagrant.configure("2") do |config| # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. - #config.vm.synced_folder "../../..", "/home/vagrant/project" - config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true + # config.vm.synced_folder "../data", "/vagrant_data" + # Disable the default share of the current code directory. Doing this + # provides improved isolation between the vagrant box and your host + # by making sure your Vagrantfile isn't accessible to the vagrant box. + # If you use this you may want to enable additional shared subfolders as + # shown above. + config.vm.synced_folder ".", "/vagrant", disabled: true # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. @@ -75,8 +81,8 @@ Vagrant.configure("2") do |config| set -x pkg update -f pkg install -y git cmake - pkg install -y swig python39 py39-wheel py39-pip py39-pytest-virtualenv - pkg install -y py39-numpy py39-pandas py39-matplotlib + pkg install -y swig python311 py311-wheel py311-pip py311-pytest-virtualenv + pkg install -y py311-numpy py311-pandas py311-matplotlib SHELL config.vm.provision "file", source: "../../../../CMakeLists.txt", destination: "$HOME/project/" diff --git a/cmake/vagrant/netbsd/cpp/Vagrantfile b/cmake/vagrant/netbsd/cpp/Vagrantfile index 0378b3d5a8..db188d48cc 100644 --- a/cmake/vagrant/netbsd/cpp/Vagrantfile +++ b/cmake/vagrant/netbsd/cpp/Vagrantfile @@ -73,8 +73,8 @@ Vagrant.configure("2") do |config| # note: clang installed by default config.vm.provision "env", type: "shell", inline:<<-SHELL set -x - pkg update -f - pkg install -y git cmake + pkgin update + pkgin -y install git cmake SHELL config.vm.provision "file", source: "../../../../CMakeLists.txt", destination: "$HOME/project/" diff --git a/cmake/vagrant/netbsd/dotnet/Vagrantfile b/cmake/vagrant/netbsd/dotnet/Vagrantfile index bceb231d8b..09ac57e594 100644 --- a/cmake/vagrant/netbsd/dotnet/Vagrantfile +++ b/cmake/vagrant/netbsd/dotnet/Vagrantfile @@ -73,10 +73,10 @@ Vagrant.configure("2") do |config| # note: clang installed by default config.vm.provision "env", type: "shell", inline:<<-SHELL set -x - pkg update -f - pkg install -y git cmake + pkgin update + pkgin -y install git cmake kldload linux64 - pkg install -y swig linux-dotnet-sdk + pkgin -y install swig linux-dotnet-sdk SHELL config.vm.provision "file", source: "../../../../CMakeLists.txt", destination: "$HOME/project/" diff --git a/cmake/vagrant/netbsd/java/Vagrantfile b/cmake/vagrant/netbsd/java/Vagrantfile index 050e73496e..7c44664b8e 100644 --- a/cmake/vagrant/netbsd/java/Vagrantfile +++ b/cmake/vagrant/netbsd/java/Vagrantfile @@ -73,9 +73,9 @@ Vagrant.configure("2") do |config| # note: clang installed by default config.vm.provision "env", type: "shell", inline:<<-SHELL set -x - pkg update -f - pkg install -y git cmake - pkg install -y swig openjdk11 maven + pkgin update + pkg -y install git cmake + pkg -y install swig openjdk11 maven mount -t fdescfs fdesc /dev/fd mount -t procfs proc /proc SHELL diff --git a/cmake/vagrant/netbsd/python/Vagrantfile b/cmake/vagrant/netbsd/python/Vagrantfile index 6cfb5783f6..86340ab3d0 100644 --- a/cmake/vagrant/netbsd/python/Vagrantfile +++ b/cmake/vagrant/netbsd/python/Vagrantfile @@ -73,10 +73,10 @@ Vagrant.configure("2") do |config| # note: clang installed by default config.vm.provision "env", type: "shell", inline:<<-SHELL set -x - pkg update -f - pkg install -y git cmake - pkg install -y swig python39 py39-wheel py39-pip py39-pytest-virtualenv - pkg install -y py39-numpy py39-pandas py39-matplotlib + pkgin update + pkgin -y install git cmake + pkgin -y install swig python311 py311-wheel py311-pip py311-pytest-virtualenv + pkgin -y install py311-numpy py311-pandas py311-matplotlib SHELL config.vm.provision "file", source: "../../../../CMakeLists.txt", destination: "$HOME/project/"