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

pinning a crate in a remote monorepo (i.e., using --use=URL) does not setup GPR_PROJECT_PATH #1552

Open
dalybrown opened this issue Jan 30, 2024 · 3 comments · May be fixed by #1683
Open

pinning a crate in a remote monorepo (i.e., using --use=URL) does not setup GPR_PROJECT_PATH #1552

dalybrown opened this issue Jan 30, 2024 · 3 comments · May be fixed by #1683
Labels
type: bug Something isn't working
Milestone

Comments

@dalybrown
Copy link
Contributor

I'm not sure if the existing behaviour is intended or not.

When pinning to a remote create in a monorepo, you can provide the URL and the crate name and Alire will add the dependency. However, when you examine the environment of the enclosing crate, the GPR_PROJECT_PATH is set to the root of the monorepo, not to the root of the crate within the monorepo. Consequently, the build will not find the dependency's project file.

For example, if this is the folder structure of the remote repo:

/monorepo/dependency/alire.toml
/monorepo/dependency/project.gpr

Then when you pin the dependency crate, the GPR_PROJECT_PATH is set to /monorepo, not /monorepo/dependency.

I can update the alire.toml environment to add the path, but I think it should probably be done automatically.

@dalybrown dalybrown changed the title pinning a create in a remote monorepo (i.e., using --use=URL) does not setup GPR_PROJECT_PATH pinning a crate in a remote monorepo (i.e., using --use=URL) does not setup GPR_PROJECT_PATH Feb 1, 2024
@mosteo mosteo added the type: bug Something isn't working label Feb 8, 2024
@mosteo mosteo added this to the 2.1 milestone Feb 8, 2024
@mosteo
Copy link
Member

mosteo commented Feb 8, 2024

Yes, this should work for pins just as it works for regular dependencies. Thanks for the report.

The root cause will likely be that for regular dependencies we rely on the origin info from the index, that is not used for pins (we rely on their local manifests), and I don't think from memory that we are using any origin info in that case.

@dalybrown
Copy link
Contributor Author

Have you worked on this yet? I might have some time to poke away at it over the next few weeks. Let me know.

@mosteo
Copy link
Member

mosteo commented Feb 19, 2024

Not yet, go ahead.

@dalybrown dalybrown linked a pull request May 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants