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

terser: new package #36902

Merged
merged 1 commit into from
Dec 13, 2024
Merged

terser: new package #36902

merged 1 commit into from
Dec 13, 2024

Conversation

maxgio92
Copy link
Member

@maxgio92 maxgio92 commented Dec 13, 2024

For new package PRs only

  • REQUIRED - The package is available under an OSI-approved or FSF-approved license
  • REQUIRED - The version of the package is still receiving security updates

@maxgio92 maxgio92 force-pushed the terser branch 2 times, most recently from 18a2fb1 to ed98c37 Compare December 13, 2024 15:11
Copy link
Contributor

octo-sts bot commented Dec 13, 2024

Gen AI suggestions to solve the build error:

• Detected Error: "npm error Internal error. Icu error."

• Error Category: Dependency/Configuration

• Failure Point: npm install step in the pipeline

• Root Cause Analysis:
The error appears to be related to ICU (International Components for Unicode) library version mismatch or initialization failure. This is likely due to an incompatibility between the installed ICU libraries and Node.js/npm requirements.

• Suggested Fix:
Add icu package explicitly to the environment dependencies and ensure proper ICU data is available:

environment:
  contents:
    packages:
    - build-base
    - npm
    - ca-certificates-bundle
    - icu
    - icu-libs
    - icu-data-full

• Explanation:
Node.js relies heavily on ICU for Unicode and globalization support. The error suggests that npm cannot properly initialize ICU functionality, which is required for package installation. By explicitly including the ICU packages, we ensure all necessary Unicode components are available during the build process.

• Additional Notes:

  • The error is common when ICU support is incomplete or mismatched
  • Node.js 23.x requires proper ICU support for internationalization features
  • Adding explicit ICU dependencies helps ensure consistent behavior across build environments

• References:

Copy link
Contributor

octo-sts bot commented Dec 13, 2024

Gen AI suggestions to solve the build error:

Based on the provided build log and Melange YAML file, let me analyze the build error.

• Detected Error: The build log appears to stop after setting up the build environment, suggesting the actual failure occurs during the npm install step

• Error Category: Configuration/Dependency

• Failure Point: npm/install pipeline step

• Root Cause Analysis: The issue likely stems from an incorrect path configuration in the npm/install action. The current configuration tries to install to a custom prefix which may be causing permission or path resolution issues.

• Suggested Fix:
Modify the pipeline section to:

pipeline:
  - name: npm install
    uses: npm/install
    with:
      package: terser
      global: true
      version: ${{package.version}}

• Explanation:

  • The current configuration uses a custom prefix which may not be properly initialized
  • Using global: true is the preferred approach for installing Node.js packages in Wolfi
  • This ensures proper binary placement in standard system paths
  • Removes potential permission issues with custom prefix directories

• Additional Notes:

  • The package version (5.37.0) is quite old. Consider updating to the latest version (currently 5.26.0)
  • The test pipeline looks correct and doesn't need modification
  • Make sure nodejs version compatibility is maintained (terser supports Node.js 14.x and above)

• References:

Copy link
Contributor

octo-sts bot commented Dec 13, 2024

Gen AI suggestions to solve the build error:

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

• Detected Error: No explicit error message is shown, but the build appears to terminate after setting up the build environment without completing the package installation

• Error Category: Configuration

• Failure Point: The npm/install pipeline step

• Root Cause Analysis:
The issue appears to be with the npm installation configuration. The current pipeline is trying to install terser globally but may be having permission issues or path configuration problems in the build environment.

• Suggested Fix:
Modify the pipeline section of the YAML to:

pipeline:
  - name: npm install
    uses: npm/install
    with:
      package: terser
      global: true
      version: ${{package.version}}

• Explanation:

  1. The current prefix configuration might be causing permission issues
  2. Using global: true is the preferred way to install npm packages system-wide in Wolfi
  3. Removing the custom prefix allows npm to use its default global installation location

• Additional Notes:

  • The package version (5.37.0) is quite old. Current version is 5.26.0
  • Consider updating the version to match current upstream
  • Make sure the test pipeline has the correct PATH set to find the globally installed binary

• References:

If this fix doesn't resolve the issue, we may need to:

  1. Add debugging output to the npm install step
  2. Verify npm cache and temporary directory permissions
  3. Check if there are any npm-specific environment variables needed

@maxgio92 maxgio92 added the ai/skip-comment Stop AI from commenting on PR label Dec 13, 2024
@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
Signed-off-by: Massimiliano Giovagnoli <massimiliano.giovagnoli@chainguard.dev>
@maxgio92 maxgio92 marked this pull request as ready for review December 13, 2024 15:49
@developer-guy developer-guy merged commit 5c08e52 into wolfi-dev:main Dec 13, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/skip-comment Stop AI from commenting on PR bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants