Pswish week7 - TheEvergreenStateCollege/upper-division-cs-23-24 GitHub Wiki
Today, 13 May 2024. I embarked on building the wasm-game-of-life
before starting, i had to troubleshoot why apt update
wasn't working locally on ubuntu.
I added these to my /etc/apt/source.list
deb http://archive.ubuntu.com/ubuntu $(lsb_release -* * sc) main restricted
β¨deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-updates main restrictedβ¨
deb http://security.ubuntu.com/ubuntu $(lsb_release -sc)-security main restricted
Run : sudo apt update
Run : sudo apt install build-essential
Run : sudo apt install pkg-config
Run : cargo install cargo-generate
Run : cargo generate --git https://github.com/rustwasm/wasm-pack-template
Project Name: pswish-game_of_life
I didn't make it all the way through hello wold successfully.
I had issues getting the package.json to appear during the build step: wasm-pack build
. I manually created the package.json and moved on.
I progressed all the way to: npm run start but the error i received was missing node-packages so I knew some of the npm install stuff didn't work correctly so I figure this is related to the common errors encountered in class.
I figured it was time to track down bugs as well, as I noticed some disconnect with my custom naming convention so I decided to start fresh and restore the default normal naming convention which meant starting the guide over. With only 20 minutes left in class, i was able to reproduce my missing package.json error. so more checking is needed. I also noticed that when i run the wasm-pack build
, it removes the package.json from the pkg/ directory.
Here is my node version:
β node -v
v20.11.0
Rust: 1.78.0
β rustup -v
verbose: read metadata version: '12'
rustup 1.27.1 (54dd3d00f 2024-04-24)
Compiling wasm-game-of-life v0.1.0 (/home/ubuntu/Workspace/upper-division-cs/sc-24sp/assignments/pswish-sc/game-of-life2/wasm-game-of-life)
warning: function `set_panic_hook` is never used
--> src/utils.rs:1:8
|
1 | pub fn set_panic_hook() {
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Here is the warnings from the build output:
warning: `wasm-game-of-life` (lib) generated 1 warning
Finished `release` profile [optimized] target(s) in 8.34s
[INFO]: β¬οΈ Installing wasm-bindgen...
Error: failed to download from https://github.com/WebAssembly/binaryen/releases/download/version_111/binaryen-version_111-x86_64-linux.tar.gz
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
Caused by: failed to download from https://github.com/WebAssembly/binaryen/releases/download/version_111/binaryen-version_111-x86_64-linux.tar.gz
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
they didn't look important enough for the current state to track down.
For Round 2, here is where the build step missed the package ubuntu in upper-division-cs/sc-24sp/assignments/pswish-sc/game-of-life2/wasm-game-of-life at ip-172-31-1-136 on ξ pswish-week6 [$!?] is π¦ 0.1.0 via π¦ 1.78.0 β¦ β tree .
βββ Cargo.lock
βββ Cargo.toml
βββ LICENSE_APACHE
βββ LICENSE_MIT
βββ README.md
βββ pkg
β βββ wasm_game_of_life.d.ts
β βββ wasm_game_of_life.js
β βββ wasm_game_of_life_bg.js
β βββ wasm_game_of_life_bg.wasm
β βββ wasm_game_of_life_bg.wasm.d.ts
βββ src
β βββ lib.rs
β βββ utils.rs
βββ target
β βββ CACHEDIR.TAG
β βββ release
β β βββ build
β β β βββ proc-macro2-0940ada6172e5625
β β β β βββ invoked.timestamp
β β β β βββ out
β β β β β βββ proc_macro2.d
β β β β βββ output
β β β β βββ root-output
β β β β βββ stderr
β β β βββ proc-macro2-5a1e983aa966ac14
β β β β βββ build-script-build
β β β β βββ build_script_build-5a1e983aa966ac14
β β β β βββ build_script_build-5a1e983aa966ac14.d
β β β βββ wasm-bindgen-b735310bfeb45894
β β β β βββ build-script-build
β β β β βββ build_script_build-b735310bfeb45894
β β β β βββ build_script_build-b735310bfeb45894.d
β β β βββ wasm-bindgen-shared-113a2b2dbcba8f61
β β β β βββ invoked.timestamp
β β β β βββ out
β β β β βββ output
β β β β βββ root-output
β β β β βββ stderr
β β β βββ wasm-bindgen-shared-e36f3c6d308317a4
β β β βββ build-script-build
β β β βββ build_script_build-e36f3c6d308317a4
β β β βββ build_script_build-e36f3c6d308317a4.d
β β βββ deps
β β β βββ bumpalo-ef4f5ca44de48188.d
β β β βββ libbumpalo-ef4f5ca44de48188.rlib
β β β βββ libbumpalo-ef4f5ca44de48188.rmeta
β β β βββ liblog-4bd01053f5d669d0.rlib
β β β βββ liblog-4bd01053f5d669d0.rmeta
β β β βββ libonce_cell-d1fa5defe1046ec3.rlib
β β β βββ libonce_cell-d1fa5defe1046ec3.rmeta
β β β βββ libproc_macro2-793d24cc9432c2ac.rlib
β β β βββ libproc_macro2-793d24cc9432c2ac.rmeta
β β β βββ libquote-3cce769df9c53041.rlib
β β β βββ libquote-3cce769df9c53041.rmeta
β β β βββ libsyn-f3ad57d99bd63c38.rlib
β β β βββ libsyn-f3ad57d99bd63c38.rmeta
β β β βββ libunicode_ident-0ca6ee852c4f2b7d.rlib
β β β βββ libunicode_ident-0ca6ee852c4f2b7d.rmeta
β β β βββ libwasm_bindgen_backend-82b8087b3e6c31b4.rlib
β β β βββ libwasm_bindgen_backend-82b8087b3e6c31b4.rmeta
β β β βββ libwasm_bindgen_macro-a3be4812cecfe1d3.so
β β β βββ libwasm_bindgen_macro_support-7457a02e77f0bd25.rlib
β β β βββ libwasm_bindgen_macro_support-7457a02e77f0bd25.rmeta
β β β βββ libwasm_bindgen_shared-211b253108fb9041.rlib
β β β βββ libwasm_bindgen_shared-211b253108fb9041.rmeta
β β β βββ log-4bd01053f5d669d0.d
β β β βββ once_cell-d1fa5defe1046ec3.d
β β β βββ proc_macro2-793d24cc9432c2ac.d
β β β βββ quote-3cce769df9c53041.d
β β β βββ syn-f3ad57d99bd63c38.d
β β β βββ unicode_ident-0ca6ee852c4f2b7d.d
β β β βββ wasm_bindgen_backend-82b8087b3e6c31b4.d
β β β βββ wasm_bindgen_macro-a3be4812cecfe1d3.d
β β β βββ wasm_bindgen_macro_support-7457a02e77f0bd25.d
β β β βββ wasm_bindgen_shared-211b253108fb9041.d
β β βββ examples
β β βββ incremental
β βββ wasm32-unknown-unknown
β βββ CACHEDIR.TAG
β βββ release
β βββ build
β β βββ wasm-bindgen-23391f03dfcddf87
β β βββ invoked.timestamp
β β βββ out
β β βββ output
β β βββ root-output
β β βββ stderr
β βββ deps
β β βββ cfg_if-eb1887cd077d37ae.d
β β βββ console_error_panic_hook-687e96ccba4b2a44.d
β β βββ libcfg_if-eb1887cd077d37ae.rlib
β β βββ libcfg_if-eb1887cd077d37ae.rmeta
β β βββ libconsole_error_panic_hook-687e96ccba4b2a44.rlib
β β βββ libconsole_error_panic_hook-687e96ccba4b2a44.rmeta
β β βββ libwasm_bindgen-0cd01c8bbdcdc1b8.rlib
β β βββ libwasm_bindgen-0cd01c8bbdcdc1b8.rmeta
β β βββ libwasm_game_of_life.rlib
β β βββ wasm_bindgen-0cd01c8bbdcdc1b8.d
β β βββ wasm_game_of_life.d
β β βββ wasm_game_of_life.wasm
β βββ examples
β βββ incremental
β βββ libwasm_game_of_life.d
β βββ libwasm_game_of_life.rlib
β βββ wasm_game_of_life.d
β βββ wasm_game_of_life.wasm
βββ tests
βββ web.rs
24 directories, 85 files
Next up, i ran through the setup steps in this wiki: https://github.com/TheEvergreenStateCollege/upper-division-cs/wiki/SC%E2%80%90Homework%E2%80%9007
I switched to node version 14 and tried proceeding.
I went through the tutorial again and made it back to npm start
. I ran into a missing the package.json again so i went to the /pkg/ directory and ran npm init
. I ran npm install
again and this time, that command worked since i didn't have npm setup properly before in the previous attempts.
I changed back to the www directory and ran:
ubuntu in www at ip-172-31-1-136 on ξ master via β¬’ v14.21.3 β¦
β npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 587 packages from 362 contributors and audited 655 packages in 14.065s
18 packages are looking for funding
run `npm fund` for details
found 149 vulnerabilities (11 low, 44 moderate, 74 high, 20 critical)
run `npm audit fix` to fix them, or `npm audit` for details
ubuntu in www at ip-172-31-1-136 on ξ master via β¬’ v14.21.3 took 14.9s β¦
β npm install
npm ERR! code ENOLOCAL
npm ERR! Could not install from "../pkg" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2024-05-13T22_48_29_057Z-debug.log
ubuntu in www at ip-172-31-1-136 on ξ master [!] via β¬’ v14.21.3 took 2.7s β¦
β npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 1 package in 4.494s
18 packages are looking for funding
run `npm fund` for details
ubuntu in www at ip-172-31-1-136 on ξ master [!] via β¬’ v14.21.3 took 5.3s β¦
β npm start
> [email protected] start /home/ubuntu/Workspace/upper-division-cs/sc-24sp/assignments/pswish-sc/game-of-life3/wasm-game-of-life/www
> webpack-dev-server
βΉ ο½’wdsο½£: Project is running at http://localhost:8080/
βΉ ο½’wdsο½£: webpack output is served from /
βΉ ο½’wdsο½£: Content not from webpack is served from /home/ubuntu/Workspace/upper-division-cs/sc-24sp/assignments/pswish-sc/game-of-life3/wasm-game-of-life/www
βΉ ο½’wdmο½£: Hash: 79e415562a0715ee6010
Version: webpack 4.43.0
Time: 683ms
Built at: 05/13/2024 10:49:37 PM
Asset Size Chunks Chunk Names
0.bootstrap.js 5.85 KiB 0 [emitted]
bootstrap.js 369 KiB main [emitted] main
ce37dcc1211ed0221a13.module.wasm 17.8 KiB 0 [emitted] [immutable]
index.html 297 bytes [emitted]
Entrypoint main = bootstrap.js
[0] multi (webpack)-dev-server/client?http://localhost:8080 ./bootstrap.js 40 bytes {main} [built]
[../pkg/wasm_game_of_life.js] 178 bytes {0} [built]
[./bootstrap.js] 279 bytes {main} [built]
[./index.js] 58 bytes {0} [built]
[./node_modules/ansi-html/index.js] 4.16 KiB {main} [built]
[./node_modules/ansi-regex/index.js] 135 bytes {main} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:8080] (webpack)-dev-server/client?http://localhost:8080 4.29 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {main} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {main} [built]
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {main} [built]
+ 23 hidden modules
βΉ ο½’wdmο½£: Compiled successfully.