Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

The WAPM CLI doesn't respect the WASMER_DIR environment variable #234

Open
Michael-F-Bryan opened this issue Apr 10, 2022 · 0 comments
Open

Comments

@Michael-F-Bryan
Copy link
Contributor

Michael-F-Bryan commented Apr 10, 2022

Describe the bug

The wapm CLI tool doesn't use the $WASMER_DIR variable when saving its logs or database file.

$ wapm -V
Error: Failed to open logging file in WASMER_DIR: error type: NotFound
wapm-cli 0.5.1
$ rustc -Vv
rustc 1.62.0-nightly (f4a7ce997 2022-04-08)
binary: rustc
commit-hash: f4a7ce997a1d7546d2b737f8b87d36907bcea2ad
commit-date: 2022-04-08
host: x86_64-unknown-linux-gnu
release: 1.62.0-nightly
LLVM version: 14.0.0

Steps to reproduce

$ echo $WASMER_DIR
/home/michael/.config/wasmer
$ ls $WASMER_DIR
wapm.log  wapm.toml
$ cd path/to/some/wapm/package

$ cat wapm.toml
[package]
name = "Michael-F-Bryan/cuboid-model"
version = "0.1.0"
description = "A module for generating a cuboid."
license = "MIT or APACHE-2.0"

[[module]]
name = "cuboid-model"
source = "cuboid_model.wasm"
abi = "none"

$ wapm publish --dry-run
Error: Failed to open logging file in WASMER_DIR: error type: NotFound
Error: unable to open database file: /home/michael/.wasmer/wapm.sqlite

$ mkdir ~/.wasmer

$ wapm publish --dry-run
Successfully published package `Michael-F-Bryan/[email protected]`
[INFO] Publish succeeded, but package was not published because it was run in dry-run mode

$ ls ~/.wasmer
wapm.log  wapm.sqlite

Expected behavior

The wapm CLI should have written wapm.log and wapm.sqlite to ~/.config/wasmer ($WASMER_DIR).

Actual behavior

It uses the hard-coded ~/.wasmer directory.

Additional context

This version of wapm was installed via cargo install.

@Michael-F-Bryan Michael-F-Bryan changed the title The WAPM CLI doesn The WAPM CLI doesn't respect the WASMER_DIR environment variable Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant