From: Simon Marchi Date: Mon, 27 May 2024 13:52:15 +0000 (-0400) Subject: jjb: babeltrace: use clang-format-16 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=HEAD;hp=7588e01393026c587202898117b7597e143ed8ba;p=lttng-ci.git jjb: babeltrace: use clang-format-16 Signed-off-by: Simon Marchi Change-Id: I97e7719f478fe9305ee420bb41176df57e78b813 --- diff --git a/automation/ansible/group_vars/node_armhf.yml b/automation/ansible/group_vars/node_armhf.yml deleted file mode 100644 index 27c2931..0000000 --- a/automation/ansible/group_vars/node_armhf.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# The SATA controllers on the boards that are running the armhf -# nodes are somewhat flaky, and the root filesystem often ends -# up readonly due to errors. When the FS goes read-only, jobs -# will fail so the easiest action is to have the node reboot. -common_node_rootfs_readonly_reboot: true diff --git a/automation/ansible/group_vars/node_standalone.yml b/automation/ansible/group_vars/node_standalone.yml index d6f5adb..ab43b4c 100644 --- a/automation/ansible/group_vars/node_standalone.yml +++ b/automation/ansible/group_vars/node_standalone.yml @@ -1,4 +1,8 @@ --- + +# Jenkins connects to the standalone nodes as the root user +jenkins_user: false + # jenkins connects to standalone nodes as the root user extra_root_ssh_authorized_keys: # yamllint disable-line rule:line-length diff --git a/automation/ansible/group_vars/node_wandboard.yml b/automation/ansible/group_vars/node_wandboard.yml new file mode 100644 index 0000000..27c2931 --- /dev/null +++ b/automation/ansible/group_vars/node_wandboard.yml @@ -0,0 +1,6 @@ +--- +# The SATA controllers on the boards that are running the armhf +# nodes are somewhat flaky, and the root filesystem often ends +# up readonly due to errors. When the FS goes read-only, jobs +# will fail so the easiest action is to have the node reboot. +common_node_rootfs_readonly_reboot: true diff --git a/automation/ansible/host_vars/ci-rootnode-deb12-amd64-1c-02.yml b/automation/ansible/host_vars/ci-rootnode-deb12-amd64-1c-02.yml index 2a87207..4abe413 100644 --- a/automation/ansible/host_vars/ci-rootnode-deb12-amd64-1c-02.yml +++ b/automation/ansible/host_vars/ci-rootnode-deb12-amd64-1c-02.yml @@ -1,4 +1,10 @@ --- +# This node uses an older linux kernel for u32/u64 integration tests +# which creates conflicting package dependencies +# +cross_compilers_debian_bookworm_snapshot: false +cross_compilers_install: false + netplan_manage: true netplan_content: | network: diff --git a/automation/ansible/hosts b/automation/ansible/hosts index 793f4a4..345e21c 100644 --- a/automation/ansible/hosts +++ b/automation/ansible/hosts @@ -33,6 +33,9 @@ ci-host-win11-arm64-01.internal.efficios.com [infra_lava] lava-master-03.internal.efficios.com +[node_wandboard] +ci-node-deb12-armhf-[01:08] + [node_armhf] ci-node-deb12-armhf-01 ci-node-deb12-armhf-02 @@ -193,9 +196,18 @@ ci-rootnode-el8-amd64-1d-01 # While ci-node-sles12sp5-amd64-1b-01 has python 3.4, more recent # versions of ansible require python 3.5. Therefore python2 is used. ci-node-sles12sp5-amd64-1b-01 ansible_python_interpreter=python2 +ci-node-sles12sp5-amd64-2a-01 ansible_python_interpreter=python2 +ci-node-sles12sp5-amd64-2b-01 ansible_python_interpreter=python2 +ci-node-sles12sp5-amd64-2c-01 ansible_python_interpreter=python2 ci-node-sles15sp4-amd64-1b-01 +ci-node-sles15sp4-amd64-2a-01 +ci-node-sles15sp4-amd64-2b-01 +ci-node-sles15sp4-amd64-2c-01 ci-rootnode-sles15sp4-amd64-1d-01 ci-node-sles15sp5-amd64-1b-01 +ci-node-sles15sp5-amd64-2a-01 +ci-node-sles15sp5-amd64-2b-01 +ci-node-sles15sp5-amd64-2c-01 [node_el] ci-node-el7-amd64-02-01 ansible_python_interpreter=python2 diff --git a/automation/ansible/hosts.yml b/automation/ansible/hosts.yml index 33b9062..1cb9dd0 100644 --- a/automation/ansible/hosts.yml +++ b/automation/ansible/hosts.yml @@ -1,10 +1,14 @@ --- -- hosts: hosts +- hosts: hosts:!windows roles: # Setup filesystem and network configuration before other roles - zfs - netplan +- hosts: hosts + roles: - common +- hosts: hosts:!windows + roles: - libvirt - lxd - rasdaemon diff --git a/automation/ansible/playbooks/ci-instances.yml b/automation/ansible/playbooks/ci-instances.yml index 1259a7a..b4cfac5 100644 --- a/automation/ansible/playbooks/ci-instances.yml +++ b/automation/ansible/playbooks/ci-instances.yml @@ -36,7 +36,7 @@ object: "{{item.vm}}" with_items: "{{containers}}" - name: Update DNS entries - when: not skip_dns and inventory_hostname == 'localhost' + when: not skip_dns and inventory_hostname == 'localhost' and item.meta|default(false) with_items: "{{containers}}" ansible.builtin.command: argv: [ diff --git a/automation/ansible/roles/common/tasks/setup-Windows.yml b/automation/ansible/roles/common/tasks/setup-Windows.yml index 2ef6c88..5c81a81 100644 --- a/automation/ansible/roles/common/tasks/setup-Windows.yml +++ b/automation/ansible/roles/common/tasks/setup-Windows.yml @@ -11,6 +11,17 @@ name: sshd start_mode: auto state: started +- name: Allow Terminal Server connections + ansible.windows.win_regedit: + path: 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' + name: 'fDenyTSConnections' + data: '0' + type: 'dword' +- name: Run RDP automatically + ansible.windows.win_service: + name: 'TermService' + start_mode: 'auto' + state: 'started' - name: Turn off standy ansible.windows.win_command: 'C:\Windows\system32\powercfg.exe /change standby-timeout-ac 0' - name: Turn off hibernation @@ -50,7 +61,32 @@ ansible.windows.win_template: src: 'authorized_keys.j2' dest: 'c:\ProgramData\ssh\administrators_authorized_keys' - +# c.f. https://galaxy.ansible.com/ui/repo/published/community/windows/content/module/win_firewall_rule/ +- name: Firewall rule to alloc ICMP v4 on all type codes + community.windows.win_firewall_rule: + name: ICMP Allow incoming V4 echo request + enabled: true + state: present + profiles: + - domain + - private + - public + action: allow + direction: in + protocol: icmpv4 + icmp_type_code: '*' +- name: Firewall rule to allow RDP on TCP port 3389 + community.windows.win_firewall_rule: + name: Remote Desktop + localport: 3389 + action: allow + direction: in + protocol: tcp + profiles: + - domain + - private + state: present + enabled: true - name: Reboot if domain changed when: domain_state.reboot_required ansible.windows.win_reboot: diff --git a/automation/ansible/roles/compilers/vars/Debian-12.yml b/automation/ansible/roles/compilers/vars/Debian-12.yml index 4c6c41f..8e0ac5d 100644 --- a/automation/ansible/roles/compilers/vars/Debian-12.yml +++ b/automation/ansible/roles/compilers/vars/Debian-12.yml @@ -10,16 +10,20 @@ compilers_packages: - clang-13 - clang-14 - clang-15 + - clang-16 - libclang-dev - libclang-13-dev - libclang-14-dev - libclang-15-dev + - libclang-16-dev - clang-format - clang-format-13 - clang-format-14 - clang-format-15 + - clang-format-16 - clang-tidy - clang-tidy-13 - clang-tidy-14 - clang-tidy-15 + - clang-tidy-16 - bear diff --git a/automation/ansible/roles/cross-compilers/defaults/main.yml b/automation/ansible/roles/cross-compilers/defaults/main.yml index d50918b..0123d7b 100644 --- a/automation/ansible/roles/cross-compilers/defaults/main.yml +++ b/automation/ansible/roles/cross-compilers/defaults/main.yml @@ -1,3 +1,4 @@ --- compilers_legacy_install: true cross_compilers_debian_bookworm_snapshot: false +cross_compilers_install: true diff --git a/automation/ansible/roles/cross-compilers/tasks/setup-Alpine.yml b/automation/ansible/roles/cross-compilers/tasks/setup-Alpine.yml index 64f96da..a216231 100644 --- a/automation/ansible/roles/cross-compilers/tasks/setup-Alpine.yml +++ b/automation/ansible/roles/cross-compilers/tasks/setup-Alpine.yml @@ -3,4 +3,5 @@ apk: update_cache=yes - name: Ensure cross-compilers packages are installed. + when: cross_compilers_install|default(true) apk: "name={{ cross_compilers_packages }} state=present" diff --git a/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml b/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml index 95173f2..95add22 100644 --- a/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml +++ b/automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml @@ -16,6 +16,7 @@ update_cache: true - name: Ensure cross-compilers packages are installed. + when: cross_compilers_install|default(true) ansible.builtin.apt: name: "{{ cross_compilers_packages | difference(lookup('vars', 'cross_compilers_packages_exclude_{{ansible_userspace_architecture|default(ansible_architecture)}}', default=[]))}}" diff --git a/automation/ansible/roles/cross-compilers/tasks/setup-RedHat.yml b/automation/ansible/roles/cross-compilers/tasks/setup-RedHat.yml index c8429d2..dd41075 100644 --- a/automation/ansible/roles/cross-compilers/tasks/setup-RedHat.yml +++ b/automation/ansible/roles/cross-compilers/tasks/setup-RedHat.yml @@ -1,5 +1,6 @@ --- - name: Ensure cross-compilers packages are installed. + when: cross_compilers_install|default(true) dnf: name: "{{ cross_compilers_packages }}" state: installed diff --git a/automation/ansible/roles/libvirt/tasks/main.yml b/automation/ansible/roles/libvirt/tasks/main.yml index d773102..93569f8 100644 --- a/automation/ansible/roles/libvirt/tasks/main.yml +++ b/automation/ansible/roles/libvirt/tasks/main.yml @@ -1,7 +1,7 @@ --- - name: Install virtualization packages apt: - name: ['qemu-kvm', 'libvirt-daemon-system', 'python3-libvirt'] + name: ['qemu-kvm', 'libvirt-daemon-system', 'python3-libvirt', 'python3-lxml'] - name: Run libvirtd systemd: name: libvirtd diff --git a/automation/ansible/roles/lttng-tools/vars/Debian.yml b/automation/ansible/roles/lttng-tools/vars/Debian.yml index b03ecdb..4e8423d 100644 --- a/automation/ansible/roles/lttng-tools/vars/Debian.yml +++ b/automation/ansible/roles/lttng-tools/vars/Debian.yml @@ -5,6 +5,7 @@ lttng_tools_packages: - libpopt-dev - libxml2-dev - shellcheck + - systemtap-sdt-dev lttng_tools_packages_no_recommends: - asciidoc diff --git a/automation/ansible/roles/lttng-tools/vars/RedHat.yml b/automation/ansible/roles/lttng-tools/vars/RedHat.yml index 2f80ef9..85b79cc 100644 --- a/automation/ansible/roles/lttng-tools/vars/RedHat.yml +++ b/automation/ansible/roles/lttng-tools/vars/RedHat.yml @@ -4,4 +4,5 @@ lttng_tools_packages: - bash-completion - libxml2-devel - popt-devel + - systemtap-sdt-devel - xmlto diff --git a/automation/ansible/roles/lttng-tools/vars/Suse.yml b/automation/ansible/roles/lttng-tools/vars/Suse.yml index b41902c..41f7ad3 100644 --- a/automation/ansible/roles/lttng-tools/vars/Suse.yml +++ b/automation/ansible/roles/lttng-tools/vars/Suse.yml @@ -3,6 +3,7 @@ lttng_tools_packages: - bash-completion - libxml2-devel - popt-devel + - systemtap-sdt-devel lttng_tools_packages_no_recommends: - asciidoc diff --git a/automation/ansible/roles/lxd/defaults/main.yml b/automation/ansible/roles/lxd/defaults/main.yml index 3ce91fe..d5dcf05 100644 --- a/automation/ansible/roles/lxd/defaults/main.yml +++ b/automation/ansible/roles/lxd/defaults/main.yml @@ -6,7 +6,7 @@ lxd_container_defaults: source: type: image mode: pull - server: https://images.linuxcontainers.org - protocol: simplestreams - alias: debian/bookworm/cloud/amd64 + # Until the cluster is migrated to Incus, this source will not work + # server: https://images.linuxcontainers.org + alias: debian/bookworm/cloud/amd64/ci-node/lxd wait_for_container: true diff --git a/automation/ansible/roles/lxd/tasks/container.yml b/automation/ansible/roles/lxd/tasks/container.yml index 1f68334..2dfe552 100644 --- a/automation/ansible/roles/lxd/tasks/container.yml +++ b/automation/ansible/roles/lxd/tasks/container.yml @@ -2,5 +2,5 @@ - name: Merge defaults set_fact: lxd_container_config: "{{lxd_container_defaults|combine(object)}}" -- name: Manage container +- name: "Manage container {{lxd_container_config.name|default('Unknown')}}" community.general.lxd_container: "{{lxd_container_config}}" diff --git a/automation/ansible/roles/requirements.yml b/automation/ansible/roles/requirements.yml index 649feec..583571d 100644 --- a/automation/ansible/roles/requirements.yml +++ b/automation/ansible/roles/requirements.yml @@ -3,3 +3,6 @@ collections: - name: community.general version: '>=5.4.0' type: galaxy + - name: community.windows + version: '>=2.2.0' + type: galaxy diff --git a/automation/ansible/roles/suse/tasks/product.yml b/automation/ansible/roles/suse/tasks/product.yml index 0847a6c..2979582 100644 --- a/automation/ansible/roles/suse/tasks/product.yml +++ b/automation/ansible/roles/suse/tasks/product.yml @@ -1,12 +1,12 @@ --- -- name: Connect product using full version +- name: "Connect product '{{product}}' using full version" ansible.builtin.command: - argv: ['suseconnect', '-p', "{{product}}/{{ansible_distribution_version}}/{{ansible_architecture}}"] + argv: ['SUSEConnect', '-p', "{{product}}/{{ansible_distribution_version}}/{{ansible_architecture}}"] register: connect ignore_errors: true # Some products don't use the full version, but only the major version -- name: Connect production using major version +- name: "Connect product '{{product}}' using major version" when: connect.rc != 0 ansible.builtin.command: - argv: ['suseconnect', '-p', "{{product}}/{{ansible_distribution_major_version}}/{{ansible_architecture}}"] + argv: ['SUSEConnect', '-p', "{{product}}/{{ansible_distribution_major_version}}/{{ansible_architecture}}"] diff --git a/automation/ansible/vars/ci-instances.yml b/automation/ansible/vars/ci-instances.yml index 0b5f27a..c1c6ad7 100644 --- a/automation/ansible/vars/ci-instances.yml +++ b/automation/ansible/vars/ci-instances.yml @@ -98,62 +98,6 @@ containers: # zfs create -o mountpoint=/storage/git-mirror tank/lxd/custom/git-mirror source: /storage/git-mirror type: disk - - meta: - address: 172.18.16.1 - lxd: - name: ci-node-deb12-amd64-01 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - - meta: - address: 172.18.16.2 - lxd: - name: ci-node-deb12-amd64-02 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - - meta: - address: 172.18.16.3 - lxd: - name: ci-node-deb12-amd64-03 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - - meta: - address: 172.18.16.4 - lxd: - name: ci-node-deb12-amd64-04 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - - meta: - address: 172.18.16.5 - lxd: - name: ci-node-deb12-amd64-05 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - - meta: - address: 172.18.16.6 - lxd: - name: ci-node-deb12-amd64-06 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - - meta: - address: 172.18.16.7 - lxd: - name: ci-node-deb12-amd64-07 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - - meta: - address: 172.18.16.8 - lxd: - name: ci-node-deb12-amd64-08 - jenkins: - label: 'deb12-amd64 deb12' - mode: EXCLUSIVE - meta: address: 172.18.16.9 lxd: @@ -785,6 +729,99 @@ containers: jenkins: label: 'deb12-i386 deb12' mode: EXCLUSIVE + - meta: + address: 172.18.16.91 + lxd: + name: ci-node-sles15sp4-amd64-2a-01 + target: ci-host-amd64-2a + source: + alias: 'sles/15.4/cloud/amd64/ci-node/lxd' + type: image + jenkins: + label: 'sles15sp4-amd64' + mode: EXCLUSIVE + - meta: + address: 172.18.16.92 + lxd: + name: ci-node-sles15sp4-amd64-2b-01 + target: ci-host-amd64-2b + source: + alias: 'sles/15.4/cloud/amd64/ci-node/lxd' + type: image + jenkins: + label: 'sles15sp4-amd64' + mode: EXCLUSIVE + - meta: + address: 172.18.16.93 + lxd: + name: ci-node-sles15sp4-amd64-2c-01 + target: ci-host-amd64-2c + source: + alias: 'sles/15.4/cloud/amd64/ci-node/lxd' + type: image + jenkins: + label: 'sles15sp4-amd64' + mode: EXCLUSIVE + - meta: + address: 172.18.16.94 + lxd: + name: ci-node-sles15sp5-amd64-2a-01 + target: ci-host-amd64-2a + source: + alias: 'sles/15.5/cloud/amd64/ci-node/lxd' + type: image + jenkins: + label: 'sles15sp5-amd64' + mode: EXCLUSIVE + - meta: + address: 172.18.16.95 + lxd: + name: ci-node-sles15sp5-amd64-2b-01 + target: ci-host-amd64-2b + source: + alias: 'sles/15.5/cloud/amd64/ci-node/lxd' + type: image + jenkins: + label: 'sles15sp5-amd64' + mode: EXCLUSIVE + - meta: + address: 172.18.16.96 + lxd: + name: ci-node-sles15sp5-amd64-2c-01 + target: ci-host-amd64-2c + source: + alias: 'sles/15.5/cloud/amd64/ci-node/lxd' + type: image + jenkins: + label: 'sles15sp5-amd64' + mode: EXCLUSIVE + - meta: + address: 172.18.16.97 + jenkins: + label: 'sles12sp5-amd64' + mode: EXCLUSIVE + vm: + name: 'ci-node-sles12sp5-amd64-2a-01' + disk: '/var/lib/libvirt/images/ci-node-sles12sp5-amd64-2a-01.qcow' + host: 'ci-host-amd64-2a.internal.efficios.com' + - meta: + address: 172.18.16.98 + jenkins: + label: 'sles12sp5-amd64' + mode: EXCLUSIVE + vm: + name: 'ci-node-sles12sp5-amd64-2b-01' + disk: '/var/lib/libvirt/images/ci-node-sles12sp5-amd64-2b-01.qcow' + host: 'ci-host-amd64-2b.internal.efficios.com' + - meta: + address: 172.18.16.99 + jenkins: + label: 'sles12sp5-amd64' + mode: EXCLUSIVE + vm: + name: 'ci-node-sles12sp5-amd64-2c-01' + disk: '/var/lib/libvirt/images/ci-node-sles12sp5-amd64-2c-01.qcow' + host: 'ci-host-amd64-2c.internal.efficios.com' # "Root " nodes in libvirt, since Jenkins can use the "libvirt agents" plugin # to revert to a specific snapshot before running a job # diff --git a/jobs/babeltrace.yaml b/jobs/babeltrace.yaml index e280627..fc8aae7 100644 --- a/jobs/babeltrace.yaml +++ b/jobs/babeltrace.yaml @@ -370,7 +370,7 @@ publishers: - archive: - artifacts: 'black.out,flake8.out,isort.out,clang-format.out,shellcheck.out' + artifacts: 'black.out,flake8.out,isort.out,clang-format.out,shellcheck.out,check-include-guards.out' allow-empty: false - workspace-cleanup: *babeltrace_publisher_workspace-cleanup_defaults @@ -543,7 +543,7 @@ publishers: - workspace-cleanup: *babeltrace_publisher_workspace-cleanup_defaults - archive: - artifacts: 'black.out,flake8.out,isort.out,clang-format.out,shellcheck.out' + artifacts: 'black.out,flake8.out,isort.out,clang-format.out,shellcheck.out,check-include-guards.out' allow-empty: false - ircbot: *babeltrace_publisher_ircbot_defaults - email-ext: *babeltrace_publisher_email-ext_defaults @@ -686,6 +686,14 @@ filter: '' touchstone: '' warnings_status: FAILED + - 'dev_review_babeltrace_{version}_{buildtype}': + buildtype: slesbuild + platforms: !!python/tuple [sles12sp5-amd64, sles15sp4-amd64, sles15sp5-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [std] + filter: '' + touchstone: '' + warnings_status: FAILED - 'dev_review_babeltrace_{version}_{buildtype}': version: master buildtype: winbuild diff --git a/jobs/binutils-gdb.yaml b/jobs/binutils-gdb.yaml index 28fcf9b..2e2d914 100644 --- a/jobs/binutils-gdb.yaml +++ b/jobs/binutils-gdb.yaml @@ -165,7 +165,7 @@ platforms: !!python/tuple [deb12-amd64] target_boards: !!python/tuple ["unix", "native-gdbserver", "native-extended-gdbserver"] - 'binutils-gdb_{version}_macosbuild': - platforms: !!python/tuple [macos-amd64, macos-arm64] + platforms: !!python/tuple [macos-arm64] target_boards: !!python/tuple ["unix"] - project: diff --git a/jobs/lttng-modules.yaml b/jobs/lttng-modules.yaml index 744a712..f5ce833 100644 --- a/jobs/lttng-modules.yaml +++ b/jobs/lttng-modules.yaml @@ -685,7 +685,7 @@ - string: name: 'mversion' default: 'master' - description: 'The lttng-modules branch to build.' + description: 'The lttng-modules branch to build. Use `refs/XXX` for a specific ref, or a commit hash.' - string: name: 'mgitrepo' default: 'git://git-mirror.internal.efficios.com/lttng/lttng-modules.git' @@ -710,6 +710,14 @@ name: 'getsrc_version' default: 'main' description: 'The tag or commit to use when cloning the getsrc tool' + - bool: + name: 'DEBUG' + default: false + description: "Enable verbose builds" + - bool: + name: 'FAIL_ON_WARNINGS' + default: false + description: "Fail the lttng-modules build if there are any warnings" concurrent: true diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh index e09324c..12900c7 100755 --- a/scripts/babeltrace/build.sh +++ b/scripts/babeltrace/build.sh @@ -70,6 +70,25 @@ verne() { [ "$res" -ne "0" ] } +mktemp_compat() { + case "$platform" in + macos*) + # On MacOSX, mktemp doesn't respect TMPDIR in the same way as many + # other systems. Use the final positional argument to force the + # tempfile or tempdir to be created inside $TMPDIR, which must + # already exist. + if [ -n "${TMPDIR}" ] ; then + mktemp "${@}" "${TMPDIR}/tmp.XXXXXXXXXX" + else + mktemp "${@}" + fi + ;; + *) + mktemp "${@}" + ;; + esac +} + print_header() { set +x @@ -327,7 +346,7 @@ oot) print_header "Build: Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure @@ -342,7 +361,7 @@ dist) $MAKE dist # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Extract the distribution tar in the build directory, @@ -357,14 +376,14 @@ oot-dist) print_header "Build: Distribution Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Run configure out of tree and generate the tar file "$SRCDIR/configure" || failed_configure $MAKE dist - dist_srcdir="$(mktemp -d)" + dist_srcdir="$(mktemp_compat -d)" cd "$dist_srcdir" # Extract the distribution tar in the new source directory, @@ -372,7 +391,7 @@ oot-dist) $TAR xvf "$builddir"/*.tar.* --strip 1 # Create and enter a second temporary build directory - builddir="$(mktemp -d)" + builddir="$(mktemp_compat -d)" cd "$builddir" # Run configure from the extracted distribution tar, diff --git a/scripts/babeltrace/lint.sh b/scripts/babeltrace/lint.sh index e177990..5581c35 100755 --- a/scripts/babeltrace/lint.sh +++ b/scripts/babeltrace/lint.sh @@ -61,7 +61,7 @@ else fi if [[ -f tools/format-cpp.sh ]]; then - FORMATTER="clang-format-15 -i" tools/format-cpp.sh + FORMATTER="clang-format-16 -i" tools/format-cpp.sh git diff --exit-code | tee ../../clang-format.out || exit_code=1 fi @@ -69,4 +69,8 @@ if [[ -f tools/shellcheck.sh ]]; then tools/shellcheck.sh | tee ../../shellcheck.out || exit_code=1 fi +if [[ -f tools/check-include-guards.sh ]]; then + tools/check-include-guards.sh | tee ../../check-include-guards.out || exit_code=1 +fi + exit $exit_code diff --git a/scripts/binutils-gdb/build.sh b/scripts/binutils-gdb/build.sh index e964220..3d7c561 100755 --- a/scripts/binutils-gdb/build.sh +++ b/scripts/binutils-gdb/build.sh @@ -17,6 +17,44 @@ set -exu +mktemp_compat() { + case "$platform" in + macos*) + # On MacOSX, mktemp doesn't respect TMPDIR in the same way as many + # other systems. Use the final positional argument to force the + # tempfile or tempdir to be created inside $TMPDIR, which must + # already exist. + if [ -n "${TMPDIR}" ] ; then + mktemp "${@}" "${TMPDIR}/tmp.XXXXXXXXXX" + else + mktemp "${@}" + fi + ;; + *) + mktemp "${@}" + ;; + esac +} + +print_header() { + set +x + + local message=" $1 " + local message_len + local padding_len + + message_len="${#message}" + padding_len=$(( (80 - (message_len)) / 2 )) + + printf '\n'; printf -- '#%.0s' {1..80}; printf '\n' + printf -- '-%.0s' {1..80}; printf '\n' + printf -- '#%.0s' $(seq 1 $padding_len); printf '%s' "$message"; printf -- '#%.0s' $(seq 1 $padding_len); printf '\n' + printf -- '-%.0s' {1..80}; printf '\n' + printf -- '#%.0s' {1..80}; printf '\n\n' + + set -x +} + failed_configure() { # Assume we are in the configured build directory echo "#################### BEGIN config.log ####################" @@ -264,7 +302,7 @@ case "$build" in echo "Out of tree build" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure diff --git a/scripts/liburcu/build.sh b/scripts/liburcu/build.sh index cc4d15c..d7ae0d1 100755 --- a/scripts/liburcu/build.sh +++ b/scripts/liburcu/build.sh @@ -61,6 +61,25 @@ verne() { [ "$res" -ne "0" ] } +mktemp_compat() { + case "$platform" in + macos*) + # On MacOSX, mktemp doesn't respect TMPDIR in the same way as many + # other systems. Use the final positional argument to force the + # tempfile or tempdir to be created inside $TMPDIR, which must + # already exist. + if [ -n "${TMPDIR}" ] ; then + mktemp "${@}" "${TMPDIR}/tmp.XXXXXXXXXX" + else + mktemp "${@}" + fi + ;; + *) + mktemp "${@}" + ;; + esac +} + print_header() { set +x @@ -268,7 +287,7 @@ oot) print_header "Build: Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure @@ -283,7 +302,7 @@ dist) $MAKE dist # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Extract the distribution tar in the build directory, @@ -298,14 +317,14 @@ oot-dist) print_header "Build: Distribution Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Run configure out of tree and generate the tar file "$SRCDIR/configure" || failed_configure $MAKE dist - dist_srcdir="$(mktemp -d)" + dist_srcdir="$(mktemp_compat -d)" cd "$dist_srcdir" # Extract the distribution tar in the new source directory, @@ -313,7 +332,7 @@ oot-dist) $TAR xvf "$builddir"/*.tar.* --strip 1 # Create and enter a second temporary build directory - builddir="$(mktemp -d)" + builddir="$(mktemp_compat -d)" cd "$builddir" # Run configure from the extracted distribution tar, diff --git a/scripts/lttng-modules/param-build.sh b/scripts/lttng-modules/param-build.sh index ba93fd4..310e22b 100644 --- a/scripts/lttng-modules/param-build.sh +++ b/scripts/lttng-modules/param-build.sh @@ -27,6 +27,10 @@ mgitrepo=${mgitrepo:-} make_args=() DEBUG=${DEBUG:-} +FAIL_ON_WARNINGS="${FAIL_ON_WARNINGS:-}" +if [[ "${FAIL_ON_WARNINGS}" == "false" ]] ; then + FAIL_ON_WARNINGS='' +fi # Derive arch from label if it isn't set if [ -z "${arch:-}" ] ; then @@ -83,9 +87,10 @@ print_header() { git_clone_modules_sources() { mkdir -p "$MODULES_GIT_DIR" - # If the version starts with "refs/", checkout the specific git ref, otherwise treat it - # as a branch name. - if [ "${mversion:0:5}" = "refs/" ]; then + # If the version starts with "refs/" or looks like a commit hash, + # checkout the specific git ref, otherwise treat it as a branch name. + pattern="^[0-9a-f]{40}$" + if [ "${mversion:0:5}" = "refs/" ] || [[ "${mversion}" =~ $pattern ]]; then git clone --no-tags --depth=1 "${mgitrepo}" "$MODULES_GIT_DIR" (cd "$MODULES_GIT_DIR" && git fetch origin "${mversion}" && git checkout FETCH_HEAD) else @@ -1006,13 +1011,18 @@ build_modules() { kversion=$(make -C "$LINUX_HDROBJ_DIR" -s kernelversion) - # Try to catch some compatibility problems by turning some - # warnings into errors. - #export KCFLAGS="$KCFLAGS -Wall -Werror" - # Enter lttng-modules source dir cd "${MODULES_GIT_DIR}" + # Try to catch some compatibility problems by turning some + # warnings into errors, but only on -rc kernels. + pattern="rc[0-9]+$" + if [[ "${kversion}" =~ ${pattern} ]] || [[ -n "${FAIL_ON_WARNINGS:-}" ]] ; then + export KCFLAGS="${KCFLAGS} -Wall -Werror" + # Without the verbose build, the warnings aren't visible. + export V=1 + fi + # kernels 3.10 to 3.10.13 and 3.11 to 3.11.2 introduce a deadlock in the # timekeeping subsystem. We want those build to fail. if { vergte "$kversion" "3.10" && verlte "$kversion" "3.10.13"; } || \ diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index c241e7b..bb2b6b5 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -63,6 +63,25 @@ verne() { [ "$res" -ne "0" ] } +mktemp_compat() { + case "$platform" in + macos*) + # On MacOSX, mktemp doesn't respect TMPDIR in the same way as many + # other systems. Use the final positional argument to force the + # tempfile or tempdir to be created inside $TMPDIR, which must + # already exist. + if [ -n "${TMPDIR}" ] ; then + mktemp "${@}" "${TMPDIR}/tmp.XXXXXXXXXX" + else + mktemp "${@}" + fi + ;; + *) + mktemp "${@}" + ;; + esac +} + print_header() { set +x @@ -399,7 +418,7 @@ oot) print_header "Build: Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure @@ -415,7 +434,7 @@ dist) $MAKE dist # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Extract the distribution tar in the build directory, @@ -430,14 +449,14 @@ oot-dist) print_header "Build: Distribution Out of tree" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" # Run configure out of tree and generate the tar file "$SRCDIR/configure" "${DIST_CONF_OPTS[@]}" || failed_configure $MAKE dist - dist_srcdir="$(mktemp -d)" + dist_srcdir="$(mktemp_compat -d)" cd "$dist_srcdir" # Extract the distribution tar in the new source directory, @@ -445,7 +464,7 @@ oot-dist) $TAR xvf "$builddir"/*.tar.* --strip 1 # Create and enter a second temporary build directory - builddir="$(mktemp -d)" + builddir="$(mktemp_compat -d)" cd "$builddir" # Run configure from the extracted distribution tar,