Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Integralist
Copy link
Collaborator

@Integralist Integralist commented Feb 21, 2023

We can see that the new 'default' build of a package only contains the main.wasm and fastly.toml manifest...

$ list_contents pkg/testing-fastly-cli.tar.gz

drwx------  0 integralist staff       0 21 Feb 14:43 testing-fastly-cli/
drwx------  0 integralist staff       0 21 Feb 14:43 testing-fastly-cli/bin/
-rw-r--r--  0 integralist staff 12195738 21 Feb 14:43 testing-fastly-cli/bin/main.wasm
-rw-r--r--  0 integralist staff      320 21 Feb 14:43 testing-fastly-cli/fastly.toml

But if we specify --include-source...

$ fastly compute build --include-source
✓ Initializing...
✓ Verifying package manifest...
✓ Running [scripts.build]...
✓ Creating package archive...

SUCCESS: Built package (pkg/testing-fastly-cli.tar.gz)

...then we'll find more contents inside the package...

$ list_contents pkg/testing-fastly-cli.tar.gz

drwx------  0 integralist staff       0 21 Feb 14:47 testing-fastly-cli/
drwx------  0 integralist staff       0 21 Feb 14:47 testing-fastly-cli/bin/
-rw-r--r--  0 integralist staff     850 21 Feb 14:47 testing-fastly-cli/bin/index.js
-rw-r--r--  0 integralist staff 12195760 21 Feb 14:47 testing-fastly-cli/bin/main.wasm
-rw-r--r--  0 integralist staff      320 21 Feb 14:47 testing-fastly-cli/fastly.toml
drwx------  0 integralist staff        0 21 Feb 14:47 testing-fastly-cli/src/
-rw-r--r--  0 integralist staff     2821 21 Feb 14:47 testing-fastly-cli/src/index.js
-rw-r--r--  0 integralist staff      666 21 Feb 14:47 testing-fastly-cli/src/[email protected]

@Integralist Integralist added the bug Something isn't working label Feb 21, 2023
// NOTE: The minimum package requirement is `fastly.toml` and `main.wasm`.
files := []string{
manifest.Filename,
"bin/main.wasm",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the default location that @fastly/js-compute will write to but it can be configured to write to any location. Should we provide a configuration option in the fastly compute build command to specify the wasm location?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We currently document the expectation that the main.wasm needs to exist inside the bin directory:

Screenshot 2023-02-21 at 14 50 12

So although it might be possible to change this, for this PR I think we're OK 👍🏻

@Integralist Integralist merged commit e2de0f0 into main Feb 21, 2023
@Integralist Integralist deleted the integralist/bug-include-source branch February 21, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants