Skip to content

Clean checkout does not build  #88

Closed

Description

@erikvullings

Hi, I wanted to try out simlin again and test it on a complex (Stella) SD model that includes sensitivity analysis, so I've forked the repo, cloned it (WSL2 Ubuntu 22.04), and ran

yarn install
yarn build

However, the build command did not complete successfully. Any suggestions what I should do?

erik@PC-28020:~/dev/simlin$ RUST_BACKTRACE=1 yarn build
yarn run v1.22.22
$ yarn patch && yarn workspaces run build
$ true

> @system-dynamics/xmutil
$ yarn clean && tsc && tsc -p tsconfig.browser.json && cp xmutil.wasm* lib/ && cp xmutil.wasm* lib.browser/ && mv lib/index_main.js lib/index.js && mv lib/index_main.js.map lib/index.js.map && mv lib/index_main.d.ts lib/index.d.ts && rm lib.browser/index_main*
$ rm -rf ./lib ./lib.browser

> @system-dynamics/engine
$ ./build.sh
    Finished `release` profile [optimized + debuginfo] target(s) in 0.04s
running wasm-bindgen
thread 'main' panicked at 'remaining data [48]', /home/erik/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-cli-support-0.2.83/src/descriptor.rs:113:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
   2: wasm_bindgen_cli_support::descriptors::execute
   3: wasm_bindgen_cli_support::Bindgen::generate_output
   4: wasm_bindgen_cli_support::Bindgen::generate
   5: wasm_bindgen::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error Command failed with exit code 101.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 101
Command: /home/erik/.nvm/versions/node/v20.8.0/bin/node
Arguments: /home/erik/.nvm/versions/node/v20.8.0/lib/node_modules/yarn/lib/cli.js run build
Directory: /home/erik/dev/simlin/src/engine
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspaces for documentation about this command.
error Command failed with exit code 101.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Activity

  1. bpowers commented on May 22, 2024

    @bpowers
    Owner

    hi Erik!

    This is a bad failure mode/error, but I believe the problem is you need a newer version of wasm-bindgen:

    $ cargo uninstall wasm-bindgen
    $ cargo install wasm-bindgen
    $ wasm-bindgen --version
    wasm-bindgen 0.2.92

    (the version after you install should be 0.2.92)

  2. erikvullings commented on May 27, 2024

    @erikvullings
    ContributorAuthor

    Hi Bobby!

    Thanks for your prompt reply and offering a fix: it worked like a charm after adding a -cli, i.e.

    $ cargo uninstall wasm-bindgen-cli
    $ cargo install wasm-bindgen-cli
    $ wasm-bindgen --version
    wasm-bindgen 0.2.92

    And I can build everything again.

    Follow-up issue: although I can build it, and start everything just fine, I still cannot login. Via the app GUI, I can create a (dummy) account, but I do not get logged in (I see the login prompt - I can try to login via Google again and select the dummy user, but still no result), and after some time (30sec?), a message appears in the backend console:

    erik@PC-28020:~/dev/simlin$ yarn start:backend
    yarn run v1.22.22
    $ yarn workspace @system-dynamics/server start:backend
    $ export FIRESTORE_EMULATOR_HOST=127.0.0.1:8092; export FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099; export GCLOUD_PROJECT=simlin; yarn build && exec node lib/index.js
    $ tsc -p tsconfig.json
    {"level":"info","message":"model-service started on http://localhost:3030","timestamp":"2024-05-27T13:47:28.878Z"}
    {"level":"info","message":"API-LINE status=401 method=\"GET\" path=\"/api/user\" duration_ms=4.3","timestamp":"2024-05-27T13:48:16.761Z"}
    {"level":"info","message":"API-LINE status=401 method=\"GET\" path=\"/api/user\" duration_ms=0.5","timestamp":"2024-05-27T13:48:28.340Z"}
    {"level":"info","message":"API-LINE status=401 method=\"GET\" path=\"/api/user\" duration_ms=0.7","timestamp":"2024-05-27T13:48:32.292Z"}
    {"level":"error","timestamp":"2024-05-27T13:49:12.991Z"}
    {"level":"info","message":"API-LINE status=500 method=\"POST\" path=\"/session\" duration_ms=44198.9","timestamp":"2024-05-27T13:49:12.992Z"}
    Error: unable to insert or find user [email protected]
        at getOrCreateUserFromProfile (/home/erik/dev/simlin/src/server/lib/authn.js:137:28)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async FirestoreAuthStrategy.verify (/home/erik/dev/simlin/src/server/lib/authn.js:143:29)
    {"level":"error","timestamp":"2024-05-27T13:49:15.432Z"}
    {"level":"info","message":"API-LINE status=500 method=\"POST\" path=\"/session\" duration_ms=42884.0","timestamp":"2024-05-27T13:49:15.433Z"}
    Error: unable to insert or find user [email protected]
        at getOrCreateUserFromProfile (/home/erik/dev/simlin/src/server/lib/authn.js:137:28)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async FirestoreAuthStrategy.verify (/home/erik/dev/simlin/src/server/lib/authn.js:143:29)

    In the console in Edge, I see the following errors:

    image

    In the firestore console, everything seems to be running fine:

    rik@PC-28020:~/dev/simlin$ yarn start:firestore
    yarn run v1.22.22
    $ (gcloud beta emulators firestore start --host-port=127.0.0.1:8092 &) && yarn workspace @system-dynamics/app run firebase emulators:start
    /bin/sh: 1: gcloud: not found
    $ /home/erik/dev/simlin/node_modules/.bin/firebase emulators:start
    i  emulators: Starting emulators: auth
    i  ui: Emulator UI logging to ui-debug.log
    
    ┌─────────────────────────────────────────────────────────────┐
    │ ✔  All emulators ready! It is now safe to connect your app. │
    │ i  View Emulator UI at http://127.0.0.1:4000/               │
    └─────────────────────────────────────────────────────────────┘
    
    ┌────────────────┬────────────────┬────────────────────────────┐
    │ Emulator       │ Host:Port      │ View in Emulator UI        │
    ├────────────────┼────────────────┼────────────────────────────┤
    │ Authentication │ 127.0.0.1:9099 │ http://127.0.0.1:4000/auth │
    └────────────────┴────────────────┴────────────────────────────┘
      Emulator Hub running at 127.0.0.1:4400
      Other reserved ports: 4500
    
    Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.

    Any suggestions on how to proceed now?

  3. erikvullings commented on May 29, 2024

    @erikvullings
    ContributorAuthor

    Hi Bobby!

    I've discovered why I could not log in. As it turns out, I also needed to install the gcloud and the firestore emulator (following this guide), a hefty install of almost 1GB.

    # Install the keyring
    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
    echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main
    
    sudo apt-get update && sudo apt-get install google-cloud-cli
    sudo apt-get install google-cloud-cli-firestore-emulator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions