Skip to content

Commit

Permalink
Merge branch 'main' into feature/grep
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Aug 5, 2023
2 parents 3c40698 + 2aa8cf8 commit c25aadd
Show file tree
Hide file tree
Showing 40 changed files with 555 additions and 320 deletions.
2 changes: 1 addition & 1 deletion .ci/azp-windows-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
$env:path += ';' + $env:CXX_PATH
cd test
echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam
py test_all.py $env:TEST_TOOLSET
py -X utf8 test_all.py $env:TEST_TOOLSET
cd ..
displayName: Test
- powershell: |
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright 2023 Nikita Kniazev
#
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)

name: "Extra Tests"

on:
push:
paths-ignore: #&paths
- '.circleci/**'
- '.cirrus.yml'
- '.drone.star'
- '.semaphore/**'
- '.travis.yml'
- 'appveyor.yml'
- 'azure-pipelines.yml'
- '.ci/azp-*.yml'
pull_request:
paths-ignore: #*paths #https://github.com/actions/runner/issues/1182
- '.circleci/**'
- '.cirrus.yml'
- '.drone.star'
- '.semaphore/**'
- '.travis.yml'
- 'appveyor.yml'
- 'azure-pipelines.yml'
- '.ci/azp-*.yml'

concurrency:
# cancel test runners on force-push in pull requests
group: ${{ github.event_name == 'push' && github.event.forced && github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
msys2:
name: Windows msys2 ${{matrix.msys}} ${{matrix.toolset}}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
msys:
- mingw64
- mingw32
- ucrt64
- clang64
toolset:
- clang
- gcc
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout
uses: actions/checkout@master

- name: Install Toolset
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.msys}}
pacboy: python:p ${{matrix.toolset}}:p

- name: Bootstrap
run: ./bootstrap.sh ${{matrix.toolset}}

- name: Test
working-directory: test
env: { PYTHONUTF8: 1 }
run: ./test_all.py ${{matrix.toolset}}

- name: 'No Warnings'
run: ./b2 warnings=all warnings-as-errors=on variant=debug,release debug-symbols=off toolset=${{matrix.toolset}} b2
4 changes: 4 additions & 0 deletions Jamroot.jam
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ exe b2
<toolset>clang-win:<find-static-library>kernel32
<toolset>clang-win:<find-static-library>advapi32
<toolset>clang-win:<find-static-library>user32
<target-os>windows,<toolset>gcc:<source>src/engine/res.rc
<target-os>windows,<toolset>clang:<source>src/engine/res.rc
<toolset>msvc:<embed-manifest-file>src/engine/b2.exe.manifest
<toolset>clang-win:<embed-manifest-file>src/engine/b2.exe.manifest
;
explicit b2 ;

Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ environment:
job_group: 'Test'
TOOLSET: clang-win
TEST_TOOLSET: clang-win
B2_DONT_EMBED_MANIFEST: true # lld-link: error: unable to find mt.exe in PATH: no such file or directory
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- job_name: 'Cygwin 3.1.7 x64, Test'
job_group: 'TestCygwin'
Expand Down Expand Up @@ -61,7 +62,7 @@ for:
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> TEST"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
cd test
py test_all.py %TEST_TOOLSET%
py -X utf8 test_all.py %TEST_TOOLSET%
cd ..
- cmd: |
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Expand Down
6 changes: 6 additions & 0 deletions doc/src/history.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ other Jam files.
* Fix consistent use of `OPT_SEMAPHORE` and documentation of `JAM_SEMAPHORE`.
-- _Thomas Brown_

== Version 4.10.1

* Silence warnings for using standard deprecated functions by Apple clang
toolset in b2 build.
-- _René Ferdinand Rivera Morell_

== Version 4.10.0

This release contains many bug fixes but along the way also cleanup and
Expand Down
36 changes: 3 additions & 33 deletions src/build/virtual-target.jam
Original file line number Diff line number Diff line change
Expand Up @@ -994,47 +994,17 @@ rule from-file ( file : file-loc : project )
#
rule register ( target )
{
local signature = [ sequence.join [ $(target).path ] [ $(target).name ] : -
] ;

local result ;
for local t in $(.cache.$(signature))
{
local a1 = [ $(t).action ] ;
local a2 = [ $(target).action ] ;

if ! $(result)
{
if ! $(a1) && ! $(a2)
{
result = $(t) ;
}
else if $(a1) && $(a2) &&
( [ $(a1).action-name ] = [ $(a2).action-name ] ) &&
( [ $(a1).sources ] = [ $(a2).sources ] )
{
local ps1 = [ $(a1).properties ] ;
local ps2 = [ $(a2).properties ] ;
local relevant = [ toolset.relevant [ $(a1).action-name ] ] ;
relevant = [ $(relevant).add [ $(target).relevant ] ] ;
local p1 = [ $(ps1).relevant $(relevant) ] ;
local p2 = [ $(ps2).relevant $(relevant) ] ;
if $(p1) = $(p2)
{
result = $(t) ;
}
}
}
}
local signature = [ $(target).actual-name ] ;
local result = $(.cache.$(signature)) ;

if ! $(result)
{
.cache.$(signature) += $(target) ;
.all-targets += $(target) ;
result = $(target) ;
}

.recent-targets += $(result) ;
.all-targets += $(result) ;

return $(result) ;
}
Expand Down
22 changes: 22 additions & 0 deletions src/engine/b2.exe.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 and 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application>
<asmv3:windowsSettings xmlns:ws1="http://schemas.microsoft.com/SMI/2016/WindowsSettings"
xmlns:ws2="http://schemas.microsoft.com/SMI/2019/WindowsSettings">
<ws1:longPathAware>true</ws1:longPathAware>
<ws2:activeCodePage>UTF-8</ws2:activeCodePage>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
8 changes: 6 additions & 2 deletions src/engine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ case "${B2_TOOLSET}" in

clang|clang-*)
CXX_VERSION_OPT=${CXX_VERSION_OPT:---version}
B2_CXXFLAGS_RELEASE="-O3 -s"
B2_CXXFLAGS_DEBUG="-O0 -fno-inline -g"
B2_CXXFLAGS_RELEASE="-O3 -s -Wno-deprecated-declarations"
B2_CXXFLAGS_DEBUG="-O0 -fno-inline -g -Wno-deprecated-declarations"
;;

tru64cxx)
Expand Down Expand Up @@ -503,6 +503,10 @@ mod_version.cpp \
if test_true ${B2_DEBUG_OPT} ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}"
else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG"
fi
if [ -z "$B2_DONT_EMBED_MANIFEST" ] && [ -x "$(command -v windres)" ] ; then
B2_CXXFLAGS="${B2_CXXFLAGS} -Wl,res.o"
( B2_VERBOSE_OPT=${TRUE} echo_run windres --input res.rc --output res.o )
fi
( B2_VERBOSE_OPT=${TRUE} echo_run ${B2_CXX} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2 )
}

