Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring modules branch up-to-date #11

Merged
merged 59 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
646a84c
Added .gitattributes for symlink annotation
kamrann Aug 10, 2022
71b03fd
Bumped upstream to 9.0.0.
kamrann Aug 10, 2022
a1dcba7
Bumped package version to 9.0.0, and build2 toolchain dependency vers…
kamrann Aug 10, 2022
91ff92c
Merge pull request #3 from kamrann/v9
Klaim Dec 10, 2022
cc24203
Fixed conditional expression for fmt target as module or not
Klaim Dec 10, 2022
bef2ed5
Replaced config setup to fix #2 and use lib meta data instead.
Klaim Dec 10, 2022
56c3e8d
Attempt to fix meta-data in the installed-use scenario
Klaim Dec 10, 2022
d5d8482
CI: Excludes building with msvc 14.33 and 14.34
Klaim Dec 11, 2022
5d921dc
Workaround msvc 14.32/33 bug (see https://github.com/fmtlib/fmt/issue…
Klaim Dec 11, 2022
b623755
Release version 9.0.0+1
Klaim Dec 11, 2022
926169e
Update to 9.1.0
Klaim Dec 10, 2022
83ff14c
Update to v10.0.0 (only basic test, no modules support yet)
Klaim Jun 13, 2023
568a4a4
Prepare for new C++ modules support
Klaim Jun 13, 2023
f681858
Bump to v10.1.1
Klaim Sep 15, 2023
0196126
Bump to v10.2.1
Klaim Jan 9, 2024
2258320
Update upstream to v11.0.0 + updated basic tests
Klaim Jul 1, 2024
c85ebda
Requires build2 v0.17.0
Klaim Jul 1, 2024
f7553c7
Update upstream to v11.0.1
Klaim Jul 13, 2024
8a1516b
This repository is now a multi-package repository (fixed #6)
Klaim Jul 13, 2024
98738f4
Merge pull request #8 from build2-packaging/multipackages
Klaim Jul 15, 2024
5bc0f0f
Remove enable_modules build config variable, use cxx.features.modules…
kamrann Jul 18, 2024
a836c69
Include bmis target type when setting export poptions
kamrann Jul 18, 2024
1f14622
Automatically enable FMT_ATTACH_TO_GLOBAL_MODULE when building as mod…
kamrann Jul 18, 2024
f808761
Replace import std; in smoke tests with #includes, pending implementi…
kamrann Jul 18, 2024
0757158
Add package configuration variable to toggle use of import std.
kamrann Jul 22, 2024
a9ee48b
Add config option for a modules-only mode.
kamrann Jul 22, 2024
b2e4c3b
Point upstream to master branch of upstream fmt - this has merged in …
kamrann Aug 26, 2024
c271d77
Add new package for hosting upstream tests.
kamrann Aug 30, 2024
110906e
Add .vs/ folder to gitignore
kamrann Aug 30, 2024
ab0cc5e
Align the test package version number to the main package.
kamrann Aug 30, 2024
79827a3
Adjusted fmt-tests buildfiles to attempt to fix issues with include p…
kamrann Aug 31, 2024
b5ecdbf
Marked all executable targets in fmt-tests as tests.
kamrann Aug 31, 2024
6007797
Tweak to ranges-test to match upstream CMake setup.
kamrann Sep 2, 2024
6042313
Symc to latest upstream
kamrann Sep 2, 2024
4841d77
Refactor smoke test buildfile to avoid conditional target dependencies.
kamrann Sep 2, 2024
014a3d8
Experiment with package specific CI configurations.
kamrann Sep 2, 2024
8055762
Force reproces=true on MSVC modules builds to work around compiler bug.
kamrann Sep 2, 2024
1130bb6
Fix for incorrect variable prefix.
kamrann Sep 2, 2024
c553ca8
Constrain modules CI build configs to latest.
kamrann Sep 2, 2024
495ab27
Experiment constraining to clang.
kamrann Sep 2, 2024
c328c6c
Switch from latest to experimental
kamrann Sep 2, 2024
b3b1dcc
Add msvc to CI package configs
kamrann Sep 2, 2024
82e02d5
Revert CI configs to latest
kamrann Sep 2, 2024
dc8fb4b
Change smoke test to use template parameter for format parse context,…
kamrann Sep 2, 2024
105613f
Update upstream to grab latest fixes.
kamrann Sep 4, 2024
f3a93ca
Merge branch 'pr/v11-modules' into tests-prototyping
kamrann Sep 4, 2024
780ba03
Upstream submodule update.
kamrann Sep 4, 2024
682c69b
Upstream update.
kamrann Sep 4, 2024
2922bb4
Upstream sync.
kamrann Sep 4, 2024
3d7398a
Upstream sync
kamrann Sep 4, 2024
c5c5ab5
Upstream sync.
kamrann Sep 7, 2024
05855de
Disable modules builds on CI.
kamrann Sep 7, 2024
8841258
Switch upstream branch bag to latest tagged release (11.0.2)
kamrann Sep 10, 2024
7c56c1c
Add some CI build exclusions.
kamrann Sep 10, 2024
b6d3af9
Revert "Fixed module support but cannot test for now"
kamrann Sep 10, 2024
0a90c61
Merge branch 'pr/v11-modules' into modules
kamrann Sep 10, 2024
6b5d114
Update package readme with latest information on modules compatibility.
kamrann Sep 10, 2024
8f3e148
Add comment to manifest re CI modules configs.
kamrann Sep 10, 2024
1251ad1
Merge branch 'pr/v11-modules' into modules
kamrann Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is a good default: files that are auto-detected by git to be text are
# converted to the platform-native line ending (LF on Unix, CRLF on Windows)
# in the working tree and to LF in the repository.
#
* text=auto

# Use `eol=crlf` for files that should have the CRLF line ending both in the
# working tree (even on Unix) and in the repository.
#
#*.bat text eol=crlf

# Use `eol=lf` for files that should have the LF line ending both in the
# working tree (even on Windows) and in the repository.
#
#*.sh text eol=lf

# Use `binary` to make sure certain files are never auto-detected as text.
#
#*.png binary

fmt/fmt/include symlink=dir
fmt/fmt/src symlink=dir
fmt/doc symlink=dir
fmt-tests/basics/test symlink=dir
fmt-tests/test-main/test symlink=dir
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.bdep/
.vs/

# Local default options files.
#
Expand Down
17 changes: 0 additions & 17 deletions README.md

This file was deleted.

7 changes: 0 additions & 7 deletions build/config-options.build2

This file was deleted.

9 changes: 5 additions & 4 deletions buildfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
./: {*/ -build/ -upstream/ -doc/} manifest doc{README.md} doc/doc{**}

# Don't install tests.
# Glue buildfile that "pulls" all the packages in the project.
#
tests/: install = false
import pkgs = [dir_paths] $process.run_regex(\
cat $src_root/packages.manifest, '\s*location\s*:\s*(\S+)\s*', '\1')

./: $pkgs
1 change: 0 additions & 1 deletion doc

This file was deleted.

25 changes: 25 additions & 0 deletions fmt-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Compiler/linker output.
#
*.d
*.t
*.i
*.i.*
*.ii
*.ii.*
*.o
*.obj
*.gcm
*.pcm
*.ifc
*.so
*.dylib
*.dll
*.a
*.lib
*.exp
*.pdb
*.ilk
*.exe
*.exe.dlls/
*.exe.manifest
*.pc
5 changes: 5 additions & 0 deletions fmt-tests/basics/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
basics

# Testscript output directory (can be symlink).
#
test-basics
45 changes: 45 additions & 0 deletions fmt-tests/basics/buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
include ../test-main/

#test_names =
# args-test \
# assert-test \
# base-test
gtest_test_names = args-test assert-test base-test chrono-test color-test compile-fp-test compile-test format-test gtest-extra-test noexception-test os-test ostream-test printf-test std-test unicode-test xchar-test

# header-only-test <- header only mode seemingly not supported by this build2 package?
# scan-test <- some linker issues
# posix-mock-test <- needs posix-mock.h, and has some msvc/runtime conditional logic going on

standalone_test_names = enforce-checks-test # some way to pair these? -DFMT_ENFORCE_COMPILE_STRING

for test_name : $gtest_test_names
{
./: exe{$test_name} : test/cxx{$test_name}
exe{$test_name}: ../test-main/liba{test-main}:
{
bin.whole = true
}
}

./: exe{ranges-test} : test/cxx{ranges-test ranges-odr-test}
exe{ranges-test}: ../test-main/liba{test-main}:
{
bin.whole = true
}

# linker issues.
#./: exe{scan-test} : test/cxx{scan-test} ../test-main/liba{test-main}

# @todo: cmake adds this test conditionally on NOT ( msvc AND fmt-shared )
# in build2, i guess it's a bit different in that we can potentially build both shared and static variants within a single config?
# also not clear how fmt_shared/fmt_header_only is being configured, looks like the package doesn't do anything there. using defaults only?
# if $cxx. != msvc
#./: exe{format-impl-test} : test/cxx{format-impl-test header-only-test} ../test-main/liba{test-main}


import fmt = fmt%lib{fmt}

for test_name : $standalone_test_names
{
./: exe{$test_name} : test/cxx{$test_name} $fmt
}
1 change: 1 addition & 0 deletions fmt-tests/basics/test
4 changes: 4 additions & 0 deletions fmt-tests/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/config.build
/root/
/bootstrap/
build/
6 changes: 6 additions & 0 deletions fmt-tests/build/bootstrap.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project = fmt-tests

using version
using config
using test
using dist
12 changes: 9 additions & 3 deletions build/root.build → fmt-tests/build/root.build
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Uncomment to suppress warnings coming from external libraries.
#
#cxx.internal.scope = current

cxx.std = latest

using cxx

hxx{*}: extension = h
cxx{*}: extension = cc
mxx{*}: extension = cc
cxx{*}: extension = cc

# All executables are tests
#
exe{*}: test = true

# The test target for cross-testing (running tests under Wine, etc).
#
test.target = $cxx.target

include $src_root/build/config-options.build2
1 change: 1 addition & 0 deletions fmt-tests/buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./: {*/ -build/} manifest
13 changes: 13 additions & 0 deletions fmt-tests/manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
: 1
name: fmt-tests
version: 11.0.1-a.0.z
project: fmt
summary: Tests package for fmt upstream tests
license: MIT
url: https://github.com/fmtlib/fmt/

depends: * build2 >= 0.17.0
depends: * bpkg >= 0.17.0

depends: gtest ^1.11.0
depends: gmock ^1.11.0
14 changes: 14 additions & 0 deletions fmt-tests/test-main/buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

libs =
import libs += fmt%lib{fmt}
import libs += gtest%lib{gtest} gmock%lib{gmock}

liba{test-main}: test/cxx{test-main gtest-extra util} test/hxx{gtest-extra mock-allocator test-assert util} $libs

# Export options.
#
liba{test-main}:
{
cxx.export.poptions += "-I$src_base/test"
cxx.export.libs = $libs
}
1 change: 1 addition & 0 deletions fmt-tests/test-main/test
26 changes: 26 additions & 0 deletions fmt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
`{fmt}` library - Build2 package
================================

See [`{fmt}` documentation](https://fmt.dev/) for usage and details.

- `{fmt}` : https://github.com/fmtlib/fmt/
- Build2 : https://build2.org

Note: This is the source code for the build2 package of the `{fmt}` C++ library,
the actual library sources snapshot can be found in the `./upstream/` submodule.

## Configuration Options

### Experimental C++20 modules support

Modules support is WIP, both in the `build2` package and also in `fmt` upstream. Latest versions of MSVC or Clang are recommended, and the most up-to-date version of the package with regards to modules compatibility can be used via git and the [modules branch](https://github.com/build2-packaging/fmt/tree/modules). For example, in project `repositories.manifest`:
```
:
role: prerequisite
location: https://github.com/build2-packaging/fmt.git#modules
```

Enable with `config.cxx.features.modules=true`. When enabled, by default dual mode is used meaning that the library can be consumed either through `import` or via `#include`. To enable this safely, all entities are attached to the global module (extern "C++"). See `modules_only` option for the alternative.
- `config.fmt.enable_import_std` : Set to `true` to consume the standard library as a module when building the `fmt` module. Support dependent on compiler and std lib. Defaults to `false`.
- `config.fmt.modules_only` : Set to `true` to enable modules-only mode for the package. In this mode, `fmt` entities are fully encapsulated in the `fmt` module meaning `#include`-based consumption cannot be mixed, and the package will not export headers. Defaults to `false`.

File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions fmt/build/root.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cxx.std = latest

using cxx

hxx{*}: extension = h
cxx{*}: extension = cc
mxx{*}: extension = cc

# The test target for cross-testing (running tests under Wine, etc).
#
test.target = $cxx.target


##############################
# Project-specific options:

config [bool] config.fmt.enable_import_std ?= false
config [bool] config.fmt.modules_only ?= false
58 changes: 3 additions & 55 deletions fmt/buildfile
Original file line number Diff line number Diff line change
@@ -1,57 +1,5 @@
int_libs = # Interface dependencies.
imp_libs = # Implementation dependencies.
#import imp_libs += libhello%lib{hello}
./: {*/ -build/ -upstream/ -doc/} manifest doc{README.md} doc/doc{**}

./ : lib{fmt}

lib{fmt}: include/hxx{**} hxx{version} $imp_libs $int_libs
lib{fmt}: src/mxx{fmt} : include = ($config.fmt.enable_modules == true)
lib{fmt}: src/cxx{** -fmt} : include = ($config.fmt.enable_modules == false)

# Include the generated version header into the distribution (so that we don't
# pick up an installed one) and don't remove it when cleaning in src (so that
# clean results in a state identical to distributed).
#
hxx{version} : in{version} $src_root/manifest
{
dist = true
clean = ($src_root != $out_root)
install = include/fmt
}

# Build options.
#
cxx.poptions =+ "-I$src_base/include" "-I$out_root" "-I$src_root"
objs{*}: cxx.poptions += -DFMT_EXPORT -DFMT_SHARED

# Export options.
#
lib{fmt}:
{
cxx.export.poptions = "-I$src_base/include" "-I$out_root" "-I$src_root"
cxx.export.libs = $int_libs
}

libs{fmt}: cxx.export.poptions += -DFMT_SHARED


# For pre-releases use the complete version to make sure they cannot be used
# in place of another pre-release or the final version. See the version module
# for details on the version.* variable values.
#
if $version.pre_release
lib{fmt}: bin.lib.version = @"-$version.project_id"
else
lib{fmt}: bin.lib.version = @"-$version.major.$version.minor"

# Install into the fmt/ subdirectory of, say, /usr/include/
# recreating subdirectories.
# Don't install tests.
#
include/
{
{hxx ixx txx}{*}:
{
install = include/
install.subdirs = true
}
}
tests/: install = false
1 change: 1 addition & 0 deletions fmt/doc
File renamed without changes.
Loading