Skip to content

Commit

Permalink
Merge branch 'main' into riscv
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot authored Dec 1, 2023
2 parents 4557691 + 2499e71 commit f44a9e2
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 62 deletions.
1 change: 1 addition & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ freebsd_task:
- { 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' } }
Expand Down
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ 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
* 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
* Linux Clang 10, 11, 12, 13, 14, 15, 16, 17
* Linux GCC 9, 10, 11, 12, 13
* macOS Xcode 11.7, 12.4, 12.5.1, 13.4.1, 14.0.1, 14.1, 14.2
* 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
* Windows MSYS2 MinGW64/32 Clang-16, MinGW64/32 GCC-13
Expand All @@ -34,7 +34,7 @@ image:https://img.shields.io/cirrus/github/bfgroup/b2?logo=cirrusci&label=main["
image:https://img.shields.io/github/actions/workflow/status/bfgroup/b2/qemu_multiarch_linux.yml?logo=github["Ubuntu 22.04 GCC 11 (armhf, arm64, ppc64el)", link="https://github.com/bfgroup/b2/actions/workflows/qemu_multiarch_linux.yml"]
image:https://img.shields.io/github/actions/workflow/status/bfgroup/b2/core_tests.yml?logo=github["Windows MSYS2 MinGW64/32 Clang-16, MinGW64/32 GCC-13", link="https://github.com/bfgroup/b2/actions/workflows/core_tests.yml"]

NOTE: A C+\+11 capable compiler is needed to build the `b2` engine. But using
NOTE: A {CPP}11 capable compiler is needed to build the `b2` engine. But using
the `b2` engine and build system does not require C++11.

== More
Expand Down
30 changes: 7 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ variables:
- { name: linux_latest_vm, value: 'ubuntu-22.04' }
- { name: linux_latest_os, value: 'focal' }
- { name: windows_latest_vm, value: 'windows-2022' }
- { name: clang_latest, value: '16' }
- { name: clang_latest, value: '17' }
- { name: gcc_latest, value: '13' }
- { name: vc_latest, value: 'vc143' }
- { name: vs_latest, value: '2022' }
- { name: xc_latest, value: '14.2' }
- { name: macos_latest_vm, value: 'macOS-12' }
- { name: xc_latest, value: '15.0.1' }
- { name: macos_latest_vm, value: 'macOS-13' }


stages:
Expand Down Expand Up @@ -210,14 +210,11 @@ stages:
- job: 'Linux'
strategy:
matrix:
# GCC 13: {TOOLSET: gcc-13, PACKAGES: g++-13, VM_IMAGE: "${{variables.linux_latest_vm}}"}
GCC 12: {TOOLSET: gcc-12, PACKAGES: g++-12, VM_IMAGE: "${{variables.linux_latest_vm}}"}
GCC 11: {TOOLSET: gcc-11, PACKAGES: g++-11, VM_IMAGE: "${{variables.linux_latest_vm}}"}
GCC 10: {TOOLSET: gcc-10, PACKAGES: g++-10, VM_IMAGE: "${{variables.linux_latest_vm}}"}
GCC 9: {TOOLSET: gcc-9, PACKAGES: g++-9, VM_IMAGE: "${{variables.linux_latest_vm}}"}
# GCC 8: {TOOLSET: gcc-8, PACKAGES: g++-8, VM_IMAGE: "ubuntu-20.04"}
# GCC 7: {TOOLSET: gcc-7, PACKAGES: g++-7, VM_IMAGE: "ubuntu-20.04"}
# Clang 16: {TOOLSET: clang-16, PACKAGES: clang-16, LLVM_VER: 16, LLVM_OS: "${{variables.linux_latest_os}}", VM_IMAGE: "${{variables.linux_latest_vm}}"}
Clang 16: {TOOLSET: clang-16, PACKAGES: clang-16, LLVM_VER: 16, LLVM_OS: "${{variables.linux_latest_os}}", VM_IMAGE: "${{variables.linux_latest_vm}}"}
Clang 15: {TOOLSET: clang-15, PACKAGES: clang-15, LLVM_VER: 15, LLVM_OS: "${{variables.linux_latest_os}}", VM_IMAGE: "${{variables.linux_latest_vm}}"}
Clang 14: {TOOLSET: clang-14, PACKAGES: clang-14, LLVM_VER: 14, LLVM_OS: "${{variables.linux_latest_os}}", VM_IMAGE: "${{variables.linux_latest_vm}}"}
Clang 13: {TOOLSET: clang-13, PACKAGES: clang-13, LLVM_VER: 13, LLVM_OS: "${{variables.linux_latest_os}}", VM_IMAGE: "${{variables.linux_latest_vm}}"}
Expand All @@ -243,27 +240,14 @@ stages:
- job: 'macOS'
strategy:
matrix:
# Xcode 14.2: {XCODE_APP: /Applications/Xcode_14.2.app, VM_IMAGE: 'macOS-12'}
Xcode 14.1: {XCODE_APP: /Applications/Xcode_14.1.app, VM_IMAGE: 'macOS-12'}
Xcode 14.3.1: {XCODE_APP: /Applications/Xcode_14.3.1.app, VM_IMAGE: 'macOS-13'}
Xcode 14.2: {XCODE_APP: /Applications/Xcode_14.2.app, VM_IMAGE: 'macOS-13'}
Xcode 14.1: {XCODE_APP: /Applications/Xcode_14.1.app, VM_IMAGE: 'macOS-13'}
Xcode 14.0.1: {XCODE_APP: /Applications/Xcode_14.0.1.app, VM_IMAGE: 'macOS-12'}
Xcode 13.4.1: {XCODE_APP: /Applications/Xcode_13.4.1.app, VM_IMAGE: 'macOS-12'}
# Xcode 13.3.1: {XCODE_APP: /Applications/Xcode_13.3.1.app, VM_IMAGE: 'macOS-12'}
# Xcode 13.2.1: {XCODE_APP: /Applications/Xcode_13.2.1.app, VM_IMAGE: 'macOS-12'}
# Xcode 13.1: {XCODE_APP: /Applications/Xcode_13.1.app, VM_IMAGE: 'macOS-12'}
# Xcode 13.0: {XCODE_APP: /Applications/Xcode_13.0.app, VM_IMAGE: 'macOS-11'}
Xcode 12.5.1: {XCODE_APP: /Applications/Xcode_12.5.1.app, VM_IMAGE: 'macOS-11'}
Xcode 12.4: {XCODE_APP: /Applications/Xcode_12.4.app, VM_IMAGE: 'macOS-11'}
# Xcode 12.3: {XCODE_APP: /Applications/Xcode_12.3.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 12.2: {XCODE_APP: /Applications/Xcode_12.2.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 12.1.1: {XCODE_APP: /Applications/Xcode_12.1.1.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 12.0.1: {XCODE_APP: /Applications/Xcode_12.0.1.app, VM_IMAGE: 'macOS-10.15'}
Xcode 11.7: {XCODE_APP: /Applications/Xcode_11.7.app, VM_IMAGE: 'macOS-11'}
# Xcode 11.6: {XCODE_APP: /Applications/Xcode_11.6.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 11.5: {XCODE_APP: /Applications/Xcode_11.5.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 11.4.1: {XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 11.3.1: {XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 11.3: {XCODE_APP: /Applications/Xcode_11.3.app, VM_IMAGE: 'macOS-10.15'}
# Xcode 11.2.1: {XCODE_APP: /Applications/Xcode_11.2.1.app, VM_IMAGE: 'macOS-10.15'}
pool:
vmImage: $(VM_IMAGE)
steps:
Expand Down
3 changes: 3 additions & 0 deletions doc/src/history.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ other Jam files.
* *New*: Make parts of internals thread safe to support parallel built-ins.
Currently includes Jam values, hash tables, and filesystem.
-- _René Ferdinand Rivera Morell_
* *New*: Add `import-search` project rule to declare additional search paths
for `import` that refer to searched project locations, or other directories.
-- _René Ferdinand Rivera Morell_
* Fix consistent use of `OPT_SEMAPHORE` and documentation of `JAM_SEMAPHORE`.
-- _Thomas Brown_

Expand Down
19 changes: 19 additions & 0 deletions doc/src/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,25 @@ are not allowed.
[[bbv2.reference.rules.test-suite]]`test-suite`::
This rule is deprecated and equivalent to `alias`.

[[bbv2.reference.rules.import-search]]`import-search`::
+
====
[horizontal]
Jam:: `rule import-search ( reference )`
====
+
Adds the given `reference` path to the set of directories that an `import` will
search. The `reference` can be a plain directory or a known project path. If a
project path is given it will be searched for and resolved to include any
sub-project path in the reference. If a directory is given it will be rooted
relative to the current project location. Example project path usage:
+
----
import-search /boost/config/checks ;
import-search /boost/predef/tools/checks ;
----
+

:leveloffset: +1

include::../../src/engine/mod_jam_builtin.h[tag=reference]
Expand Down
2 changes: 1 addition & 1 deletion doc/src/tutorial.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[bbv2.tutorial]]
= Tutorial