Expand Down
37 changes: 25 additions & 12 deletions src/engine/config_toolset.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if not "_%B2_TOOLSET_ROOT%_" == "__" (
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_VC11
if not defined CXX ( set "CXX=cl" )
Expand All @@ -54,7 +54,7 @@ if NOT "_%B2_TOOLSET_ROOT%_" == "__" (
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_VC12
if not defined CXX ( set "CXX=cl" )
Expand All @@ -73,7 +73,7 @@ if NOT "_%B2_TOOLSET_ROOT%_" == "__" (
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_VC14
if not defined CXX ( set "CXX=cl" )
Expand All @@ -93,7 +93,7 @@ if NOT "_%B2_TOOLSET_ROOT%_" == "__" (
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_VC141
if not defined CXX ( set "CXX=cl" )
Expand All @@ -115,7 +115,7 @@ popd
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_VC142
if not defined CXX ( set "CXX=cl" )
Expand All @@ -137,7 +137,7 @@ popd
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_VC143
if not defined CXX ( set "CXX=cl" )
Expand All @@ -160,7 +160,7 @@ popd
set "B2_CXX="%CXX%" /nologo -TP /wd4996 /wd4675 /EHs /GR /Zc:throwingNew /O2 /Ob2 /W3 /MD /Zc:forScope /Zc:wchar_t /Zc:inline /Gw /favor:blend /Feb2"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_VCUNK
if NOT "_%B2_TOOLSET%_" == "_vcunk_" goto Skip_VCUNK
Expand All @@ -182,7 +182,7 @@ popd
set "B2_CXX="%CXX%" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_BORLAND
if not defined CXX ( set "CXX=bcc32c" )
Expand All @@ -209,13 +209,13 @@ goto :eof
if not defined CXX ( set "CXX=g++" )
set "B2_CXX="%CXX%" -x c++ -std=c++11 -s -O3 -o b2.exe -D_GNU_SOURCE"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Windres

:Config_CLANG
if not defined CXX ( set "CXX=clang++" )
set "B2_CXX="%CXX%" -x c++ -std=c++11 -s -O3 -o b2.exe"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Windres

:Config_CLANG_WIN
if not defined CXX ( set "CXX=clang-cl" )
Expand All @@ -224,10 +224,10 @@ if "_%ProgramFiles(x86)%_" == "__" (
) else (
set "PATH=%PATH%;%ProgramFiles%\LLVM\bin;%ProgramFiles(x86)%\LLVM\bin"
)
set "B2_CXX="%CXX%" /MT /TP /Feb2 /wd4996 /O2 /EHsc /Gw /Zc:inline"
set "B2_CXX="%CXX%" /MT /TP /Feb2 /wd4996 /O2 /EHsc /Gw /Zc:inline -fuse-ld=lld"
set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib"
set "_known_=1"
goto :eof
goto :Embed_Minafest_Via_Link

:Config_GCC_NOCYGWIN
if not defined CXX ( set "CXX=g++" )
Expand All @@ -249,4 +249,17 @@ if not "_%B2_TOOLSET_ROOT%_" == "__" (
for /F "delims=" %%I in ("%CXX%") do set "PATH=%PATH%;%%~dpI"
set "B2_CXX="%CXX%" -x c++ -std=c++11 -s -O3 -static -o b2.exe"
set "_known_=1"
goto :Embed_Minafest_Via_Windres

:Embed_Minafest_Via_Link
if not defined B2_DONT_EMBED_MANIFEST (
set "B2_CXX_LINK=%B2_CXX_LINK% /MANIFEST:EMBED /MANIFESTINPUT:b2.exe.manifest"
)
goto :eof

:Embed_Minafest_Via_Windres
if not defined B2_DONT_EMBED_MANIFEST (
where windres >NUL 2>NUL
if %ERRORLEVEL% NEQ 0 ( call; ) else ( set "B2_CXX=windres --input res.rc --output res.o && %B2_CXX% -Wl,res.o" )
)
goto :eof
43 changes: 43 additions & 0 deletions src/engine/jam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
# include <signal.h>
#endif

#ifdef WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif

struct globs globs =
{
0, /* noexec */
Expand Down Expand Up @@ -612,6 +617,44 @@ int guarded_main( int argc, char * * argv )
return status ? EXITBAD : EXITOK;
}

#ifdef WIN32
namespace {

struct SetConsoleCodepage
{
SetConsoleCodepage()
{
// Check whether UTF-8 is actually the default encoding for this process
if (GetACP() != CP_UTF8)
return;

orig_console_cp = GetConsoleCP();
if (orig_console_cp != 0 && orig_console_cp != CP_UTF8)
SetConsoleCP(CP_UTF8);
orig_console_output_cp = GetConsoleOutputCP();
if (orig_console_output_cp != 0 && orig_console_output_cp != CP_UTF8)
SetConsoleOutputCP(CP_UTF8);
}

~SetConsoleCodepage()
{
// Restore original console codepage
if (orig_console_cp != 0 && orig_console_cp != CP_UTF8)
SetConsoleCP(orig_console_cp);
if (orig_console_output_cp != 0 && orig_console_output_cp != CP_UTF8)
SetConsoleOutputCP(orig_console_output_cp);
}

private:
UINT orig_console_cp = 0;
UINT orig_console_output_cp = 0;
};

static const SetConsoleCodepage g_console_codepage_setter{};

}
#endif

int main( int argc, char * * argv )
{
BJAM_MEM_INIT();
Expand Down
Loading

0 comments on commit c25aadd

Please sign in to comment.