Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jzmaddock committed Feb 12, 2023
2 parents a86fdce + f573ac4 commit e0b9262
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 127 deletions.
57 changes: 0 additions & 57 deletions .circleci/config.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2020 Evan Miller
# Copyright 2020 Matt Borland
# Copyright 2021 John Maddock
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

name: CI
on:
push:
branches:
- master
- develop
pull_request:
release:
types: [published, created, edited]
jobs:
ubuntu-jammy:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [ g++-12 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
commit-filter-separator: ';'
fail-fast: true
- name: Set TOOLSET
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
- name: Add repository
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt install g++-12 git xsltproc docbook-xsl docbook-xml
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* tools/bcp
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Generate user config
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} ;" > ~/user-config.jam'
working-directory: ../boost-root
- name: Config info
run: ./b2 libs/config/test//print_config_info
working-directory: ../boost-root
- name: Test
run: ./ci_script.sh
working-directory: ../boost-root/tools/bcp/test
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

48 changes: 32 additions & 16 deletions add_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

void bcp_implementation::add_path(const fs::path& p)
{
if (m_excluded.find(p) != m_excluded.end())
return;
fs::path normalized_path = p;
normalized_path.normalize();
if(fs::exists(m_boost_path / normalized_path))
Expand Down Expand Up @@ -75,7 +77,8 @@ void bcp_implementation::add_directory(const fs::path& p)
if(!m_dependencies.count(np))
{
m_dependencies[np] = p; // set up dependency tree
add_pending_path(np);
if (m_excluded.find(np) == m_excluded.end())
add_pending_path(np);
}
++i;
}
Expand Down Expand Up @@ -232,20 +235,20 @@ static const std::pair<fs::path, fs::path>
std::pair<fs::path, fs::path>("boost/filesystem.hpp", "libs/filesystem/v2"),
std::pair<fs::path, fs::path>("boost/filesystem.hpp", "libs/filesystem/v3"),
std::pair<fs::path, fs::path>("boost/config.hpp", "boost/config"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "libs/config/checks"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "libs/config/test"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "libs/headers/build"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "tools/boost_install/BoostConfig.cmake"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "tools/boost_install/BoostDetectToolset.cmake"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "tools/boost_install/boost-install.jam"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "tools/boost_install/boost-install-dirs.jam"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "boost-build.jam"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "boostcpp.jam"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "bootstrap.bat"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "bootstrap.sh"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "Jamroot"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "INSTALL"),
std::pair<fs::path, fs::path>("tools/build/boost-build.jam", "LICENSE_1_0.txt"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "libs/config/checks"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "libs/config/test"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "libs/headers/build"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/BoostConfig.cmake"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/BoostDetectToolset.cmake"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/boost-install.jam"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/boost-install-dirs.jam"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "boostcpp.jam"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "project-config.jam"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "bootstrap.bat"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "bootstrap.sh"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "Jamroot"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "INSTALL"),
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "LICENSE_1_0.txt"),
std::pair<fs::path, fs::path>("boost/preprocessor/iterate.hpp", "boost/preprocessor/iteration"),
std::pair<fs::path, fs::path>("boost/preprocessor/slot/slot.hpp", "boost/preprocessor/slot/detail"),
std::pair<fs::path, fs::path>("boost/function.hpp", "boost/function/detail"),
Expand Down Expand Up @@ -283,6 +286,19 @@ static const std::pair<fs::path, fs::path>
std::pair<fs::path, fs::path>("libs/coroutine/build/Jamfile.v2", "libs/context/build"),
std::pair<fs::path, fs::path>("libs/fiber/build/Jamfile.v2", "libs/context/src"),
std::pair<fs::path, fs::path>("libs/fiber/build/Jamfile.v2", "libs/context/build"),
std::pair<fs::path, fs::path>("boost/graph/breadth_first_search.hpp", "boost/graph/distributed/concepts.hpp"),
std::pair<fs::path, fs::path>("boost/graph/breadth_first_search.hpp", "boost/graph/distributed/breadth_first_search.hpp"),
std::pair<fs::path, fs::path>("boost/graph/connected_components.hpp", "boost/graph/distributed/connected_components.hpp"),
std::pair<fs::path, fs::path>("boost/graph/depth_first_search.hpp", "boost/graph/distributed/depth_first_search.hpp"),
std::pair<fs::path, fs::path>("boost/graph/detail/mpi_include.hpp", "boost/graph/detail/empty_header.hpp"),
std::pair<fs::path, fs::path>("boost/graph/dijkstra_shortest_paths.hpp", "boost/graph/distributed/dijkstra_shortest_paths.hpp"),
std::pair<fs::path, fs::path>("boost/graph/fruchterman_reingold.hpp", "boost/graph/distributed/fruchterman_reingold.hpp"),
std::pair<fs::path, fs::path>("boost/graph/graphviz.hpp", "boost/graph/distributed/graphviz.hpp"),
std::pair<fs::path, fs::path>("boost/graph/one_bit_color_map.hpp", "boost/graph/distributed/one_bit_color_map.hpp"),
std::pair<fs::path, fs::path>("boost/graph/page_rank.hpp", "boost/graph/distributed/page_rank.hpp"),
std::pair<fs::path, fs::path>("boost/graph/rmat_graph_generator.hpp", "boost/graph/distributed/rmat_graph_generator.hpp"),
std::pair<fs::path, fs::path>("boost/graph/strong_components.hpp", "boost/graph/distributed/strong_components.hpp"),
std::pair<fs::path, fs::path>("boost/graph/two_bit_color_map.hpp", "boost/graph/distributed/two_bit_color_map.hpp"),
};

for(unsigned int n = 0; n < (sizeof(specials)/sizeof(specials[0])); ++n)
Expand Down Expand Up @@ -506,7 +522,7 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile)
const std::string* known_macros_end = known_macros + sizeof(known_macros)/sizeof(known_macros[0]);
if(known_macros_end == std::find(known_macros, known_macros_end, i->str()))
{
std::cerr << "CAUTION: don't know how to trace depenencies through macro: \"" << *i << "\" in file: " << p.string() << std::endl;
std::cerr << "CAUTION: don't know how to trace dependencies through macro: \"" << *i << "\" in file: " << p.string() << std::endl;
}
++i;
}
Expand Down
1 change: 1 addition & 0 deletions bcp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class bcp_application
virtual void set_namespace(const char* name) = 0;
virtual void set_namespace_alias(bool) = 0;
virtual void set_namespace_list(bool) = 0;
virtual void add_excluded(const char* p) = 0;

virtual int run() = 0;

Expand Down
10 changes: 10 additions & 0 deletions bcp_imp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ void bcp_implementation::set_namespace_list(bool b)
m_list_mode = b;
}

void bcp_implementation::add_excluded(const char* p)
{
if (!fs::exists(p))
{
std::cerr << "CAUTION: excluded path " << p << " does not exist." << std::endl;
return;
}
m_excluded.insert(p);
}

fs::path get_short_path(const fs::path& p)
{
// truncate path no more than "x/y":
Expand Down
2 changes: 2 additions & 0 deletions bcp_imp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class bcp_implementation
void set_namespace(const char* name);
void set_namespace_alias(bool);
void set_namespace_list(bool);
void add_excluded(const char* p);

virtual int run();

Expand Down Expand Up @@ -117,5 +118,6 @@ class bcp_implementation
std::set<std::string> m_lib_names; // List of library binary names
std::map<std::string, fs::path> m_top_namespaces; // List of top level namespace names
std::queue<fs::path, std::list<fs::path> > m_pending_paths; // Queue of paths we haven't scanned yet.
std::set<fs::path, path_less> m_excluded; // paths to ignore in scan
};

2 changes: 1 addition & 1 deletion doc/bcp.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ names of the headers you are actually including, or use the --scan option to sca
* If you include the header of a library with separate source, then you get that libraries source and all
it's dependencies. This is deliberate and in general those extra dependencies are needed.
* When you include a header, bcp doesn't know what compiler you're using, so it follows all
possible preprocessor paths. If you're distributing a subset of Boost with you're application then that
possible preprocessor paths. If you're distributing a subset of Boost with your application then that
is what you want to have happen in general.

The last point above can result in a substantial increase in the number of headers found compared to most
Expand Down
5 changes: 5 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void show_usage()
" --unix-lines make sure that all copied files use Unix style line endings\n"
" --namespace=name rename the boost namespace to name (also changes library names).\n"
" --namespace-alias Makes namespace boost an alias of the namespace set with --namespace.\n"
" --exclude path to exclude from the scan, can be repeated\n"
"\n"
"module-list: a list of boost files or library names to copy\n"
"html-file: the name of a html file to which the report will be written\n"
Expand Down Expand Up @@ -151,6 +152,10 @@ int cpp_main(int argc, char* argv[])
list_mode = true;
papp->set_namespace_list(true);
}
else if(0 == std::strncmp("--exclude=", argv[i], 10))
{
papp->add_excluded(argv[i] + 10);
}
else if(argv[i][0] == '-')
{
std::cout << "Error: Unknown argument " << argv[i] << std::endl;
Expand Down
34 changes: 34 additions & 0 deletions test/ci_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
# Copyright (C) 2022 John Maddock
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

# boostinspect:notab - Tabs are required for the Makefile.

# boost-root:
cd ../../..
./b2 -j3 tools/bcp || { echo './b2 -j3 tools/bcp failed' ; exit 1; }
rm -rf ../bcp-output
mkdir ../bcp-output || { echo 'mkdir failed' ; exit 1; }
./dist/bin/bcp program_options build ../bcp-output || { echo './dist/bin/bcp program_options build ../bcp-output failed' ; exit 1; }

# tests:
cd ../bcp-output
ls -l
./bootstrap.sh || { echo './bootstrap.sh failed' ; exit 1; }
./b2 -j3 libs/program_options/build || { echo './b2 -j3 libs/program_options/build failed' ; exit 1; }
./b2 -j3 --with-program_options || { echo './b2 -j3 --with-program_options failed' ; exit 1; }
./b2 -j3 || { echo './b2 -j3 failed' ; exit 1; }

# run inspect:
cd ../boost-root
echo "using xsltproc ;" | tee -a $HOME/user-config.jam
echo "using boostbook : /usr/share/xml/docbook/stylesheet/docbook-xsl : /usr/share/sgml/docbook/dtd/xml/4.2 ;" | tee -a $HOME/user-config.jam
cd tools/inspect/build
../../../b2 -j2 address-model=64 architecture=x86 toolset=gcc cxxflags="-std=gnu++14" release dist-bin || { echo 'building inspect failed' ; exit 1; }
cd ../../bcp/doc
rm -rf html
../../../b2 -j2 address-model=64 architecture=x86 toolset=gcc cxxflags="-std=gnu++14" release || { echo 'building docs failed' ; exit 1; }
../../../dist/bin/inspect -text || { echo 'inspect failed' ; exit 1; }

0 comments on commit e0b9262

Please sign in to comment.