-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: follow symlinks once when counting classes #452
base: main
Are you sure you want to change the base?
feat: follow symlinks once when counting classes #452
Conversation
- follow once for now to avoid potential infinite loops, in case there is circular linking - problem statement: we have a use case where the final class count needs to include the classes in the targets of the symlinks
Can you expand on this? Is there a scenario you can walk me through to explain how that's possible? Also, as a side note/FYI. We are in the middle of building out v2 of our libraries and new feature work is slated to go into v2 releases, not v1 releases. This may result in a longer than normal delay before new feature work can be incorporated. |
Yes. Essentially, we are trying to make the bellsoft-liberica buildpack work within the context of a different directory structure, as in different from the directory structure of an oci image (which the buildpack today assumes). To bridge those discrepancies in directory structures, we created various symlinks in our context, and the buildpack will follow those symlinks and arrive at the correct targets, except for the helper being modified in this PR. |
Not sure I follow, sorry. What directory structure are you referring to? The contents of an OCI image can literally be from nothing to anything. Are you referring to some of the buildpack directory structures? or Java/Spring directory structures? |
So reading the various symlinks / env var defaults in the buildpack today, it's assuming a directory structure like this:
Which is the directory structure of a docker container run with an OCI image built by the buildpack. An example of such an assumption is that I can see the following symlinks inside of the said docker container's
Where the targets of those links are absolute paths, assuming that there is a So we are trying to make the buildpack work (including making those symlinks work) on a different directory structure (where there is certain limitation that does not allow us to structure it like the docker container). To bridge this gap, we created various symlinks, something like:
This mostly works, with the exception of the class counting. |
I'm hesitant here because a lot of what you're describing sounds like it could/should be done in other ways. Most of those locations you've mentioned can be defined by a platform, and it sounds like you're making a custom platform, so rather than use symlinks to bend things around, the platform should arguably be invoking the lifecycle commands and pointing directly to where it is putting things. For example, there are flags for changing the layers, workspace, and platform directories. I'm not totally certain about Have you looked at those options? |
Yeah, I understand your hesitancy. We are also just exploring various options and have not decided on the long term path. But I can explain why we are trying this currently. So far, we can indeed set some of those vars to tell the buildpack what our true directories are:
This works mostly, with these exceptions:
|
That sounds like a bug to me. The buildpack shouldn't be assuming
I don't think that's us, I think that's upstream. You might try reaching out on https://github.com/buildpacks/lifecycle or on Buildpacks Slack and asking about |
Actually, I'll look into this more before saying it's a bug. I neglected to mention that our intention is to build the app oci image with the buildpack for the normal docker platform, aka with these settings during build:
And then have the resulting image not only be runnable with docker but also (with some modifications) be runnable on our platform. So maybe the buildpack would have correctly set |
Summary
Use Cases
Checklist