This section will guide you though the most basic features of
This section will guide you through the most basic features of
B2. We will start with the “Hello, world” example, learn how to
use libraries, and finish with testing and installing features.

Expand Down
60 changes: 57 additions & 3 deletions src/build/project.jam
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ rule add-project-search ( root : search-paths + )
}


local rule search ( name )
rule search ( name )
{
if [ path.is-rooted $(name) ]
{
Expand All @@ -261,8 +261,9 @@ local rule search ( name )
}
# Do searching for various dir names and jamfiles based on the built
# basename <a>_<b>_<c>[.jam].
local base = [ path.basename $(name) ] ;
local root = [ path.parent $(name) ] ;
local base = [ path.basename $(name) ] ;
local sub = $(base) ;
while $(base)
{
# Check for a regular B2 project in the search path and subdir base.
Expand All @@ -275,6 +276,16 @@ local rule search ( name )
return $(dir) ;
}
}
# Check for a regular B2 project in the search path and subdir subpath.
for local dir in $(.search-path.$(root))
{
dir = [ path.join $(dir) $(sub) ] ;
local jamfile = [ path.glob $(dir) : $(JAMROOT) $(JAMFILE) ] ;
if $(jamfile)
{
return $(dir) ;
}
}
# Check for a <base>.jam to include.
for local dir in $(.search-path.$(root))
{
Expand All @@ -286,12 +297,14 @@ local rule search ( name )
}
if [ path.has-parent $(root) ]
{
sub = [ path.join [ path.basename $(root) ] $(sub) ] ;
base = [ path.basename $(root) ] $(base) ;
base = $(base:L:J=_) ;
root = [ path.parent $(root) ] ;
}
else
{
sub = ;
base = ;
root = ;
}
Expand Down Expand Up @@ -1548,8 +1561,49 @@ module project-rules
# Defines search paths for resolving global, i.e. rooted, project references.
rule project-search ( root : search-paths + )
{
import path ;
import project ;
project.add-project-search $(root) : $(search-paths) ;
}

# Adds the project, or subdirectory of the project, location to the search
# of importing modules.
rule import-search ( reference )
{
import modules ;
import path ;
import project ;
local dir ;
if ! $(dir)
{
local project-dir = [ project.search $(reference) ] ;
if $(project-dir)
{
# Resolved it as a project reference.
dir = $(project-dir) ;
}
}
if ! $(dir)
{
local os-dir = [ path.root $(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) ;
}
}
if $(dir)
{
local b2-path = [ modules.peek : BOOST_BUILD_PATH ] ;
if ! $(dir) in $(b2-path)
{
modules.poke : BOOST_BUILD_PATH : $(dir) $(b2-path) ;
}
}
else
{
import errors ;
errors.error Unable find project reference '$(reference)'. ;
return ;
}
}
}
3 changes: 2 additions & 1 deletion src/build/virtual-target.jam
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ class abstract-file-target : virtual-target
{
import errors : error : errors.error ;
errors.error <tag>@rulename is present but is not the only
<tag> feature. ;
<tag> feature. Tags present..
: $(tag) ;
}

self.name = [ indirect.call $(rule-name) $(specified-name)
Expand Down
4 changes: 2 additions & 2 deletions test/BoostBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,10 +1232,10 @@ def __init__(self, s=""):
elements = []
if isstr(s):
# Have to handle escaped spaces correctly.
elements = s.replace("\ ", "\001").split()
elements = s.replace("\\ ", "\001").split()
else:
elements = s
self.l = [e.replace("\001", " ") for e in elements]
self.l = [e.replace("\001", "\\ ") for e in elements]

def __len__(self):
return len(self.l)
Expand Down
10 changes: 5 additions & 5 deletions test/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_run():
run(t, """\
(b2db) run -ftest.jam
Starting program: {{bjam}} -ftest.jam
Child {{\d+}} exited with status 0
Child {{\\d+}} exited with status 0
(b2db) quit
""")

Expand All @@ -60,7 +60,7 @@ def test_exit_status():
(b2db) run -ftest.jam
Starting program: {{bjam}} -ftest.jam
Child {{\d+}} exited with status 1
Child {{\\d+}} exited with status 1
(b2db) quit
""")
t.cleanup()
Expand Down Expand Up @@ -384,7 +384,7 @@ def test_breakpoints():
Deleted breakpoint 3
(b2db) run -ftest.jam
Starting program: {{bjam}} -ftest.jam
Child {{\d+}} exited with status 0
Child {{\\d+}} exited with status 0
(b2db) quit
""")
t.cleanup()
Expand Down Expand Up @@ -473,7 +473,7 @@ def test_breakpoints_running():
(b2db) clear test.jam:12
Deleted breakpoint 4
(b2db) continue
Child {{\d+}} exited with status 0
Child {{\\d+}} exited with status 0
(b2db) quit
""")
t.cleanup()
Expand Down Expand Up @@ -553,7 +553,7 @@ def test_run_running():
Breakpoint 1, module scope at test.jam:1
1 UPDATE ;
(b2db) run -ftest.jam
Child {{\d+}} exited with status 0
Child {{\\d+}} exited with status 0
Starting program: {{bjam}} -ftest.jam
Breakpoint 1, module scope at test.jam:1
1 UPDATE ;
Expand Down
4 changes: 2 additions & 2 deletions test/feature_implicit_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ class bbb-generator : generator
flags make-ccc AAAPATH : <aaa-path> ;
rule make-ccc ( target : sources * : properties * )
{
ECHO aaa path\: [ on $(target) return $(AAAPATH) ] ;
ECHO aaa path\\: [ on $(target) return $(AAAPATH) ] ;
common.copy $(target) : $(sources) ;
}
flags make-ddd BBBPATH : <bbb-path> ;
rule make-ddd ( target : sources * : properties * )
{
ECHO bbb path\: [ on $(target) return $(BBBPATH) ] ;
ECHO bbb path\\: [ on $(target) return $(BBBPATH) ] ;
common.copy $(target) : $(sources) ;
}
Expand Down
4 changes: 2 additions & 2 deletions test/generators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ def test_generated_target_names():
We use the following target generation structure with differently named
BBX targets:
/---> BB1 ---\
/---> BB1 ---\\
AAA --<----> BB2 ---->--> CCC --(composing)--> DDD
\---> BB3 ---/
\\---> BB3 ---/
The extra generator at the end is needed because generating a top-level
CCC target directly would requires us to explicitly specify a name for it.
Expand Down
28 changes: 14 additions & 14 deletions test/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,20 +529,20 @@ def write_subdir(dir):
t.write("outside/project/Jamroot", "run ../other/test.cpp ;")
t.run_build_system(["--dump-tests", "-n", "-d0"],
match=TestCmd.match_re, stdout=
"""boost-test\(RUN\) ".*/pass-run" : "pass-run\.cpp"
boost-test\(RUN_FAIL\) ".*/fail-run" : "fail-run\.cpp"
boost-test\(LINK\) ".*/pass-link" : "pass-link\.cpp"
boost-test\(LINK_FAIL\) ".*/fail-link" : "fail-link\.cpp"
boost-test\(COMPILE\) ".*/pass-compile" : "pass-compile\.cpp"
boost-test\(COMPILE_FAIL\) ".*/fail-compile" : "fail-compile\.cpp"
boost-test\(RUN\) "any/test" : "libs/any/test\.cpp"
boost-test\(RUN\) "any/test" : "libs/any/test/test\.cpp"
boost-test\(RUN\) "any/test" : "libs/any/example/test\.cpp"
boost-test\(RUN\) "bcp/test" : "tools/bcp/test/test\.cpp"
boost-test\(RUN\) "bcp/test" : "tools/bcp/example/test\.cpp"
boost-test\(RUN\) ".*/subdir/test/test" : "subdir/test/test\.cpp"
boost-test\(RUN\) "test" : "status/test\.cpp"
boost-test\(RUN\) ".*/outside/project/test" : "../other/test.cpp"
"""boost-test\\(RUN\\) ".*/pass-run" : "pass-run\\.cpp"
boost-test\\(RUN_FAIL\\) ".*/fail-run" : "fail-run\\.cpp"
boost-test\\(LINK\\) ".*/pass-link" : "pass-link\\.cpp"
boost-test\\(LINK_FAIL\\) ".*/fail-link" : "fail-link\\.cpp"
boost-test\\(COMPILE\\) ".*/pass-compile" : "pass-compile\\.cpp"
boost-test\\(COMPILE_FAIL\\) ".*/fail-compile" : "fail-compile\\.cpp"
boost-test\\(RUN\\) "any/test" : "libs/any/test\\.cpp"
boost-test\\(RUN\\) "any/test" : "libs/any/test/test\\.cpp"
boost-test\\(RUN\\) "any/test" : "libs/any/example/test\\.cpp"
boost-test\\(RUN\\) "bcp/test" : "tools/bcp/test/test\\.cpp"
boost-test\\(RUN\\) "bcp/test" : "tools/bcp/example/test\\.cpp"
boost-test\\(RUN\\) ".*/subdir/test/test" : "subdir/test/test\\.cpp"
boost-test\\(RUN\\) "test" : "status/test\\.cpp"
boost-test\\(RUN\\) ".*/outside/project/test" : "../other/test.cpp"
""")
t.cleanup()

Expand Down
8 changes: 4 additions & 4 deletions test/timedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ def basic_jam_action_test():
t.write("baz", "nothing")

expected_output = """\
\.\.\.found 4 targets\.\.\.
\.\.\.updating 2 targets\.\.\.
\\.\\.\\.found 4 targets\\.\\.\\.
\\.\\.\\.updating 2 targets\\.\\.\\.
make bar
time foo
bar +user: [0-9\.]+ +system: +[0-9\.]+ +clock: +[0-9\.]+ *
\.\.\.updated 2 targets\.\.\.$
bar +user: [0-9.]+ +system: +[0-9.]+ +clock: +[0-9.]+ *
\\.\\.\\.updated 2 targets\\.\\.\\.$
"""

t.run_build_system(["-ffile.jam", "-d+1"], stdout=expected_output,
Expand Down
Loading

0 comments on commit f44a9e2

Please sign in to comment.