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

feat(makefile) Simplify the prelude + build-capi includes all available compilers #2123

Merged
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
adb7c59
feat(makefile) Simplify conditions with `IS_*` bool variables.
Hywan Feb 15, 2021
659bdb0
fix(makefile) If LLVM 10 and 11 are available, do not duplicate the `…
Hywan Feb 15, 2021
7b38752
feat(makefile) Centralize the `compilers` decision in the same place.
Hywan Feb 15, 2021
006c653
chore(makefile) Rename `test_compilers_engines` to `compilers_engines`.
Hywan Feb 15, 2021
67a1dfe
feat(makefile) Handle the `cranelift-*` pairs in a single place.
Hywan Feb 15, 2021
f3c729d
feat(makefile) Handle the `llvm-*` pairs in a single place.
Hywan Feb 15, 2021
1054e51
feat(makefile) Handle the `singlepass-*` pairs in a single place.
Hywan Feb 15, 2021
ba3fdf1
feaf(makefile) Add the `HAS_<compiler>` variables.
Hywan Feb 15, 2021
06d543a
fix(makefile) Fix syntax error.
Hywan Feb 15, 2021
660daba
feat(makefile) Remove `filter-out`, and clean up `capi_default_featur…
Hywan Feb 15, 2021
95dcb04
feat(makefile) Define a single place to compute Cargo features.
Hywan Feb 15, 2021
6721769
feat(makefile) Use comma to separate Cargo features in `compiler_feat…
Hywan Feb 15, 2021
62c7889
feat(makefile) Remove extra spaces in `compilers` and `compilers_engi…
Hywan Feb 15, 2021
387a753
feat(makefile) `build-capi` includes all available compilers.
Hywan Feb 15, 2021
f846a0d
feat(makefile) Explain `test-capi` and introduce `test-capi-all`.
Hywan Feb 15, 2021
d777994
doc(changelog) Add #2123.
Hywan Feb 15, 2021
2e9fe35
Update Makefile
Hywan Feb 15, 2021
4bcb204
fix(makefile) Add a default value to `use_system_ffi`.
Hywan Feb 15, 2021
68360c8
Update Makefile
Hywan Feb 15, 2021
9cc8177
!debug
Hywan Feb 15, 2021
f6da076
Merge branch 'feat-c-api-build-lib-with-all-compilers-and-engines' of…
Hywan Feb 15, 2021
5aa1597
fix(makefile) Restore `build-capi` to build with all available compil…
Hywan Feb 16, 2021
75f1502
Revert "Update Makefile"
Hywan Feb 16, 2021
07efde1
feat(makefile) Raise an error if the platform is unsupported.
Hywan Feb 16, 2021
404b91f
feat(makefile) Raise an error if the architecture is unsupported.
Hywan Feb 16, 2021
487f78c
feat(makefile) Do not use the `ifeq ($(IS_<platform>), 0)` pattern.
Hywan Feb 16, 2021
0a0b7f8
feat(makefile) Force to enable/disable a compiler with `ENABLE_*`.
Hywan Feb 16, 2021
ba48bc6
feat(makefile) Improve the informative introduction.
Hywan Feb 16, 2021
b242461
doc(makefile) Improve documentation of `test-capi`.
Hywan Feb 16, 2021
e056ef5
doc(changelog) Add #2123 again since it contains 2 features.
Hywan Feb 16, 2021
f1d9847
test(integration) Use `c++` or `clang++` to link the tests.
Hywan Feb 16, 2021
bed96ed
doc(makefile) Do not unfold the matrix.
Hywan Feb 16, 2021
da77c75
Revert "test(integration) Use `c++` or `clang++` to link the tests."
Hywan Feb 16, 2021
39c1c63
fix(ci) Run integration tests with `libwasmer` with Cranelift only.
Hywan Feb 16, 2021
ead3139
fix(ci) Run integration tests with `libwasmer` with Cranelift only.
Hywan Feb 16, 2021
ed34e48
feat(makefile) Exclude LLVM from the list of compilers for the C API.
Hywan Feb 16, 2021
2c374e7
Merge branch 'feat-c-api-build-lib-with-all-compilers-and-engines' of…
Hywan Feb 16, 2021
59fd98b
Fix a merge conflict.
Hywan Feb 16, 2021
0e99ff5
Merge branch 'master' into feat-c-api-build-lib-with-all-compilers-an…
nlewycky Feb 16, 2021
f92a443
Merge branch 'master' into feat-c-api-build-lib-with-all-compilers-an…
syrusakbary Feb 17, 2021
0f15939
doc(makefile) Use times symbol rather than “x”.
Hywan Feb 18, 2021
ab79f3c
Merge branch 'feat-c-api-build-lib-with-all-compilers-and-engines' of…
Hywan Feb 18, 2021
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
48 changes: 36 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -105,6 +105,7 @@ endif
#
#####


HAS_CRANELIFT := 0
HAS_LLVM := 0
HAS_SINGLEPASS := 0
@@ -161,13 +162,13 @@ ifneq (, $(findstring singlepass,$(compilers)))
endif



#####
#
# Define the “Engine” column of the matrix.
#
#####


# The engine is part of a pair of kind (compiler, engine). All the
# pairs are stored in the `compilers_engines` variable.
compilers_engines :=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(No action required.) Just FYI, the reason I didn't name this compilers_engines is because we build a set of compilers and we also build a set of engines, we don't build compiler-engine pairs. This is somewhat useful if you want to build something that is known not to work because you are the developer making it work.

I think the reason behind this renaming is to specify which compilers+engines will be used not just for testing but also in the list provided over the C API, which is fine with me but that part isn't in this commit (haven't looked later in the PR yet).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compilers_engines set of pairs is only used by test-* rules, true, but I thought it was more meaningful to name the variable after what it contains, and not after what it is used for.

If you prefer to name the variable test_compilers_engines, I'm fine keeping it!

@@ -216,26 +217,49 @@ ifeq ($(HAS_SINGLEPASS), 1)
endif


use_system_ffi =
ifeq ($(IS_AARCH64), 1)
# if we are in macos arm64, we use the system libffi for the capi
ifeq ($(IS_DARWIN), 1)
use_system_ffi = yes
#####
#
# Miscellaneous.
#
#####

# The `libffi` library doesn't support Darwin/aarch64. In this
# particular case, we need to use the `libffi` version provided by the
# system itself.
#
# See <https://github.com/libffi/libffi/pull/621>.

use_system_ffi :=

ifeq ($(IS_DARWIN), 1)
ifeq ($(IS_AARCH64, 1))
use_system_ffi = 1
endif
endif

# if the user has set the `WASMER_CAPI_USE_SYSTEM_LIBFFI` var to 1 also
# use the system libffi.
# If the user has set the `WASMER_CAPI_USE_SYSTEM_LIBFFI` environment
# variable to 1, then also use the system `libffi`.
ifeq ($(WASMER_CAPI_USE_SYSTEM_LIBFFI), 1)
use_system_ffi = yes
use_system_ffi = 1
endif

ifdef use_system_ffi
#####
#
# C API default features.
#
#####


ifeq ($(use_system_ffi), 1)
capi_default_features := --features system-libffi
endif

compilers := $(filter-out ,$(compilers))
compilers_engines := $(filter-out ,$(compilers_engines))

#####
#
# There we go!
#
#####

ifeq ($(IS_WINDOWS), 0)
bold := $(shell tput bold 2>/dev/null || echo -n '')