Skip to content

Commit

Permalink
B2 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Jan 31, 2024
2 parents 9890997 + 3af675b commit b0311a0
Show file tree
Hide file tree
Showing 21 changed files with 156 additions and 76 deletions.
8 changes: 8 additions & 0 deletions .ci/azp-linux-prep-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
steps:
- script: |
which docker
/tmp/docker exec -t -u root container mv /etc/sudoers /etc/sudoers.bak
/tmp/docker exec -t -u root container apt-get -qq update
/tmp/docker exec -t -u root container apt-get -qq install sudo
/tmp/docker exec -t -u root container mv /etc/sudoers.bak /etc/sudoers
displayName: Sudorize
6 changes: 6 additions & 0 deletions .ci/azp-linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ steps:
set -e
uname -a
./.ci/linux-cxx-install.sh
python3 --version
displayName: Install
- bash: |
set -e
Expand All @@ -11,9 +12,14 @@ steps:
./build.sh ${TOOLSET}
./b2 -v
cd ../..
echo "using ${TOOLSET%%-[0-9]*} : : ${CXX} ;" > ${HOME}/user-config.jam
displayName: Build
- bash: |
set -e
echo "Available system locales:"
locale -a
echo "Switch to C.UTF-8 locale."
export LC_ALL=C.UTF-8
cd test
./test_all.py ${TOOLSET}
cd ..
Expand Down
26 changes: 16 additions & 10 deletions .ci/linux-cxx-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,40 @@ OS_ISSUE=`cat /etc/issue | head -n1 | cut -d " " -f1`
echo ">>>>> OS Issue: ${OS_ISSUE}"

PACKAGES=${PACKAGES:-build-essential}
# APT_OPT="-o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends"
APT_OPT="-o Acquire::Retries=3 -yq"

set -e
echo ">>>>>"
echo ">>>>> APT: UPDATE.."
echo ">>>>> APT: UPDATE 1/2.."
echo ">>>>>"
${SUDO} apt-get -o Acquire::Retries=3 update
${SUDO} apt-get ${APT_OPT} update
echo ">>>>>"
echo ">>>>> APT: INSTALL 1/2: wget.."
echo ">>>>>"
${SUDO} apt-get ${APT_OPT} install wget
echo ">>>>>"
echo ">>>>> APT: REPO.."
echo ">>>>>"
${SUDO} apt-get -o Acquire::Retries=3 -y install software-properties-common
${SUDO} apt-get ${APT_OPT} install software-properties-common
if test "${OS_ISSUE}" = "Ubuntu" ; then
${SUDO} apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
fi
if test -n "${LLVM_OS}" ; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
${SUDO} apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
${SUDO} apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
fi
echo ">>>>>"
echo ">>>>> APT: UPDATE.."
echo ">>>>> APT: UPDATE 2/2.."
echo ">>>>>"
${SUDO} apt-get -o Acquire::Retries=3 update
${SUDO} apt-get ${APT_OPT} update
echo ">>>>>"
echo ">>>>> APT: INSTALL ${PACKAGES}.."
echo ">>>>> APT: INSTALL 2/2: ${PACKAGES}.."
echo ">>>>>"
${SUDO} apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES}
${SUDO} apt-get ${APT_OPT} install ${PACKAGES}

# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.
# Copyright Rene Rivera 2020-2023.
27 changes: 13 additions & 14 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ freebsd_task:
skip: "changesIncludeOnly('.ci/azp-*', 'appveyor.yml', 'azure-pipelines.yml', '*.adoc')"
# All the GCC's and Clang's currently supported by FreeBSD ports.
matrix:
- { name: 'FreeBSD, GCC 13', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++13', PACKAGE: 'gcc13' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, GCC 12', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++12', PACKAGE: 'gcc12' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, GCC 11', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++11', PACKAGE: 'gcc11' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, GCC 10', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++10', PACKAGE: 'gcc10' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, GCC 9', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++9', PACKAGE: 'gcc9' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, GCC 8', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++8', PACKAGE: 'gcc8' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 17', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++17', PACKAGE: 'devel/llvm17' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 16', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++16', PACKAGE: 'devel/llvm16' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 15', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++15', PACKAGE: 'devel/llvm15' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 14', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++14', PACKAGE: 'devel/llvm14' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 13', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++13', PACKAGE: 'devel/llvm13' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 12', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++12', PACKAGE: 'devel/llvm12' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 11', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++11', PACKAGE: 'devel/llvm11' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, Clang 10', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++10', PACKAGE: 'devel/llvm10' }, freebsd_instance: { image_family: 'freebsd-13-1' } }
- { name: 'FreeBSD, GCC 13', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++13', PACKAGE: 'gcc13' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, GCC 12', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++12', PACKAGE: 'gcc12' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, GCC 11', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++11', PACKAGE: 'gcc11' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, GCC 10', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++10', PACKAGE: 'gcc10' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, GCC 9', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++9', PACKAGE: 'gcc9' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 17', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++17', PACKAGE: 'devel/llvm17' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 16', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++16', PACKAGE: 'devel/llvm16' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 15', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++15', PACKAGE: 'devel/llvm15' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 14', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++14', PACKAGE: 'devel/llvm14' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 13', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++13', PACKAGE: 'devel/llvm13' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 12', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++12', PACKAGE: 'devel/llvm12' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 11', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++11', PACKAGE: 'devel/llvm11' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
- { name: 'FreeBSD, Clang 10', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++10', PACKAGE: 'devel/llvm10' }, freebsd_instance: { image_family: 'freebsd-14-0' } }
# To install with ports we need to initialize the package manager. To avoid
# confirmation prompts we need to set an env var.
install_script: [
Expand Down
25 changes: 17 additions & 8 deletions Jamroot.jam
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 Rene Rivera
# Copyright 2019-2024 Rene Rivera
# Copyright 2017 Steven Watanabe
# Copyright 2016 Vladimir Prus
# Copyright 2017 Edward Diener
Expand All @@ -13,7 +13,6 @@ import errors ;
import feature ;
import indirect ;
import os ;
# import package ;
import path ;
import set ;
import stage : add-install-dir ;
Expand Down Expand Up @@ -130,7 +129,7 @@ obj jamgram.obj
explicit jamgram.obj ;

local b2_src =
[ glob src/engine/*.cpp src/engine/modules/*.cpp :
[ glob src/engine/*.cpp :
src/engine/*nt.cpp src/engine/*unix.cpp src/engine/*vms.cpp
src/engine/yyacc.cpp src/engine/mkjambase.cpp
src/engine/check_*.cpp
Expand Down Expand Up @@ -180,15 +179,25 @@ add-install-dir b2bindir-portable : : b2prefix-portable ;
add-install-dir b2coredir-portable : .b2 : b2prefix-portable ;
add-install-dir b2examplesdir-portable : .b2/examples : b2prefix-portable ;

local ext = "" ;
if [ os.on-windows ] || [ os.on-vms ]
rule b2-exe ( props * )
{
ext = ".exe" ;
local target-os = [ feature.get-values <target-os> : $(props) ] ;
local host-os = [ feature.get-values <host-os> : $(props) ] ;
if $(target-os) != $(host-os)
{
return <source>b2 ;
}
else if $(target-os) in windows vms
{
return <source>src/engine/b2.exe ;
}
return <source>src/engine/b2 ;
}

install b2-engine
: $(SELF)/src/engine/b2$(ext)
: <b2-install-layout>standard:<location>(b2bindir-standard)
:
: <conditional>@b2-exe
<b2-install-layout>standard:<location>(b2bindir-standard)
<b2-install-layout>portable:<location>(b2bindir-portable)
;
explicit b2-engine ;
Expand Down
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt)
Continuously tested on:

* FreeBSD Clang 10, 11, 12, 13, 14, 15, 16, 17
* FreeBSD GCC 8, 9, 10, 11, 12, 13
* Linux Clang 10, 11, 12, 13, 14, 15, 16, 17
* Linux GCC 9, 10, 11, 12, 13
* FreeBSD GCC 9, 10, 11, 12, 13
* Linux Clang 3.6, 3.7, 3.8, 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
* Linux GCC 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11, 12, 13
* macOS Xcode 11.7, 12.4, 12.5.1, 13.4.1, 14.0.1, 14.1, 14.2, 14.3.1, 15.0.1
* Windows MinGW 8.1.0
* Windows 2015, 2017, 2019, 2022
Expand Down
32 changes: 32 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ variables:
- { name: xc_latest, value: '15.0.1' }
- { name: macos_latest_vm, value: 'macOS-13' }

resources:
containers:
- { container: ubuntu_2004, image: 'ubuntu:20.04', options: '--name container -v /usr/bin/docker:/tmp/docker:ro' }
- { container: ubuntu_1804, image: 'ubuntu:18.04', options: '--name container -v /usr/bin/docker:/tmp/docker:ro' }
- { container: ubuntu_1604, image: 'ubuntu:16.04', options: '--name container -v /usr/bin/docker:/tmp/docker:ro' }

stages:

Expand Down Expand Up @@ -226,6 +231,33 @@ stages:
steps:
- template: .ci/azp-linux-test.yml

- job: 'Co_Linux'
strategy:
matrix:
GCC 8: {CXX: g++-8, TOOLSET: gcc-8, PACKAGES: g++-8, CONTAINER: "ubuntu_1804"}
GCC 7: {CXX: g++-7, TOOLSET: gcc-7, PACKAGES: g++-7, CONTAINER: "ubuntu_1804"}
GCC 6: {CXX: g++-6, TOOLSET: gcc-6, PACKAGES: g++-6, CONTAINER: "ubuntu_1804"}
GCC 5: {CXX: g++-5, TOOLSET: gcc-5, PACKAGES: g++-5, CONTAINER: "ubuntu_1804"}
GCC 4.9: {CXX: g++-4.9, TOOLSET: gcc-4.9, PACKAGES: g++-4.9, CONTAINER: "ubuntu_1604"}
GCC 4.8: {CXX: g++-4.8, TOOLSET: gcc-4.8, PACKAGES: g++-4.8, CONTAINER: "ubuntu_1804"}
GCC 4.7: {CXX: g++-4.7, TOOLSET: gcc-4.7, PACKAGES: g++-4.7, CONTAINER: "ubuntu_1604"}
Clang 9: {CXX: clang++-9, TOOLSET: clang-9, PACKAGES: clang-9, LLVM_VER: 9, LLVM_OS: 'bionic', CONTAINER: "ubuntu_1804"}
Clang 8: {CXX: clang++-8, TOOLSET: clang-8, PACKAGES: clang-8, LLVM_VER: 8, LLVM_OS: 'bionic', CONTAINER: "ubuntu_1804"}
Clang 7: {CXX: clang++-7, TOOLSET: clang-7, PACKAGES: clang-7, LLVM_VER: 7, LLVM_OS: 'bionic', CONTAINER: "ubuntu_1804"}
Clang 6: {CXX: clang++-6.0, TOOLSET: clang-6.0, PACKAGES: clang-6.0, LLVM_VER: 6.0, LLVM_OS: 'bionic', CONTAINER: "ubuntu_1804"}
Clang 5: {CXX: clang++-5.0, TOOLSET: clang-5.0, PACKAGES: clang-5.0, LLVM_VER: 5.0, LLVM_OS: 'bionic', CONTAINER: "ubuntu_1804"}
Clang 4: {CXX: clang++-4.0, TOOLSET: clang-4.0, PACKAGES: clang-4.0, CONTAINER: "ubuntu_1804"}
Clang 3.9: {CXX: clang++-3.9, TOOLSET: clang-3.9, PACKAGES: clang-3.9, CONTAINER: "ubuntu_1804"}
Clang 3.8: {CXX: clang++-3.8, TOOLSET: clang-3.8, PACKAGES: clang-3.8, CONTAINER: "ubuntu_1604"}
Clang 3.7: {CXX: clang++-3.7, TOOLSET: clang-3.7, PACKAGES: clang-3.7, CONTAINER: "ubuntu_1604"}
Clang 3.6: {CXX: clang++-3.6, TOOLSET: clang-3.6, PACKAGES: clang-3.6, CONTAINER: "ubuntu_1604"}
pool:
vmImage: 'ubuntu-20.04'
container: $[ variables['CONTAINER'] ]
steps:
- template: .ci/azp-linux-prep-container.yml
- template: .ci/azp-linux-test.yml

- job: 'Windows'
strategy:
matrix:
Expand Down
11 changes: 11 additions & 0 deletions doc/src/history.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
[[b2.history]]
= History

== Version 5.0.1

* Fix compile errors for older versions of GCC and Clang toolset for the engine.
We now support building the engine with GCC 4.7 and Clang 3.6 onward.
-- _René Ferdinand Rivera Morell_
* Fix `import-search` failing to find imports on Windows bacause of incorrect
native vs. non-native path handling.
-- _René Ferdinand Rivera Morell_
* Support cross-compile install of B2, using `target-os=xyz`.
-- _René Ferdinand Rivera Morell_

== Version 5.0.0

This is a new era in B2. The drive of this new major version is to move the
Expand Down
6 changes: 3 additions & 3 deletions src/build/project.jam
Original file line number Diff line number Diff line change
Expand Up @@ -1579,16 +1579,16 @@ module project-rules
if $(project-dir)
{
# Resolved it as a project reference.
dir = $(project-dir) ;
dir = [ path.native $(project-dir) ] ;
}
}
if ! $(dir)
{
local os-dir = [ path.root $(reference) [ path.pwd ] ] ;
local os-dir = [ path.root [ path.make $(reference) ] [ path.pwd ] ] ;
if ! [ CHECK_IF_FILE [ path.native $(os-dir) ] ]
{
# It's not a file, i.e. it's a directory.
dir = $(os-dir) ;
dir = [ path.native $(os-dir) ] ;
}
}
if $(dir)
Expand Down
2 changes: 1 addition & 1 deletion src/build/version.jam
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import numbers ;
# Mirror engine JAM_VERSION
.major = 5 ;
.minor = 0 ;
.patch = 0 ;
.patch = 1 ;


rule build ( )
Expand Down
4 changes: 3 additions & 1 deletion src/engine/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,12 @@ struct _stack
data = end;
}

#ifdef __clang__
#if defined(__clang__) && defined(__has_feature)
#if __has_feature(address_sanitizer)
// This function calls not properly type-erased callbacks
__attribute__((no_sanitize("undefined")))
#endif
#endif
void done()
{
if ( cleanups_size > cleanups_t::size_type(0) )
Expand Down
4 changes: 3 additions & 1 deletion src/engine/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,12 @@ static void hashrehash( struct hash * hp )
}


#ifdef __clang__
#if defined(__clang__) && defined(__has_feature)
#if __has_feature(address_sanitizer)
// This function calls not properly type-erased callbacks
__attribute__((no_sanitize("undefined")))
#endif
#endif
void hashenumerate( struct hash * hp, void (* f)( void *, void * ), void * data
)
{
Expand Down
2 changes: 1 addition & 1 deletion src/engine/mod_regex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ list_ref b2::regex_split(
const std::tuple<value_ref, value_ref> & string_separator)
{
list_ref result;
string_t string { std::get<0>(string_separator) };
string_t string = std::get<0>(string_separator);
auto re = program(std::get<1>(string_separator)->str());
auto pos = string.c_str();
auto prev = pos;
Expand Down
4 changes: 2 additions & 2 deletions src/engine/patchlevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

/*
This file is ALSO:
Copyright 2018-2022 Rene Rivera
Copyright 2018-2024 Rene Rivera
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.txt or copy at
https://www.bfgroup.xyz/b2/LICENSE.txt)
*/

#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_PATCH 0
#define VERSION_PATCH 1
12 changes: 8 additions & 4 deletions src/engine/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.

#include "jam.h"
#include "mem.h"
#include "mp.h"
#include "object.h"
#include "output.h"

Expand Down Expand Up @@ -202,14 +203,17 @@ struct value_eq_f

struct safe_value_cache
{
template <typename Test, typename Val, typename... Args>
value_ptr save(Args... args)
template <typename Test, typename Val, typename A0, typename... An>
typename std::enable_if<
!std::is_same<object *, typename mp::remove_cvref<A0>::type>::value,
value_ptr>::type
save(A0 a0, An... an)
{
Test test_val(args...);
Test test_val(a0, an...);
std::lock_guard<std::mutex> guard(mutex);
auto existing = cache.find(&test_val);
if (existing != cache.end()) return *existing;
value_ptr result = Val::make(args...);
value_ptr result = Val::make(a0, an...);
cache.insert(result);
return result;
}
Expand Down
Loading

0 comments on commit b0311a0

Please sign in to comment.