From f89de28e515dc22c6de0d9a426c698f4d621ffbe Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 11 Mar 2024 08:38:17 -0500 Subject: [PATCH 01/16] Make the library modular usable. --- build.jam | 34 ++++++++++++++++++++++++++++++++++ build/Jamfile.v2 | 4 +--- test/Jamfile.v2 | 4 ++-- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 000000000..7c38212b0 --- /dev/null +++ b/build.jam @@ -0,0 +1,34 @@ +# Copyright René Ferdinand Rivera Morell 2023 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import project ; + +project /boost/filesystem + : common-requirements + /boost/assert//boost_assert + /boost/atomic//boost_atomic + /boost/config//boost_config + /boost/container_hash//boost_container_hash + /boost/core//boost_core + /boost/detail//boost_detail + /boost/io//boost_io + /boost/iterator//boost_iterator + /boost/predef//boost_predef + /boost/smart_ptr//boost_smart_ptr + /boost/system//boost_system + /boost/throw_exception//boost_throw_exception + /boost/type_traits//boost_type_traits + /boost/winapi//boost_winapi + include + ; + +explicit + [ alias boost_filesystem : build//boost_filesystem ] + [ alias all : boost_filesystem bug example test ] + ; + +call-if : boost-library filesystem + : install boost_filesystem + ; diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index f6c8e5d43..7372e1bb4 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -136,7 +136,7 @@ local cxx_requirements = [ requires cxx11_override ] ; -project boost/filesystem +project : requirements hpux,gcc:_INCLUDE_STDC__SOURCE_199901 [ check-target-builds ../config//has_attribute_init_priority "has init_priority attribute" : BOOST_FILESYSTEM_HAS_INIT_PRIORITY ] @@ -214,5 +214,3 @@ lib boost_filesystem : usage-requirements $(cxx_requirements) ; - -boost-install boost_filesystem ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 0ac5e6cc0..a9a95ff3e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -85,7 +85,7 @@ run operations_test.cpp : : : shared BOOST_FILESYSTEM_VERSION=4 static BOOST_FILESYSTEM_VERSION=4 : operations_test_static ; run operations_test.cpp : : : shared BOOST_FILESYSTEM_VERSION=3 : operations_test_v3 ; run operations_unit_test.cpp : $(HERE) : : shared BOOST_FILESYSTEM_VERSION=4 always_show_run_output ; -run copy_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; +run copy_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 /boost/exception//boost_exception ; compile-fail cf_path_nullptr_test.cpp ; compile path_iter_ctor_overload_test.cpp ; compile path_operator_ambiguity.cpp : gcc:on ; @@ -98,7 +98,7 @@ run path_unit_test.cpp : : : shared $(VIS) BOOST_FILESYSTEM_VERSIO run relative_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; run ../example/simple_ls.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; run ../example/file_status.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; -run foreach_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; +run foreach_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 /boost/foreach//boost_foreach ; # `quick` target (for CI) run quick.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; From 5e071701429b90fb68429a953a8ac2a13f1238f9 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 17 Mar 2024 12:48:37 -0500 Subject: [PATCH 02/16] Use searched-lib targets for external/OS/Windows libraries to avoid trying to refer to mangled names for them. And hence failing to find them. --- build/Jamfile.v2 | 6 +++--- config/Jamfile.v2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 7372e1bb4..99e9242ad 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -11,9 +11,9 @@ import project ; import configure ; import config : requires ; -lib bcrypt ; -lib advapi32 ; -lib coredll ; +searched-lib bcrypt ; +searched-lib advapi32 ; +searched-lib coredll ; explicit bcrypt advapi32 coredll ; # The rule checks if a config macro is defined in the command line or build properties diff --git a/config/Jamfile.v2 b/config/Jamfile.v2 index 4ca2ced4d..6e9edaaa3 100644 --- a/config/Jamfile.v2 +++ b/config/Jamfile.v2 @@ -36,7 +36,7 @@ explicit has_posix_at_apis ; obj has_fallocate : has_fallocate.cpp : ../src ; explicit has_fallocate ; -lib bcrypt ; +searched-lib bcrypt ; explicit bcrypt ; exe has_bcrypt : has_bcrypt.cpp : ../src bcrypt ; From 8053b6d23b47476a645b3140758bca94c5129681 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 17 Mar 2024 12:49:46 -0500 Subject: [PATCH 03/16] Use the OS temp dir for creating test dir to avoid putting dirs in random location based on where one runs tests from. --- test/deprecated_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/deprecated_test.cpp b/test/deprecated_test.cpp index 509660efe..686904a58 100644 --- a/test/deprecated_test.cpp +++ b/test/deprecated_test.cpp @@ -120,7 +120,7 @@ int cpp_main(int /*argc*/, char* /*argv*/[]) de.replace_filename("bar.foo", fs::file_status(), fs::file_status()); BOOST_TEST(de.path() == "bar.foo"); - const fs::path temp_dir(fs::current_path() / ".." / fs::unique_path("deprecated_test-%%%%-%%%%-%%%%")); + const fs::path temp_dir(fs::temp_directory_path() / fs::unique_path("deprecated_test-%%%%-%%%%-%%%%")); std::cout << "temp_dir is " << temp_dir.string() << std::endl; fs::create_directory(temp_dir); From 47b3701b1df5e6d8a3d9d88b4ecb11eb3633b862 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 29 Mar 2024 21:15:58 -0500 Subject: [PATCH 04/16] Switch to library requirements instead of source. As source puts extra source in install targets. --- build.jam | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build.jam b/build.jam index 7c38212b0..2e62eee9d 100644 --- a/build.jam +++ b/build.jam @@ -7,20 +7,20 @@ import project ; project /boost/filesystem : common-requirements - /boost/assert//boost_assert - /boost/atomic//boost_atomic - /boost/config//boost_config - /boost/container_hash//boost_container_hash - /boost/core//boost_core - /boost/detail//boost_detail - /boost/io//boost_io - /boost/iterator//boost_iterator - /boost/predef//boost_predef - /boost/smart_ptr//boost_smart_ptr - /boost/system//boost_system - /boost/throw_exception//boost_throw_exception - /boost/type_traits//boost_type_traits - /boost/winapi//boost_winapi + /boost/assert//boost_assert + /boost/atomic//boost_atomic + /boost/config//boost_config + /boost/container_hash//boost_container_hash + /boost/core//boost_core + /boost/detail//boost_detail + /boost/io//boost_io + /boost/iterator//boost_iterator + /boost/predef//boost_predef + /boost/smart_ptr//boost_smart_ptr + /boost/system//boost_system + /boost/throw_exception//boost_throw_exception + /boost/type_traits//boost_type_traits + /boost/winapi//boost_winapi include ; From ec7a66b604e8fd088388f2d01ba0c3e8a24dab87 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 25 Apr 2024 07:01:17 -0500 Subject: [PATCH 05/16] Updated dependencies. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index 2e62eee9d..c7de797c2 100644 --- a/build.jam +++ b/build.jam @@ -16,9 +16,9 @@ project /boost/filesystem /boost/io//boost_io /boost/iterator//boost_iterator /boost/predef//boost_predef + /boost/scope//boost_scope /boost/smart_ptr//boost_smart_ptr /boost/system//boost_system - /boost/throw_exception//boost_throw_exception /boost/type_traits//boost_type_traits /boost/winapi//boost_winapi include From 0d91a921be1cc5a4f2c22707ee7819e30bdef309 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 Apr 2024 20:15:15 -0500 Subject: [PATCH 06/16] Add missing NO_LIB usage requirements. --- build/Jamfile.v2 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 99e9242ad..5eeffae3b 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -175,6 +175,7 @@ project : usage-requirements # pass these requirement to dependents (i.e. users) shared:BOOST_FILESYSTEM_DYN_LINK=1 static:BOOST_FILESYSTEM_STATIC_LINK=1 + BOOST_FILESYSTEM_NO_LIB=1 ; SOURCES = From 4ecb549bdb13c668cd70c9c290094ce732542f59 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 4 May 2024 23:29:25 -0500 Subject: [PATCH 07/16] Add missing import-search for cconfig/predef checks. --- build/Jamfile.v2 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 5eeffae3b..11a6a4522 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -9,6 +9,7 @@ import project ; import configure ; +import-search /boost/config/checks ; import config : requires ; searched-lib bcrypt ; From c6ebda817a7c7150150db69bd1b78ff75146cfef Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 5 May 2024 09:00:01 -0500 Subject: [PATCH 08/16] Add requires-b2 check to top-level build file. --- build.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.jam b/build.jam index c7de797c2..b81252d09 100644 --- a/build.jam +++ b/build.jam @@ -3,6 +3,8 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +require-b2 5.1 ; + import project ; project /boost/filesystem From da0a77cc64c9b700e105093bb79622c64ebe48f1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Jun 2024 11:33:55 -0500 Subject: [PATCH 09/16] Bump B2 require to 5.2 --- build.jam | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.jam b/build.jam index b81252d09..9c95bd750 100644 --- a/build.jam +++ b/build.jam @@ -3,9 +3,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -require-b2 5.1 ; - -import project ; +require-b2 5.2 ; project /boost/filesystem : common-requirements From 6c95f9cec1a4658679c626d769a004391ae9e04a Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 19:38:18 -0500 Subject: [PATCH 10/16] Change all references to . --- test/Jamfile.v2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index a9a95ff3e..3cb99d40b 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -85,7 +85,7 @@ run operations_test.cpp : : : shared BOOST_FILESYSTEM_VERSION=4 static BOOST_FILESYSTEM_VERSION=4 : operations_test_static ; run operations_test.cpp : : : shared BOOST_FILESYSTEM_VERSION=3 : operations_test_v3 ; run operations_unit_test.cpp : $(HERE) : : shared BOOST_FILESYSTEM_VERSION=4 always_show_run_output ; -run copy_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 /boost/exception//boost_exception ; +run copy_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 /boost/exception//boost_exception ; compile-fail cf_path_nullptr_test.cpp ; compile path_iter_ctor_overload_test.cpp ; compile path_operator_ambiguity.cpp : gcc:on ; @@ -98,7 +98,7 @@ run path_unit_test.cpp : : : shared $(VIS) BOOST_FILESYSTEM_VERSIO run relative_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; run ../example/simple_ls.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; run ../example/file_status.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; -run foreach_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 /boost/foreach//boost_foreach ; +run foreach_test.cpp : : : BOOST_FILESYSTEM_VERSION=4 /boost/foreach//boost_foreach ; # `quick` target (for CI) run quick.cpp : : : BOOST_FILESYSTEM_VERSION=4 ; From 1c1500b9a3170bfdebe9566c25e29c04d906c6fd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 22:52:04 -0500 Subject: [PATCH 11/16] Update copyright dates. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index 9c95bd750..790336913 100644 --- a/build.jam +++ b/build.jam @@ -1,4 +1,4 @@ -# Copyright René Ferdinand Rivera Morell 2023 +# Copyright René Ferdinand Rivera Morell 2023-2024 # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) From 941fca2541bf5c19194f98145bee601bdf0a0c11 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 23 Jul 2024 22:34:22 -0500 Subject: [PATCH 12/16] Move inter-lib dependencies to a project variable and into the build targets. --- build.jam | 31 +++++++++++++++++-------------- build/Jamfile.v2 | 1 + 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/build.jam b/build.jam index 790336913..96349a9b1 100644 --- a/build.jam +++ b/build.jam @@ -5,22 +5,24 @@ require-b2 5.2 ; +constant boost_dependencies : + /boost/assert//boost_assert + /boost/atomic//boost_atomic + /boost/config//boost_config + /boost/container_hash//boost_container_hash + /boost/core//boost_core + /boost/detail//boost_detail + /boost/io//boost_io + /boost/iterator//boost_iterator + /boost/predef//boost_predef + /boost/scope//boost_scope + /boost/smart_ptr//boost_smart_ptr + /boost/system//boost_system + /boost/type_traits//boost_type_traits + /boost/winapi//boost_winapi ; + project /boost/filesystem : common-requirements - /boost/assert//boost_assert - /boost/atomic//boost_atomic - /boost/config//boost_config - /boost/container_hash//boost_container_hash - /boost/core//boost_core - /boost/detail//boost_detail - /boost/io//boost_io - /boost/iterator//boost_iterator - /boost/predef//boost_predef - /boost/scope//boost_scope - /boost/smart_ptr//boost_smart_ptr - /boost/system//boost_system - /boost/type_traits//boost_type_traits - /boost/winapi//boost_winapi include ; @@ -32,3 +34,4 @@ explicit call-if : boost-library filesystem : install boost_filesystem ; + diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 11a6a4522..adc67bae5 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -138,6 +138,7 @@ local cxx_requirements = [ requires ] ; project + : common-requirements $(boost_dependencies) : requirements hpux,gcc:_INCLUDE_STDC__SOURCE_199901 [ check-target-builds ../config//has_attribute_init_priority "has init_priority attribute" : BOOST_FILESYSTEM_HAS_INIT_PRIORITY ] From d23444ab928bfc2765ec69eeac9d4dcbae1f0139 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 26 Jul 2024 12:54:42 -0500 Subject: [PATCH 13/16] Split b2 dependencies into public and private. --- build.jam | 7 +------ build/Jamfile.v2 | 9 +++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.jam b/build.jam index 96349a9b1..fe0e10e19 100644 --- a/build.jam +++ b/build.jam @@ -7,19 +7,14 @@ require-b2 5.2 ; constant boost_dependencies : /boost/assert//boost_assert - /boost/atomic//boost_atomic /boost/config//boost_config /boost/container_hash//boost_container_hash - /boost/core//boost_core /boost/detail//boost_detail /boost/io//boost_io /boost/iterator//boost_iterator - /boost/predef//boost_predef - /boost/scope//boost_scope /boost/smart_ptr//boost_smart_ptr /boost/system//boost_system - /boost/type_traits//boost_type_traits - /boost/winapi//boost_winapi ; + /boost/type_traits//boost_type_traits ; project /boost/filesystem : common-requirements diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index adc67bae5..16bb1f573 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -137,9 +137,18 @@ local cxx_requirements = [ requires cxx11_override ] ; +constant boost_dependencies_private : + /boost/atomic//boost_atomic + /boost/core//boost_core + /boost/predef//boost_predef + /boost/scope//boost_scope + /boost/winapi//boost_winapi + ; + project : common-requirements $(boost_dependencies) : requirements + $(boost_dependencies_private) hpux,gcc:_INCLUDE_STDC__SOURCE_199901 [ check-target-builds ../config//has_attribute_init_priority "has init_priority attribute" : BOOST_FILESYSTEM_HAS_INIT_PRIORITY ] [ check-target-builds ../config//has_stat_st_mtim "has stat::st_blksize" : BOOST_FILESYSTEM_HAS_STAT_ST_BLKSIZE ] From e45706ca0ad830a6af09c4f339e18e117f71029f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 26 Jul 2024 17:04:37 -0500 Subject: [PATCH 14/16] Undo temp dir for test change. --- test/deprecated_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/deprecated_test.cpp b/test/deprecated_test.cpp index 686904a58..509660efe 100644 --- a/test/deprecated_test.cpp +++ b/test/deprecated_test.cpp @@ -120,7 +120,7 @@ int cpp_main(int /*argc*/, char* /*argv*/[]) de.replace_filename("bar.foo", fs::file_status(), fs::file_status()); BOOST_TEST(de.path() == "bar.foo"); - const fs::path temp_dir(fs::temp_directory_path() / fs::unique_path("deprecated_test-%%%%-%%%%-%%%%")); + const fs::path temp_dir(fs::current_path() / ".." / fs::unique_path("deprecated_test-%%%%-%%%%-%%%%")); std::cout << "temp_dir is " << temp_dir.string() << std::endl; fs::create_directory(temp_dir); From 9b38cebe3e14f30a8f81dc1f1f67ca213d598e96 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 24 Aug 2024 00:01:23 -0500 Subject: [PATCH 15/16] Make winapi dep target-os specific. And remove direct atomic dep as it is already handled by conditional rule. --- build/Jamfile.v2 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 16bb1f573..a04df1036 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -137,18 +137,13 @@ local cxx_requirements = [ requires cxx11_override ] ; -constant boost_dependencies_private : - /boost/atomic//boost_atomic - /boost/core//boost_core - /boost/predef//boost_predef - /boost/scope//boost_scope - /boost/winapi//boost_winapi - ; - project : common-requirements $(boost_dependencies) : requirements - $(boost_dependencies_private) + /boost/core//boost_core + /boost/predef//boost_predef + /boost/scope//boost_scope + windows:/boost/winapi//boost_winapi hpux,gcc:_INCLUDE_STDC__SOURCE_199901 [ check-target-builds ../config//has_attribute_init_priority "has init_priority attribute" : BOOST_FILESYSTEM_HAS_INIT_PRIORITY ] [ check-target-builds ../config//has_stat_st_mtim "has stat::st_blksize" : BOOST_FILESYSTEM_HAS_STAT_ST_BLKSIZE ] From 29b63d95cd17cedd1c9b6b502cad5c9a26e875ec Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 22 Sep 2024 11:37:09 -0500 Subject: [PATCH 16/16] Remove bug targets from all build as that's not a regular project. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index fe0e10e19..4e9c055ad 100644 --- a/build.jam +++ b/build.jam @@ -23,7 +23,7 @@ project /boost/filesystem explicit [ alias boost_filesystem : build//boost_filesystem ] - [ alias all : boost_filesystem bug example test ] + [ alias all : boost_filesystem example test ] ; call-if : boost-library filesystem