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

Platform-dependent info in lockfiles should not be reused in other platforms, with warning about not 100% reproducibility #679

Closed
onox opened this issue Feb 4, 2021 · 3 comments
Labels
cost: 3-high Extensive/tangled changes required (<1w) type: bug Something isn't working

Comments

@onox
Copy link
Contributor

onox commented Feb 4, 2021

alr show --external libwayland shows:

Kind           Description                 Details                Available
System package 3 candidate system packages Debian: libwayland-dev True     
                                           Ubuntu: libwayland-dev          
                                           Msys2:                          
                                           Arch: wayland                   
                                           Rhel:                           
                                           Centos:                         
                                           Fedora:

but when I run alr build on Arch Linux in my crate (wayland_client_ada), I get the following output:

debug: Round 1: CHECKOUT ready libwayland=1.16.0
detail: About to deploy libwayland=1.16.0
detail: Spawning: ["pacman", "-Qq", "libwayland-dev"] > GNAT-TEMP-000003.TMP
debug: Process errored with code 1 and output: error: package 'libwayland-dev' was not found
debug: Command exited with valid code: 1
detail: Cannot find package 'libwayland-dev' in pacman installed list: 'error: package 'libwayland-dev' was not found'
The system package 'libwayland-dev' is about to be installed.

If I inspect the alire.lock file (which was created on an Ubuntu system), I see:

[solution.state.release.origin]
url = "system:libwayland-dev"

if I change it to url = "system:wayland" then the error does not occur.

Lock files are usually checked into VCS to make sure every developer uses the same set of dependencies. But Alire also supports external crates. Should Alire record all the known system packages of the crate in the lock file and choose the one using the current OS and distribution? And what should be done about the version field? (Ubuntu 18.04 has 1.16 while Arch has 1.18 for libwayland -- alire.toml contains libwayland = "^1.16").

@mosteo
Copy link
Member

mosteo commented Feb 4, 2021

You have a knack for hitting sticky points :) Currently, lockfiles store platform-dependent info when there are system crates in the solution. We should discard any platform-dependent info in the lockfile that belongs to another platform, and warn that the build is not exactly the one the packager intended. I'm renaming this issue to better reflect the root of the problem.

(I'm presuming we're talking about executable crates, where committing the lockfile makes sense. Dependencies' lockfiles are ignored.)

BTW, what happens if you run alr update with the original lockfile?

Should Alire record all the known system packages of the crate in the lock file and choose the one using the current OS and distribution?

I don't think this is practical, as developers won't typically have all platforms available to incrementally solve and "complete" the lockfile. It could done though, if there is interest from packagers to give a subset of tested platforms in the lockfile.

@mosteo mosteo changed the title alr build chooses external crate of wrong distribution Platform-dependent info in lockfiles should not be reused in other platforms, with warning about not 100% reproducibility Feb 4, 2021
@mosteo mosteo added cost: 2-medium Moderate/isolated changes required (<1d) type: bug Something isn't working labels Feb 4, 2021
@onox
Copy link
Contributor Author

onox commented Feb 4, 2021

BTW, what happens if you run alr update with the original lockfile?

Then alr asks whether I want to change to libwayland 1.18.0 and changes alire.lock to contain url = "system:wayland", which fixes the issue.

@mosteo
Copy link
Member

mosteo commented Feb 4, 2021

OK, thanks. I wanted to confirm that an explicit update would fix the lockfile.

@mosteo mosteo added cost: 3-high Extensive/tangled changes required (<1w) and removed cost: 2-medium Moderate/isolated changes required (<1d) labels May 10, 2021
@onox onox closed this as completed Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cost: 3-high Extensive/tangled changes required (<1w) type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants