aiken-lang / aiken

A modern smart contract platform for Cardano
https://aiken-lang.org
Apache License 2.0
486 stars 98 forks source link

Error importing package published at github #1051

Closed HinsonSIDAN closed 1 week ago

HinsonSIDAN commented 3 weeks ago

Summary

I have just released a updated version of vodka at https://github.com/sidan-lab/vodka/releases/tag/0.1.4-beta. But when I try to add it to my library, it fails to build the package.

aiken.toml of importing package

Full repository at https://github.com/gimbalabs/aiken-pbl-examples.

name = "gimbalabs/aiken-pbl"
version = "0.0.0"
compiler = "v1.1.5"
plutus = "v3"
license = "Apache-2.0"
description = "Aiken contracts for project 'gimbalabs/aiken-pbl'"

[repository]
user = "gimbalabs"
project = "aiken-pbl"
platform = "github"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "v2.1.0"
source = "github"

[[dependencies]]
name = "sidan-lab/vodka"
version = "0.1.4-beta"
source = "github"

[config]

Way to reproduce

  1. Cloning repo - https://github.com/gimbalabs/aiken-pbl-examples
  2. aiken build

image

HinsonSIDAN commented 3 weeks ago

Further investigation found out that it doesn't work since last version 0.1.3-beta. Last working version is 0.1.1-beta

MicroProofs commented 2 weeks ago

Are you saying that 0.1.1-beta works with Aiken v1.1.5?

HinsonSIDAN commented 2 weeks ago

Yes, my aiken cli at version v1.1.5 works work 0.1.1-beta.

image

Meanwhile at 0.1.1-beta it specifies version of v1.1.2, not sure if that matters

image
MicroProofs commented 1 week ago

Meanwhile at 0.1.1-beta it specifies version of v1.1.2, not sure if that matters <img alt="image" width="573"

That wouldn't matter since the compiler isn't even reaching the toml file for your other versions based on your error. That makes it strange since it shouldn't work for any version if it was a compiler issue. I'll try to keep looking into it

KtorZ commented 1 week ago

The issue comes from the conflict there's between your tags 0.1.4-beta & 0.1.2-beta and branches of the same name. So when we try to download the code from GitHub, the resolution is ambiguous and the download is aborted. See here for example:

https://api.github.com/repos/sidan-lab/vodka/zipball/0.1.4-beta

This should yield an archive, but actually results in a status 300 with message:

'0.1.4-beta' has multiple possibilities: https://github.com/sidan-lab/vodka/zipball/refs/heads/0.1.4-beta, https://github.com/sidan-lab/vodka/zipball/refs/tags/0.1.4-beta
HinsonSIDAN commented 1 week ago

Thanks for your hint and investigation! The issue is resolved, it is due to the same version name, e.g. 0.1.4-beta, is used for both branch and tag names. I removed the branch after merged now the issue is resolved.

In future, should avoid same branch name as release name at first