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

Commit

Permalink
Merge pull request #299 from wasmerio/fix-regressions
Browse files Browse the repository at this point in the history
Fix Lockfile / Makefile not found error
  • Loading branch information
fschutt committed Nov 15, 2022
2 parents 8c22094 + 63af4e9 commit 5b9a5ab
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 33 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ jobs:
chmod +x end-to-end-tests/ci/chunked-upload.sh
./end-to-end-tests/ci/chunked-upload.sh
env:
WAPM_DEV_TOKEN: ${{ secrets.WAPM_CLI_TOKEN }}
WAPM_DEV_USERNAME: ${{ secrets.WAPM_CLI_USERNAME }}
WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }}
WAPM_DEV_USERNAME: ${{ secrets.WAPM_DEV_USERNAME }}
- name: 'Regression test: direct execution works'
shell: bash
run: |
Expand Down Expand Up @@ -238,6 +238,9 @@ jobs:
run: |
chmod +x end-to-end-tests/ci/init-and-add.sh
./end-to-end-tests/ci/init-and-add.sh
env:
WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }}
WAPM_DEV_USERNAME: ${{ secrets.WAPM_DEV_USERNAME }}

linux_aarch64:
name: Linux aarch64
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wapm-cli"
version = "0.5.7"
version = "0.5.9"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
repository = "https://github.com/wasmerio/wapm-cli"
Expand Down
3 changes: 0 additions & 3 deletions end-to-end-tests/chunked_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,5 @@ else
fi

cd /tmp/largewasmfile
if ! [[ -z "${WAPM_DEV_TOKEN}" ]]; then
wapm login --quiet "${WAPM_DEV_TOKEN}"
fi
wapm publish --quiet
cd $PWD
3 changes: 3 additions & 0 deletions end-to-end-tests/ci/chunked-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ rm -f wapm.toml
rm -f wapm.lock
wapm config set registry.url "https://registry.wapm.dev/graphql"
chmod +x end-to-end-tests/chunked_upload.sh
if ! [[ -z "${WAPM_DEV_TOKEN}" ]]; then
wapm login "${WAPM_DEV_TOKEN}"
fi
echo "RUNNING SCRIPT..."
./end-to-end-tests/chunked_upload.sh &> /tmp/chunked_upload.txt
echo "GENERATED OUTPUT:"
Expand Down
1 change: 1 addition & 0 deletions end-to-end-tests/ci/direct-execution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rm -f $WASMER_DIR/.wax_index.toml
rm -f wapm.toml
rm -f wapm.lock
chmod +x end-to-end-tests/direct_execute.sh
wapm config set registry.url "https://registry.wapm.dev"
echo "RUNNING SCRIPT..."
./end-to-end-tests/direct_execute.sh &> /tmp/direct_execute.txt
echo "GENERATED OUTPUT:"
Expand Down
11 changes: 10 additions & 1 deletion end-to-end-tests/ci/init-and-add.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
export PATH=$PATH:$HOME/.cargo/bin
export PATH=$PATH:$HOME/.wasmer/bin
export WAPM_DISABLE_COLOR=true
export WAPM_DEV_USERNAME="${WAPM_DEV_USERNAME:-felix}"
rm -f $WASMER_DIR/wapm.sqlite
rm -f $WASMER_DIR/globals/wapm.lock
rm -rf wapm_packages
rm -f wapm.toml
rm -f wapm.lock
chmod +x end-to-end-tests/init-and-add.sh
wapm config set registry.url "https://registry.wapm.dev"
echo "RUNNING SCRIPT..."
./end-to-end-tests/init-and-add.sh &> /tmp/init-and-add-out.txt
echo "GENERATED OUTPUT:"
Expand All @@ -16,8 +18,15 @@ echo "ADJUSTING OUTPUT"
tail -n +3 /tmp/init-and-add-out.txt > /tmp/init-and-add-out2.txt
cat /tmp/init-and-add-out2.txt
mv /tmp/init-and-add-out2.txt /tmp/init-and-add-out.txt
cat end-to-end-tests/init-and-add.txt > /tmp/init-and-add-original.txt
WAPMUSERNAME=$WAPM_DEV_USERNAME
if [ "$(uname)" == "Darwin" ]; then
sed -i '' "s/WAPMUSERNAME/$WAPMUSERNAME/g" /tmp/init-and-add-original.txt
else
sed -i "s/WAPMUSERNAME/$WAPMUSERNAME/g" /tmp/init-and-add-original.txt
fi
echo "COMPARING..."
diff -Bba end-to-end-tests/init-and-add.txt /tmp/init-and-add-out.txt
diff -Bba /tmp/init-and-add-original.txt /tmp/init-and-add-out.txt
export OUT=$?
if ( [ -d globals ] || [ -f wapm.log ] ) then { echo "globals or wapm.log found; these files should not be in the working directory"; exit 1; } else { true; } fi
rm -f wapm.lock
Expand Down
1 change: 1 addition & 0 deletions end-to-end-tests/ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rm -rf wapm_packages
rm -f wapm.toml
rm -f wapm.lock
chmod +x end-to-end-tests/install.sh
wapm config set registry.url "https://registry.wapm.dev"
echo "RUNNING SCRIPT..."
./end-to-end-tests/install.sh &> /tmp/install-out.txt
echo "GENERATED OUTPUT:"
Expand Down
1 change: 1 addition & 0 deletions end-to-end-tests/ci/manifest-validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rm -f wapm.lock
rm -f wapm.toml
rm -rf wapm_packages
chmod +x end-to-end-tests/manifest-validation.sh
wapm config set registry.url "https://registry.wapm.dev"
echo "RUNNING SCRIPT..."
./end-to-end-tests/manifest-validation.sh &> /tmp/manifest-validation-out.txt
echo "GENERATED OUTPUT:"
Expand Down
1 change: 1 addition & 0 deletions end-to-end-tests/ci/package-fs-mapping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rm -rf wapm_packages
rm -f wapm.toml
rm -f wapm.lock
chmod +x end-to-end-tests/package-fs-mapping.sh
wapm config set registry.url "https://registry.wapm.dev"
echo "RUNNING SCRIPT..."
./end-to-end-tests/package-fs-mapping.sh &> /tmp/package-fs-mapping-out.txt
echo "GENERATED OUTPUT:"
Expand Down
1 change: 1 addition & 0 deletions end-to-end-tests/ci/validate-global.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rm -f wapm.lock
rm -f wapm.toml
rm -rf wapm_packages
chmod +x end-to-end-tests/validate-global.sh
wapm config set registry.url "https://registry.wapm.dev"
echo "RUNNING SCRIPT..."
./end-to-end-tests/validate-global.sh &> /tmp/validate-global-out.txt
echo "GENERATED OUTPUT:"
Expand Down
1 change: 1 addition & 0 deletions end-to-end-tests/ci/verification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rm -rf wapm_packages
rm -f wapm.toml
rm -f wapm.lock
chmod +x end-to-end-tests/verification.sh
wapm config set registry.url "https://registry.wapm.dev"
echo "RUNNING SCRIPT..."
./end-to-end-tests/verification.sh &> /tmp/verification-out.txt
echo "GENERATED OUTPUT:"
Expand Down
1 change: 0 additions & 1 deletion end-to-end-tests/direct_execute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

export RUST_BACKTRACE=1
ln -sf `which wapm` wax
wapm config set registry.url "https://registry.wapm.dev"

# echo "hello" | wapm execute base64
# ./wax echo "hello"
Expand Down
1 change: 0 additions & 1 deletion end-to-end-tests/init-and-add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

mkdir test-package
cd test-package
wapm config set registry.url "https://registry.wapm.dev"
wapm init -y
wapm add this-package-does-not-exist
wapm add mark2/python@0.0.4 mark2/dog2
Expand Down
6 changes: 3 additions & 3 deletions end-to-end-tests/init-and-add.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

[package]
name = "test-package"
name = "WAPMUSERNAME/test-package"
version = "1.0.0"
description = "Package description for test-package"
description = "Package description for WAPMUSERNAME/test-package"
license = "ISC"

[[module]]
name = "entry"
source = "entry.wasm"


Successfully initialized project "test-package"
Successfully initialized project "WAPMUSERNAME/test-package"
[ERROR] Package "this-package-does-not-exist" was not found
Error: There were problems adding packages
[INFO] Adding mark2/python@0.0.4
Expand Down
1 change: 0 additions & 1 deletion end-to-end-tests/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

wapm config set registry.url "https://registry.wapm.dev"
wapm install namespace-example/cowsay@0.1.2
wapm install namespace-example/cowsay@0.1.2
wapm run cowsay "hello, world"
Expand Down
1 change: 0 additions & 1 deletion end-to-end-tests/manifest-validation.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

export RUST_BACKTRACE=1
wapm config set registry.url "https://registry.wapm.dev"
echo '[package]\nname="test"\nversion="0.0.0"\ndescription="this is a test"\n[[command]]\nname="test"\nmodule="test-module"\n[fs]\n"wapm_file"="src/bin"' > wapm.toml
wapm publish --dry-run
# get a wasm module so we forget the abi field
Expand Down
1 change: 0 additions & 1 deletion end-to-end-tests/package-fs-mapping.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

export RUST_BACKTRACE=1
wapm config set registry.url "https://registry.wapm.dev"
wapm install -g mark2/dog2@0.0.13 --force-yes
wapm run dog -- data
wapm uninstall -g mark2/dog2
Expand Down
2 changes: 0 additions & 2 deletions end-to-end-tests/validate-global.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh

wapm config set registry.url "https://registry.wapm.dev"

# test that the command name is overriden by default
wapm install -g mark2/binary-name-matters@0.0.3 -y
wapm run binary-name-matters
Expand Down
1 change: 0 additions & 1 deletion end-to-end-tests/verification.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

export RUST_BACKTRACE=1
wapm config set registry.url "https://registry.wapm.dev"
# redirect stderr to /dev/null so we can capture important stderr
yes no 2> /dev/null | wapm install mark2/dog2@0.0.0
# wc because the date changes
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ pub enum ConfigError {
pub fn set(config: &mut Config, key: String, value: String) -> anyhow::Result<()> {
match key.as_ref() {
"registry.url" => {
let value = format_graphql(&value);
if config.registry.get_current_registry() != value {
config.registry.set_current_registry(&value);
}
Expand Down
8 changes: 2 additions & 6 deletions src/dataflow/lockfile_packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ impl LockfileResult {
pub fn find_in_directory<P: AsRef<Path>>(directory: P) -> Self {
let directory = directory.as_ref();
if !directory.is_dir() {
return LockfileResult::LockfileError(LockfileError::IoError(
format!("LockfileResult: Manifest must be a file named `wapm.toml` (directory.is_dir() failed on {})", directory.display()),
));
return LockfileResult::NoLockfile;
}
let lockfile_path_buf = directory.join(LOCKFILE_NAME);
if !lockfile_path_buf.is_file() {
return LockfileResult::LockfileError(LockfileError::IoError(
format!("LockfileResult: Manifest must be a file named `wapm.toml` (lockfile_path_buf.is_file() failed on {})", lockfile_path_buf.display()),
));
return LockfileResult::NoLockfile;
}
let source = match fs::read_to_string(&lockfile_path_buf) {
Ok(s) => s,
Expand Down
10 changes: 2 additions & 8 deletions src/dataflow/manifest_packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ use thiserror::Error;
pub enum Error {
#[error("Could not parse manifest because {0}.")]
ManifestTomlParse(String),
#[error("Could not parse manifest because {0}.")]
Io(String),
#[error(
"Version {0} for package {1} must be a semantic version or a semantic version requirement."
)]
Expand All @@ -33,15 +31,11 @@ impl ManifestResult {
pub fn find_in_directory<P: AsRef<Path>>(directory: P) -> Self {
let directory = directory.as_ref();
if !directory.is_dir() {
return ManifestResult::ManifestError(Error::Io(
format!("ManifestResult: Manifest must be a file named `wapm.toml` (directory.is_dir() failed on {})", directory.display()),
));
return ManifestResult::NoManifest;
}
let manifest_path_buf = directory.join(MANIFEST_FILE_NAME);
if !manifest_path_buf.is_file() {
return ManifestResult::ManifestError(Error::Io(
format!("ManifestResult: Manifest must be a file named `wapm.toml` (manifest_path_buf.is_file() failed on {})", manifest_path_buf.display()),
));
return ManifestResult::NoManifest;
}
let source = match fs::read_to_string(&manifest_path_buf) {
Ok(s) => s,
Expand Down

0 comments on commit 5b9a5ab

Please sign in to comment.