8

I have a module App::Assixt, to which I've recently made a relatively large change. I've of course tested it on my local system, but would like to give it some field testing before calling it a "stable release".

Is there a way to "tag" this release as an "alpha", or "release-candidate", so this release will only be installed by people who have opted to use unstable/testing releases?

Tyil
  • 1,797
  • 9
  • 14
  • I don't think there's a way to add some kind of metadata to make this clear. You can of course change the version and add something that conventionally indicates it's a pre-release, but that's it. – jjmerelo Aug 27 '18 at 15:58
  • For a pre-release, just tag in git and have beta testers check it out and `zef install .` within the checked out source. – Curt Tilmes Aug 27 '18 at 22:22

1 Answers1

3

zef will treat versions the same as Raku:

# true because "1.0.a" < "1.0.0"
$ raku -e 'say Version.new("1.0.PREVIEW") < Version.new("1.0")'
True

If a Foo:ver<1.0.PREVIEW> is installed it can be used as Foo:ver<1.0.PREVIEW> or Foo:ver<1.0>. This means any systems that have Foo:ver<1.0.PREVIEW> installed would need to uninstall it to upgrade / install Foo:ver<1.0> in the future ( unless using --force-install ), but also that authors can write code for the final version without declaring the extra .PREVIEW everywhere.

This is not very useful in regards to publishing -- zef will grab the newest version by default despite the user not having opted in to whatever versioning scheme is in use. Since the user wants to opt-in for this, there are two options.


1) Create e.g. unstable, testing, stable` indexes and convince people to use them

This could be done by copying the zef config to %*ENV<XDG_CONFIG_HOME>/zef/config.json and incorporate the following:

"Repository" : [
    {
        "short-name" : "unstable",
        "enabled" : 0,
        "module" : "Zef::Repository::Ecosystems",
        "options" : {
            "name" : "unstable",
            "mirrors" : [ "/path/or/url/to/package/list.json" ]
        }
    }
]

Which allows:

zef install Foo::Bar --unstable

2) Give out a link to the resource without publishing it

zef install https://github.com/ugexe/Raku-Text--Table--Simple.git@v0.0.4
zef install https://github.com/ugexe/Raku-Text--Table--Simple/archive/v0.0.3.zip
ugexe
  • 5,297
  • 1
  • 28
  • 49
  • 1
    I'm sure I'm being dense but... I'm confused about "This means any systems that have `Foo:ver<1.0.PREVIEW>` installed would need to uninstall it to upgrade / install `Foo:ver<1.0>` in the future" The behavior that installing a prerelease stops progression to final release without doing something special confuses me, in isolation from all else. Especially given a (overly?) simple reading of "zef will grab the newest version by default". (To try understand, I reread the explanation you provided around the first sentence I've quoted then reread zef's README (which all seems perfectly cromulent).) – raiph Aug 30 '18 at 10:54
  • Because if `Foo:ver<1.0.PREVIEW>` is installed then `perl6 -e '$*REPO.resolve(CompUnit::DependencySpecification.new(:short-name, :ver<1.0>))'` will also return a match. Thus it is considered already installed before any possible version comparison, requiring the user to be explicit that they know what they are doing ( `--force install` etc ). A version check should not be done by an application on the result of `$*REPO.resolve(...)` because there are nyi things such as e.g. `emulates`, `supercedes` that only the CUR itself will be able to identify as installed for a given query. – ugexe Aug 30 '18 at 19:52
  • Sorry for being dense but I'm still confused. Do you agree that the following three statements, the second of which is a purposefully edited version of something you've written, and the third of which quotes something you've written, can't all be true? 1) A module with version `v1.0` is likely newer than a version `v1.0.PREVIEW`. 2) if `Foo:ver<1.0.PREVIEW>` is installed then ... `v1.0` ... is considered already installed; 3) "zef will grab the newest version by default". Is my edit of what you said invalid? Where's the best doc about this? I've explored zef's repo, S22, etc. but none helped. – raiph Aug 30 '18 at 21:16