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

wasm-node fails on s390x #5354

Closed
pavolloffay opened this issue Jan 22, 2024 · 7 comments
Closed

wasm-node fails on s390x #5354

pavolloffay opened this issue Jan 22, 2024 · 7 comments

Comments

@pavolloffay
Copy link
Contributor

Rollup Version

4.9.5

Operating System (or Browser)

s390x

Node Version (if applicable)

18

Link To Reproduction

jaegertracing/jaeger-ui#2119

Expected Behaviour

Be able to build jaegertracing/jaeger-ui#2119 with wasm-node s390x

e.g. docker buildx build --progress plain --platform linux/s390x --tag pavolloffay/jaeger-ui:s390x --build-arg=TARGETARCH=s390x -f ./Dockerfile .

Actual Behaviour

#9 568.4 $ NODE_ENV=production REACT_APP_VSN_STATE=$(../../scripts/get-tracking-version.js) vite build
#9 576.0 vite v5.0.11 building for production...
#9 576.5 ✓ 0 modules transformed.
#9 576.5 [vite:build-html] memory access out of bounds
#9 576.5 file: /workspace/packages/jaeger-ui/index.html
#9 576.5 error during build:
#9 576.5 RuntimeError: memory access out of bounds
#9 576.5     at wasm://wasm/0063bf96:wasm-function[1558]:0x162080
#9 576.5     at wasm://wasm/0063bf96:wasm-function[249]:0x104dc0
#9 576.5     at wasm://wasm/0063bf96:wasm-function[1442]:0x15f2f9
#9 576.5     at module.exports.xxhashBase64Url (/workspace/node_modules/rollup/dist/wasm-node/bindings_wasm.js:159:14)
#9 576.5     at getXxhash (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:16781:12)
#9 576.5     at FileEmitter.assignReferenceId (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:18266:27)
#9 576.5     at FileEmitter.emitAsset (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:18311:34)
#9 576.5     at FileEmitter.emitFile (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:18181:25)
#9 576.5     at Object.emitFile (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:17585:41)
#9 576.5     at fileToBuiltUrl (file:///workspace/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:16718:43)
#9 576.7 error Command failed with exit code 1.
#9 576.7 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#9 ERROR: process "/bin/sh -c yarn install --frozen-lockfile && cd ./packages/jaeger-ui && yarn build" did not complete successfully: exit code: 1
------
 > [4/4] RUN  yarn install --frozen-lockfile && cd ./packages/jaeger-ui && yarn build:
