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

Update moon.mod.json #3

Closed
wants to merge 1 commit into from
Closed

Update moon.mod.json #3

wants to merge 1 commit into from

Conversation

vinceLJ
Copy link
Contributor

@vinceLJ vinceLJ commented Aug 20, 2024

gmlewis/jsonutil is not available in deps, please fix it.

gmlewis/jsonutil is not available in deps, please fix it.
@gmlewis
Copy link
Collaborator

gmlewis commented Aug 20, 2024

Did you run moon update && moon install ?

Here is the package: https://mooncakes.io/docs/#/gmlewis/jsonutil/ and I'm not seeing any errors.

I just ran this myself, and got:

$ cat moon.mod.json
{
  "name": "gmlewis/moonbit-pdk",
  "version": "0.34.0",
  "deps": {
    "gmlewis/jsonutil": "0.22.0"
  },
  "readme": "README.md",
  "repository": "https://github.com/gmlewis/moonbit-pdk",
  "license": "Apache-2.0",
  "keywords": [
    "extism",
    "pdk",
    "moonbit"
  ],
  "description": "Extism MoonBit PDK: This library can be used to write Extism Plug-ins in MoonBit."
}

$ moon update && moon install
From https://mooncakes.io/git/index
 * branch            main       -> FETCH_HEAD
Already up to date.
Registry index updated successfully

Can you please share the error message you are getting?

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 20, 2024

I'm using this version:

$ moon version --all
moon 0.1.20240816 (6614fd3 2024-08-16) ~/.moon/bin/moon
moonc v0.1.20240819+fecaf8ce0 ~/.moon/bin/moonc
moonrun 0.1.20240814 (c6a4947 2024-08-14) ~/.moon/bin/moonrun

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 20, 2024

Even if gmlewis/jsonutil were not available, which is not the case, this PR makes no sense to me.
Closing.

@gmlewis gmlewis closed this Aug 20, 2024
@vinceLJ
Copy link
Contributor Author

vinceLJ commented Aug 20, 2024

https://github.com/gmlewis/moonbit-libs/jsonutil in mooncakes.io is not accessible, you can try it. I can only get the jsonutil v0.22 in mooncakes, but the latest jsonutil(v0.34) in github is Page Not Found. I just want to get jsonutil v0.34, as the v0.22 cannot match the latest pdk, there are errors about json while building. Please run pdk from scratch, you will understand that.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 20, 2024

I'll update the repo to point to the correct URL in Mooncakes.io.
Here is what you are looking for:

https://github.com/gmlewis/moonbit-libs/tree/gmlewis-master/jsonutil

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 20, 2024

The latest moonbit-pdk runs fine for me from scratch:

$ cat moon.mod.json
{
  "name": "gmlewis/moonbit-pdk",
  "version": "0.34.0",
  "deps": {
    "gmlewis/jsonutil": "0.22.0"
  },
  "readme": "README.md",
  "repository": "https://github.com/gmlewis/moonbit-pdk",
  "license": "Apache-2.0",
  "keywords": [
    "extism",
    "pdk",
    "moonbit"
  ],
  "description": "Extism MoonBit PDK: This library can be used to write Extism Plug-ins in MoonBit."
}

$ rm -rf target
$ ./build.sh
+ moon fmt
+ moon build --target wasm
Finished. moon: ran 17 tasks, now up to date
+ moon test
Total tests: 2, passed: 2, failed: 0.

$ ./run.sh
+ extism call target/wasm/release/build/examples/greet/greet.wasm greet --wasi --input Benjamin
Hello, Benjamin!

+ extism call target/wasm/release/build/examples/count-vowels/count-vowels.wasm count_vowels --wasi --input 'Once upon a dream'
{"count":7,"total":7,"vowels":"aeiouAEIOU"}

+ extism call target/wasm/release/build/examples/http-get/http-get.wasm http_get --wasi '--allow-host=*.typicode.com'
{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}

+ extism call target/wasm/release/build/examples/kitchen-sink/kitchen-sink.wasm kitchen_sink --wasi --allow-host=extism.org --input 'Testing the kitchen sink'
Testing the kitchen sink

+ extism call target/wasm/release/build/examples/arrays/arrays.wasm progressive_sum_ints --wasi --input '[0,1,2,3,4,5,6]'
[0,1,3,6,10,15,21]

+ extism call target/wasm/release/build/examples/arrays/arrays.wasm progressive_sum_floats --wasi --input '[0,0.1,0.2,0.3,0.4,0.5,0.6]'
[0,0.1,0.30000000000000004,0.6000000000000001,1,1.5,2.1]

+ extism call target/wasm/release/build/examples/arrays/arrays.wasm progressive_concat_strings --wasi --input '["0","1","2","3","4","5","6"]'
["0","0|1","0|1|2","0|1|2|3","0|1|2|3|4","0|1|2|3|4|5","0|1|2|3|4|5|6"]

+ extism call target/wasm/release/build/examples/arrays/arrays.wasm all_three_object --wasi --input '{"ints":[0,1,2,3,4,5,6],"floats":[0,0.1,0.2,0.3,0.4,0.5,0.6],"strings":["0","1","2","3","4","5","6"]}'
{"ints":[0,1,3,6,10,15,21],"floats":[0,0.1,0.30000000000000004,0.6000000000000001,1,1.5,2.1],"strings":["0","0|1","0|1|2","0|1|2|3","0|1|2|3|4","0|1|2|3|4|5","0|1|2|3|4|5|6"]}

$ moon version --all
moon 0.1.20240816 (6614fd3 2024-08-16) ~/.moon/bin/moon
moonc v0.1.20240819+fecaf8ce0 ~/.moon/bin/moonc
moonrun 0.1.20240814 (c6a4947 2024-08-14) ~/.moon/bin/moonrun

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 20, 2024

I've now completely removed the dependency upon gmlewis/jsonutil as it is no longer needed
in version 0.36.0 of extism/moonbit-pdk.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 20, 2024

I see the problem now. The mooncakes.io site is out-of-date.

I'll ask @zshipko on Discord to perform a moon publish, and that should remove all confusion.

If this ever happens in the future, please first check the gmlewis/moonbit-pdk version and compare it against the extism/moonbit-pdk version - they SHOULD BE identical. If they are not, please simply ask for a moon publish in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants