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

[Bug box] Rebuilding after adding dependency in project with pinned crates causes bug box #1808

Open
2 tasks done
damaki opened this issue Dec 19, 2024 · 4 comments
Open
2 tasks done
Labels
type: bug Something isn't working
Milestone

Comments

@damaki
Copy link

damaki commented Dec 19, 2024

Checklist

  • I've included the output of alr version.
  • I've included complete steps to reproduce my issue.

Describe the bug
I have a project consisting of multiple crates, and since the project is unreleased I am using pins between my crates. When I added a dependency on an external library and tried to rebuild, I encountered the following Alire bug box when running alr build:

ERROR: ******************* BEGIN Alire bug detected *******************
ERROR: Location  : 0x7ff62343fdc5 Semantic_Versioning.Basic.Restrictions.First_Index at alire-solutions.adb:1543
ERROR: Extra info: No release visited in round 3
ERROR: Report at : https://github.com/alire-project/alire/issues/new?title=[Bug%20box]
ERROR: Re-run with `-vv -d` for a full log and stack trace.
ERROR: ******************** END Alire bug detected ********************

I have created a reproducer here: alr_bug.zip. See the steps below on how to reproduce.

There are four crates: A, B, C, and D. The first three are library crates, and the last (D) is an executable. The dependencies and pins between the four crates and the external crate (xoshiro in this case) are as follows:

graph LR
D[crate_d] --depends-on--> C[crate_c]
C --depends-on--> B[crate_b]
C --depends-on--> X[xoshiro]
B --depends-on--> A[crate_a]

D --pins-->C
C --pins--> B
B --pins--> A
Loading

To Reproduce
Steps to reproduce the behavior:

  1. Download and extract the reproducer: alr_bug.zip
  2. Run cd crate_d then alr build
  3. Run cd ../crate_c then alr -n with xoshiro
  4. Run cd ../crate_d then alr build
  5. See the error

The error only seems to occur when crate_d has been previously built before doing the alr with command. If I delete the crate_d/alire/ directory after the bug box occurs and then do alr build again, then the bug box goes away and it works as expected.

Expected Behavior
The dependencies are resolved and the projects are built.

alr version

APPLICATION
alr version:               2.0.2+9b80158
libalire version:          2.0.2+9b80158
compilation date:          2024-10-09 17:02:15
compiled with version:     14.2.0

CONFIGURATION
settings folder:           C:\Users\Dan\AppData\Local\alire\settings
cache folder:              C:\Users\Dan\AppData\Local\alire\cache
vault folder:              C:\Users\Dan\AppData\Local\alire\cache\releases
build folder:              C:\Users\Dan\AppData\Local\alire\cache\builds
temp folder:               C:\Users\Dan\AppData\Local\Temp
force flag:                FALSE
non-interactive flag:      FALSE
community index branch:    stable-1.3.0
compatible index versions: ^1.1 & <=1.3.0
indexes folder:            C:\Users\Dan\AppData\Local\alire\settings\indexes
indexes metadata:          OK
index #1:                  (community) git+https://github.com/alire-project/alire-index#stable-1.3.0
toolchain folder:          C:\Users\Dan\AppData\Local\alire\cache\toolchains
toolchain assistant:       disabled
tool #1 gnat:              gnat_native=14.2.1
tool #2 gprbuild:          gprbuild=22.0.1
system package manager:    not found: unknown package manager
distro detection disabled: FALSE

WORKSPACE
root status:               VALID
root release:              crate_d=0.1.0-dev
root load error:           none
root folder:               D:\projects\ada\alr_bug\crate_d
current folder:            D:\projects\ada\alr_bug\crate_d

SYSTEM
distribution:              DISTRIBUTION_UNKNOWN
host-arch:                 X86_64
os:                        WINDOWS
target:                    NATIVE
toolchain:                 USER
word-size:                 BITS_64
@mosteo
Copy link
Member

mosteo commented Dec 26, 2024

Thanks for the detailed report and reproducer.

This is likely a duplicate of #1662, could you please check if running alr update in the root crate (crate_d) before building fixes the issue?

@mosteo mosteo added the type: bug Something isn't working label Dec 26, 2024
@mosteo mosteo added this to the 2.1 milestone Dec 26, 2024
@mgrojo
Copy link
Contributor

mgrojo commented Jan 5, 2025

I reproduced this with a nested crate and a pinned dependency to ... After alr update on the nested crated, the problem disappeared.

I also wanted to point out, that the bug-box tells you to repeat the command with -vv -d but doesn't tell you the position or that they are global switches. It took me some time to get that it had to be alr -vv -d build and not alr build -vv -d.

@damaki
Copy link
Author

damaki commented Jan 5, 2025

Thanks for the detailed report and reproducer.

This is likely a duplicate of #1662, could you please check if running alr update in the root crate (crate_d) before building fixes the issue?

I just tested it and yes, running alr update before building fixes the issue.

@mosteo
Copy link
Member

mosteo commented Jan 5, 2025

the bug-box tells you to repeat the command with -vv -d but doesn't tell you the position or that they are global switches.

Fair point.

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

No branches or pull requests

3 participants