576.5     at wasm://wasm/0063bf96:wasm-function[1442]:0x15f2f9
576.5     at module.exports.xxhashBase64Url (/workspace/node_modules/rollup/dist/wasm-node/bindings_wasm.js:159:14)
576.5     at getXxhash (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:16781:12)
576.5     at FileEmitter.assignReferenceId (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:18266:27)
576.5     at FileEmitter.emitAsset (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:18311:34)
576.5     at FileEmitter.emitFile (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:18181:25)
576.5     at Object.emitFile (file:///workspace/node_modules/rollup/dist/es/shared/node-entry.js:17585:41)
576.5     at fileToBuiltUrl (file:///workspace/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:16718:43)
576.7 error Command failed with exit code 1.
576.7 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:7
--------------------
   5 |     COPY . .
   6 |     
   7 | >>> RUN  yarn install --frozen-lockfile && cd ./packages/jaeger-ui && yarn build
   8 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn install --frozen-lockfile && cd ./packages/jaeger-ui && yarn build" did not complete successfully: exit code: 1

More details and reproducer is in jaegertracing/jaeger-ui#2119

@pavolloffay
Copy link
Contributor Author

#5346 is a similar issue

@lukastaegert
Copy link
Member

Not sure we can do anything about it, but to make this clear, the wasm-node build of this package works when run on other platforms and only fails on s390x? That would point to a bug in the WASM implementation for this platform.

@pavolloffay
Copy link
Contributor Author

The build on ppc64le passed. Note that #5346 is running into a similar issue.

@bnordland
Copy link

I ran into a similar issue on IBM i. I'm curious if it is an issue of Big Endian vs. Little Endian?
See: mdn/content#25569
https://hacks.mozilla.org/2017/01/typedarray-or-dataview-understanding-byte-order/

@lukastaegert
Copy link
Member

Ah, those are big endian systems? That would indeed be an interesting point to investigate as I was not able to test on such a system yet. So while I thought I handled endianness efficiently and correctly, I was never able to test it. Maybe it is possible to emulate such a system for debugging?

@pavolloffay
Copy link
Contributor Author

sjd78 added a commit to sjd78/tackle2-ui that referenced this issue Mar 5, 2024
Following up on PRs konveyor#1664 and konveyor#1739, downgrade to `rollup@^3.0`.
The v4 of rollup has "native" code that runs the build, and that code
does not currently work with s390 builds [1].  Since konveyor is
built for x86, arm, ppc, and s390, all of those need to work.

When the s390 builds can work with the wasm bits, we can upgrade
to `rollup@^4.0` again.

[1] - rollup/rollup#5354

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 added a commit to konveyor/tackle2-ui that referenced this issue Mar 5, 2024
Following up on PRs #1664 and #1739, downgrade to `rollup@^3.0`. The v4
of rollup has "native" code that runs the build, and that code does not
currently work with s390 builds [1]. Since konveyor is built for x86,
arm, ppc, and s390, all of those need to work.

When the s390 builds can work with the wasm bits, we can upgrade to
`rollup@^4.0` again.

[1] - rollup/rollup#5354

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 added a commit to konveyor/tackle2-ui that referenced this issue Mar 14, 2024
Following up on PRs #1664 and #1739, downgrade to `rollup@^3.0`. The v4
of rollup has "native" code that runs the build, and that code does not
currently work with s390 builds [1]. Since konveyor is built for x86,
arm, ppc, and s390, all of those need to work.

When the s390 builds can work with the wasm bits, we can upgrade to
`rollup@^4.0` again.

[1] - rollup/rollup#5354

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 pushed a commit to konveyor/tackle2-ui that referenced this issue Mar 15, 2024
…1738)

## Summary
Refactor and enhance branding capabilities. Now branding is included
from a single directory that contains at least `strings.json`,
`manifest.json`, and `favicon.ico`. Any other assets may be placed in
the directory and will be copied to the bundled app.

Running the build as normal should show no difference.

Running the build with `BRANDING=./some-other-brand npm run start:dev`
will try to use a branding from the specified directory (that is relative to the
project's source root).

See `BRANDING.md` for more details.

Resolves: #1682

## Details
Branding changes:
  - Move Konveyor branding assets to a project top-level branding directory

  - Remove MTA branding assets

  - Remove profile/branding constants from `env` and client module

  - Embed branding strings and assets in the common module
    - `strings.json` is templated to allow the build to adjust asset URL path roots
       as necessary
    - `brandingAssetPath()`

  - server's index.html generation sources the template strings from the
    common module's branding strings

  - `HeaderApp` and `AppAboutModal` components support branding by using
    the `useBranding` hook

  - `BRANDING` as a relative path is computed from the project root

  - webpack build source branding assets directly from the common module

  - Unit tests, snapshots and jest configs updated as necessary

Jest changes:
  - Use `react-i18next` mock from `client/__mocks__` as a more robust mock
    borrowed from react-i18n repos

  - Move `setupTests.ts` into `client/src/app/test-config` to keep jest
    test config code all in the same directory

Related changes:
  - add new rollup plugins (copy, virtual)

## Downgrade to rollup v3 for multiarch builds (#1742)
As a followup on PRs #1664 and #1739, it became necessary to downgrade
back to `rollup@^3.0`. The v4 of rollup has "native" code that runs the
build, and that code does not currently work with s390 builds [1]. 

Since konveyor is built for x86, arm, ppc, and s390, all of those need to work.

When the s390 builds can work with the wasm bits, we can upgrade to
`rollup@^4.0` again.

[1] - rollup/rollup#5354

---------

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>
Co-authored-by: Ian Bolton <ibolton@redhat.com>
@pavolloffay
Copy link
Contributor Author

I am closing this. We were able to build the jaeger-ui with the native x390s jaegertracing/jaeger-ui#2160

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

No branches or pull requests

3 participants