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

Implement wasmer config #3428

Merged
merged 37 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2de0e45
Initial implementation for new wasmer config
fschutt Dec 15, 2022
2923147
Finish porting wapm config
fschutt Dec 15, 2022
11f6c43
PartialWapmConfig -> WasmerConfig
fschutt Dec 15, 2022
1076ff2
Add integration tests
fschutt Dec 15, 2022
1013fe6
Fix make lint
fschutt Dec 15, 2022
43cde31
Add proper defaults for Telemetry and UpdateNotifications
fschutt Dec 16, 2022
344d541
Fix make lint
fschutt Dec 16, 2022
d311e27
Update bash scripts for new "config get" change
fschutt Dec 16, 2022
9cf5095
Merge branch 'master' into config
fschutt Dec 16, 2022
bd0db36
Migrate from enabled: String to enabled: bool
fschutt Dec 16, 2022
32d04e8
Use BoolString for handling CLI flags
fschutt Dec 16, 2022
a1f0d32
Merge branch 'master' into config
fschutt Dec 16, 2022
0bdf5c6
Implement wasmer config CLI handling properly
fschutt Dec 16, 2022
710b824
Revert "Update bash scripts for new "config get" change"
fschutt Dec 18, 2022
327f7a6
Merge remote-tracking branch 'origin/master' into config
fschutt Dec 18, 2022
a058f8e
Delete publish.rs file
fschutt Dec 18, 2022
88d4f1f
Add more integration tests
fschutt Dec 18, 2022
f1aa1d5
Add integration tests for all wasmer config flags
fschutt Dec 19, 2022
ca50d82
Add test to check that --pkg-config conflicts with other flags
fschutt Dec 19, 2022
e96c313
Test multi-config wasmer config calls
fschutt Dec 19, 2022
bc2f445
Update wasmer config for new --flag getters
fschutt Dec 20, 2022
769a8c0
Fix integration tests + cargo fmt
fschutt Dec 20, 2022
c7621ff
Fix wasmer config set subcommand
fschutt Dec 20, 2022
d2868a1
Undo "merge master into config"
syrusakbary Dec 16, 2022
59a192e
Revert "Implement wasmer init and wasmer publish"
syrusakbary Dec 16, 2022
58ee174
Move wasmer config registries to new format for wasmer.toml file
fschutt Dec 20, 2022
506f21a
Remove old login tokens when updating config
fschutt Dec 20, 2022
0c1dc1c
Fix tests
fschutt Dec 20, 2022
1330c1a
Fix make lint
fschutt Dec 20, 2022
fc4e40b
Never crash when wapm.toml could not be read
fschutt Dec 21, 2022
b89d128
Remove wax_cooldown
fschutt Dec 21, 2022
139c314
Revert to "get" / "set" for settable config keys
fschutt Dec 21, 2022
7c2a19a
Merge branch 'master' into config
fschutt Dec 21, 2022
45f4b8d
Merge branch 'master' into config
fschutt Dec 22, 2022
ec18ec7
PartialWapmConfig -> WasmerConfig
fschutt Dec 22, 2022
fdd62e1
Fix merge issues
fschutt Dec 22, 2022
aa04d58
Update wasmer-registry to 4.0.0
fschutt Dec 22, 2022
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ install-capi-pkgconfig:
install-pkgconfig:
# Make sure WASMER_INSTALL_PREFIX is set during build
unset WASMER_DIR; \
if pc="$$(target/release/wasmer config --pkg-config 2>/dev/null)"; then \
if pc="$$(target/release/wasmer config get pkg-config 2>/dev/null)"; then \
echo "$$pc" | install -Dm644 /dev/stdin "$(DESTDIR)"/lib/pkgconfig/wasmer.pc; \
else \
echo 1>&2 "WASMER_INSTALL_PREFIX was not set during build, not installing wasmer.pc"; \
Expand Down
20 changes: 10 additions & 10 deletions lib/c-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,48 +148,48 @@ $ make test-capi

`wasmer config` output various configuration information needed to compile programs which use Wasmer.

### `wasmer config --pkg-config`
### `wasmer config get pkg-config`
fschutt marked this conversation as resolved.
Show resolved Hide resolved

It outputs the necessary details for compiling and linking a program to Wasmer,
using the `pkg-config` format:

```bash
$ wasmer config --pkg-config > $PKG_CONFIG_PATH/wasmer.pc
$ wasmer config get pkg-config > $PKG_CONFIG_PATH/wasmer.pc
```

### `wasmer config --includedir`
### `wasmer config get includedir`
fschutt marked this conversation as resolved.
Show resolved Hide resolved

Directory containing Wasmer headers:

```bash
$ wasmer config --includedir
$ wasmer config get includedir
fschutt marked this conversation as resolved.
Show resolved Hide resolved
/users/myuser/.wasmer/include
```

### `wasmer config --libdir`
### `wasmer config get libdir`

Directory containing Wasmer libraries:

```bash
$ wasmer config --libdir
$ wasmer config get libdir
/users/myuser/.wasmer/lib
```

### `wasmer config --libs`
### `wasmer config get libs`

Libraries needed to link against Wasmer components:

```bash
$ wasmer config --libs
$ wasmer config get libs
-L/Users/myuser/.wasmer/lib -lwasmer
```

### `wasmer config --cflags`
### `wasmer config get cflags`

Headers needed to build against Wasmer components:

```bash
$ wasmer config --cflags
$ wasmer config get cflags
-I/Users/myuser/.wasmer/include/wasmer
```

Expand Down
10 changes: 5 additions & 5 deletions lib/c-api/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ ifeq (,$(wildcard $(WASMER_DIR)/bin/wasmer))
MSVC_LDFLAGS:= ""
MSVC_LDLIBS:= /LIBPATH:$(WASMER_DIR)/lib wasmer.dll.lib
else
CFLAGS = -g -I $(ROOT_DIR)/ -I $(shell $(WASMER_DIR)/bin/wasmer config --includedir)
LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config --libdir)
LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config --libs)
CFLAGS = -g -I $(ROOT_DIR)/ -I $(shell $(WASMER_DIR)/bin/wasmer config get includedir)
LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config get libdir)
LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config get libs)

MSVC_CFLAGS:= /DEBUG /I $(ROOT_DIR)/ /I $(shell $(WASMER_DIR)/bin/wasmer config --includedir)
MSVC_CFLAGS:= /DEBUG /I $(ROOT_DIR)/ /I $(shell $(WASMER_DIR)/bin/wasmer config get includedir)
MSVC_LDFLAGS:= ""
MSVC_LDLIBS:= /LIBPATH:$(shell $(WASMER_DIR)/bin/wasmer config --libs) wasmer.dll.lib
MSVC_LDLIBS:= /LIBPATH:$(shell $(WASMER_DIR)/bin/wasmer config get libs) wasmer.dll.lib
endif

$(info * CFLAGS: $(CFLAGS))
Expand Down
6 changes: 3 additions & 3 deletions lib/c-api/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ ifeq (,$(wildcard $(WASMER_DIR)/bin/wasmer))
LDFLAGS = -Wl,-rpath,$(WASMER_DIR)/lib
LDLIBS = -L $(WASMER_DIR)/lib -lwasmer
else
CFLAGS = -g -I $(ROOT_DIR)/wasm-c-api/include/ -I $(shell $(WASMER_DIR)/bin/wasmer config --includedir)
LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config --libdir)
LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config --libs)
CFLAGS = -g -I $(ROOT_DIR)/wasm-c-api/include/ -I $(shell $(WASMER_DIR)/bin/wasmer config get includedir)
LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config get libdir)
LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config get libs)
endif


Expand Down
1 change: 1 addition & 0 deletions lib/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ enum WasmerCLIOptions {

/// Get various configuration information needed
/// to compile programs which use Wasmer
#[clap(subcommand)]
Config(Config),

/// Update wasmer to the latest version
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::process::{Command, Stdio};

use anyhow::{Context, Error};
use clap::Parser;
use wasmer_registry::{Bindings, PartialWapmConfig, ProgrammingLanguage};
use wasmer_registry::{Bindings, ProgrammingLanguage, WasmerConfig};

/// Add a WAPM package's bindings to your application.
#[derive(Debug, Parser)]
Expand Down Expand Up @@ -76,7 +76,7 @@ impl Add {
match &self.registry {
Some(r) => Ok(r.clone()),
None => {
let cfg = PartialWapmConfig::from_file()
let cfg = WasmerConfig::from_file()
.map_err(Error::msg)
.context("Unable to load WAPM's config file")?;
Ok(cfg.registry.get_current_registry())
Expand Down
Loading