As a new Alire user - it's not clear to me how to go from:
$ alr init --lib my_lib
$ alr init --bin my_bin
...to actually being able to use my_lib
in my_bin
. Reading publishing.md, I can see that I need to run:
$ alr publish --tar
Publishing assistant: step 1 of 8: Verify user manifest
The release to be published contains this information:
my_lib=0.1.0-dev: Shiny new project
[...]
Do you want to proceed with this information?
[Y] Yes [N] No (default is No) y
Publishing assistant: step 2 of 8: Prepare remote source archive
warn: Not in a git repository, assuming plain sources.
β Source archive created successfully.
Please upload the archive generated at alire/archives/my_lib-0.1.0-dev.tbz2 to its definitive online storage location.
Once you have uploaded the file, enter its URL:
Enter URL> https://example.com/my_lib-0.1.0-dev.tbz2
The URL is: https://example.com/my_lib-0.1.0-dev.tbz2
Is this information correct?
[Y] Yes [N] No (default is Yes) Y
Publishing assistant: step 3 of 8: Verify origin URL
β Origin is of supported kind: SOURCE_ARCHIVE
Publishing assistant: step 4 of 8: Verify GitHub infrastructure
β User has a GitHub account: player1
error: You must fork the community index to your GitHub account:
error: Please visit https://github.com/alire-project/alire-index and fork the repository.
..but I do not want to use GitHub for a newly created and in development library.
To just try and make something work locally - I was able to take the alire.toml
from my_lib
, renamed it to my_lib-0.1.0-dev.toml
and gave it a fake [origin]
section. I then placed it in a local index with the layout of the community index, and run:
$ alr index --add file:///home/user/local-alire/ --name local
It doesn't seem to have copied a file across though:
$ alr with my_lib
Requested changes:
β my_lib ~0.1.0-dev (add)
Changes to dependency solution:
+ my_lib 0.1.0-dev (new)
Do you want to proceed?
[Y] Yes [N] No (default is Yes) y
β Deploying my_lib=0.1.0-dev...
$ alr build
β Building my_bin/my_bin.gpr...
my_bin_config.gpr:2:06: unknown project file: "my_lib.gpr"
my_bin_config.gpr:2:06: imported by "/home/user/ada/my_bin/config/my_bin_config.gpr"
my_bin_config.gpr:2:06: imported by "/home/user/ada/my_bin/my_bin.gpr"
gprbuild: "/home/user/ada/my_bin/my_bin.gpr" processing failed
$ cp ../my_lib/my_lib.gpr . # I knew this wouldn't work but thought to try anyway
$ alr build
β Building my_bin/my_bin.gpr...
Setup
[mkdir] object directory for project My_Lib
[mkdir] library directory for project My_Lib
[mkdir] object directory for project My_Bin
[mkdir] exec directory for project My_Bin
my_bin.gpr:2:09: unit "my_bin" cannot belong to several projects
my_bin.gpr:2:09: project "my_bin", "/home/user/ada/my_bin/src/my_bin.adb"
my_bin.gpr:2:09: project "my_lib", "/home/user/ada/my_bin/src/my_bin.adb"
my_bin.gpr:2:09: unit "my_bin_config" cannot belong to several projects
my_bin.gpr:2:09: project "my_bin", "/home/user/ada/my_bin/config/my_bin_config.ads"
my_bin.gpr:2:09: project "my_lib", "/home/user/ada/my_bin/config/my_bin_config.ads"
my_bin.gpr:2:09: warning: there are no sources of language "Ada" in this project
gprbuild: "/home/user/ada/my_bin/my_bin.gpr" processing failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/user/ada/my_bin/my_bin.gpr"] exited with code 4
error: Compilation failed.
Ideally, I think I'd just like to be able to do:
$ alr init --lib my_lib
$ alr init --bin my_bin
$ cd my_bin
$ alr with ../my_lib
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too