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

teleport/17.0.5 package update #36438

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Dec 11, 2024

@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr P1 This label indicates our scanning found High, Medium or Low CVEs for these packages. labels Dec 11, 2024
Copy link
Contributor Author

octo-sts bot commented Dec 11, 2024

Gen AI suggestions to solve the build error:

Based on the error output, I'll analyze and provide specific fixes:

• Detected Error:

[wasm-validator error in function fastpathprocessor_process\20externref\20shim] unexpected false: table.fill requires bulk-memory [--enable-bulk-memory]

• Error Category: Build Configuration

• Failure Point: WASM optimization step during web assets compilation

• Root Cause Analysis:
The wasm-opt tool is failing because bulk-memory operations are not enabled. This is a feature flag issue with the WASM compilation process.

• Suggested Fix:

  1. Add the following to the Cargo.toml in the ironrdp directory:
[package.metadata.wasm-pack.profile.release]
wasm-opt = false

Or alternatively, add these flags to the wasm-pack build command in the pipeline:

  - runs: |
      RUST_MIN_STACK=16777216 wasm-pack build ./src/ironrdp --target web -- --features bulk-memory

• Explanation:
The error occurs because newer WASM features like bulk-memory operations are being used but not properly enabled during compilation. Either disabling wasm-opt or explicitly enabling bulk-memory features should resolve the compilation error.

• Additional Notes:

  • This is a common issue when working with newer WASM features and optimization tools
  • Disabling wasm-opt may slightly increase the final WASM binary size
  • If optimization is important, using the feature flag approach is preferred

• References:

@hbh7 hbh7 self-assigned this Dec 12, 2024
Copy link
Contributor Author

octo-sts bot commented Dec 12, 2024

Gen AI suggestions to solve the build error:

Based on the error output, let me analyze and provide a solution:

• Detected Error:

RangeError: Internal error. Icu error.
    at String.localeCompare (<anonymous>)
    at sortTranspositions (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:62969:33)

• Error Category: Dependency/Configuration

• Failure Point: pnpm execution during the make ensure-js-deps step

• Root Cause Analysis:
The error occurs due to an ICU (International Components for Unicode) locale handling issue with Node.js 23.4.0 and pnpm. This is likely caused by incomplete or incorrect ICU data configuration in the build environment.

• Suggested Fix:
Modify the environment section of the melange YAML to include specific ICU packages and downgrade Node.js:

environment:
  contents:
    packages:
      # Existing packages...
      - icu-libs
      - icu-data-full
      - nodejs-20    # Use Node.js 20 instead of 23
      # Rest of existing packages...

• Explanation:

  • Node.js 23 is relatively new and may have stability issues with some tools
  • The ICU error suggests locale handling problems which are better supported in Node.js LTS versions
  • Node.js 20 is the current LTS version with better stability for build tools
  • Explicit inclusion of ICU packages ensures proper locale support

• Additional Notes:

  • This is a known issue when using newer Node.js versions with package managers
  • The fix maintains build stability while ensuring all required dependencies are available
  • Consider adding LC_ALL=C.UTF-8 and LANG=C.UTF-8 to the environment if issues persist

• References:

Copy link
Contributor Author

octo-sts bot commented Dec 13, 2024

Gen AI suggestions to solve the build error:

Let me analyze this build error and provide a solution.

• Detected Error: "[wasm-validator error in function fastpathprocessor_process\20externref\20shim] unexpected false: table.fill requires bulk-memory [--enable-bulk-memory]"

• Error Category: Build Configuration

• Failure Point: WASM optimization step during web assets compilation for Teleport UI

• Root Cause Analysis: The wasm-opt tool is failing because bulk memory operations are not enabled, but the compiled WASM code requires this feature. This is a configuration mismatch between the WASM compilation settings and the optimizer.

• Suggested Fix:

  1. Add the following to the [package.metadata.wasm-pack.profile.release] section in the web/packages/teleport/src/ironrdp/Cargo.toml:
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-bulk-memory"]

Or alternatively, disable wasm-opt temporarily:

[package.metadata.wasm-pack.profile.release]
wasm-opt = false

• Explanation: The error occurs because the WASM code uses table.fill operations which require bulk memory support. The fix either enables bulk memory operations during optimization or disables the optimization step altogether to prevent the error.

• Additional Notes:

  • This is a common issue when working with newer WASM features
  • The bulk memory proposal is now standardized but needs explicit enabling
  • Disabling wasm-opt is a temporary workaround if needed, but enabling bulk memory is preferred
  • This affects performance optimization but not functionality

• References:

The fix ensures the WASM optimization step has the correct feature flags enabled for the code being generated, allowing the build to complete successfully.

Copy link
Contributor Author

octo-sts bot commented Dec 13, 2024

Gen AI suggestions to solve the build error:

Based on the error output, I'll analyze and provide specific fixes:

• Detected Error:

[wasm-validator error in function fastpathprocessor_process\20externref\20shim] unexpected false: table.fill requires bulk-memory [--enable-bulk-memory]

• Error Category: Build Configuration

• Failure Point: WASM compilation during the web assets build step, specifically during wasm-opt optimization

• Root Cause Analysis:
The wasm-opt tool is failing because bulk-memory operations are not enabled, but are required by the compiled WASM module. This is a feature flag issue with the WASM toolchain.

• Suggested Fix:
Add the following to the Rust package's Cargo.toml in the web/packages/teleport/src/ironrdp directory:

[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-bulk-memory"]

# Alternatively, if that doesn't work, disable wasm-opt:
[package.metadata]
wasm-opt = false

• Explanation:
The error occurs because newer WASM features like bulk memory operations require explicit enabling. The fix either properly configures wasm-opt with the required feature flag or disables the optimization step entirely, allowing the build to complete.

• Additional Notes:

  1. This is a common issue when building WASM modules with newer features
  2. Disabling wasm-opt is a fallback solution that may impact performance
  3. The bulk-memory feature is part of the WASM specification and is supported by modern browsers

• References:

If disabling wasm-opt is not acceptable for performance reasons, you may need to:

  1. Update binaryen/wasm-opt to a newer version
  2. Explicitly enable bulk-memory features in the build toolchain
  3. Consider alternative WASM optimization strategies

@hbh7
Copy link
Member

hbh7 commented Dec 13, 2024

Found an upstream ticket opened, going to do the same patch gravitational/teleport#50194

@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Dec 13, 2024
@hbh7 hbh7 requested a review from a team December 13, 2024 19:46
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a comment about what the purpose of this patch is, why we need it in our build, and if/when we'll no longer need it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. manual/review-needed P1 This label indicates our scanning found High, Medium or Low CVEs for these packages. request-version-update request for a newer version of a package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants