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

Bugfix/alternative package-id #338

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

SimonErm
Copy link
Contributor

Summary

This PR fixes an issue which occures while building a repo with workspaces.
Without this changes the builds fail with

[builder] unable to invoke layer creator
[builder] unable to contribute application layer
[builder] unable to fetch members
[builder] unable to parse: unable to parse workspace member [path+file:///workspace/services/example-store#0.1.0], missing `@`
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

because if the folder of the workspace is named like the workspace-member the package-id is slightly different.
(Example 3 in https://doc.rust-lang.org/cargo/reference/pkgid-spec.html#example-specifications under Local packages )
An example for member with a different folder name and one example for a member with the same name as the folder:

  "workspace_members": [
    "path+file:///Users/jondoe/.../services/example-store#[email protected]",
    "path+file:///Users/jondoe/.../services/example-transform#0.1.0"
  ],

Use Cases

Fixing workspace builds

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@SimonErm SimonErm requested a review from a team as a code owner January 20, 2025 19:50
@SimonErm SimonErm changed the title Bugfix/alternative package Bugfix/alternative package-id Jan 20, 2025
@dmikusa
Copy link
Contributor

dmikusa commented Jan 21, 2025

Looks good. Thanks for raising this up & sending a PR!

Could you update this comment and include the additional condition? Something like ...

// parseWorkspaceMember parses a workspace member which can be in a few of different formats
//
//	pre-1.77: `package-name package-version (url)`, like `function 0.1.0 (path+file:///Users/dmikusa/Downloads/fn-rs)`
//	1.77+: 
//          - `url#package-name@package-version` like `path+file:///Users/dmikusa/Downloads/fn-rs#[email protected]`
//          - `url#version` for local packages like `path+file:///Users/jondoe/.../services/example-transform#0.1.0`
//
// The final directory is assumed to be the package name with the local package format.
//
// returns the package name, version, URL, and optional error in that order

@dmikusa dmikusa added semver:patch A change requiring a patch version bump type:bug A general bug labels Jan 21, 2025
@dmikusa dmikusa merged commit 41c2007 into paketo-community:main Jan 22, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants