alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
278 stars 49 forks source link

"Cannot continue with invalid session" "could not detect a session folder at current or parent locations" #1195

Closed evanescente-ondine closed 7 months ago

evanescente-ondine commented 1 year ago

How do I clean this mess ?

drm@dr-80qr ~ [1]> alr -v update -> Using default value for configuration 'distribution.disable_detection': 'FALSE' detail: Using default value for configuration 'update-manually-only': 'FALSE' error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations drm@dr-80qr ~ [1]> alr -v build -> Using default value for configuration 'distribution.disable_detection': 'FALSE' detail: Found 1 indexes detail: Loading index found at /home/drm/.config/alire/indexes/community/repo/index detail: Loading full catalog from /home/drm/.config/alire/indexes/community/repo/index detail: Using default value for configuration 'warning.old_index': 'TRUE' detail: Spawning: ["git", "branch"] > GNAT-TEMP-000001.TMP detail: Spawning: ["cat", "/etc/os-release"] > GNAT-TEMP-000002.TMP detail: Spawning: ["uname", "-m"] > GNAT-TEMP-000003.TMP detail: Using default value for configuration 'update-manually-only': 'FALSE' error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations drm@dr-80qr ~ [1]>

gnat's becoming more difficult (even download) to set up and alire doesn't seem ready for production !

alr 1.2.1 Linux dr-80qr 5.19.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 15 Sep 2022 16:08:26 +0000 x86_64 GNU/Linux

jquorning commented 1 year ago

alr update in non Alire folder errs:

error: Cannot continue with invalid session:
error:    Could not detect a session folder at current or parent locations

alr help update says:

SUMMARY
   Updates alire catalog and working release dependencies

which may be misleading.

You may be looking for alr index --update-all or alr index --reset-community

evanescente-ondine commented 1 year ago

the command doesn't return with an error status, but what about:

@.*** ~> alr edit error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations

Do I need to be in a specific folder to open gnatstudio ?

jquorning commented 1 year ago

Look like it, yes. Have you tried alr init --bin whatever; cd whatever; alr edit ?

evanescente-ondine commented 1 year ago

No, I haven't.

@. ~> alr init --bin whatever; cd essai/; alr edit Alire needs some user information to initialize the crate author and maintainer, for eventual submission to the Alire community index. This information will be interactively requested now. You can edit this information at any time with 'alr config' Please enter your GitHub login: (default: 'github-username') > Using default: 'github-username' Please enter your full name: (default: 'Your Name') > Using default: 'Your Name' Please enter your email address: (default: @.') > Using default: @.***' ✓ whatever initialized successfully. error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations

mosteo commented 1 year ago

You're still not inside the initialized whatever. Assuming that's a literal copy/paste, cd essai will fail.

evanescente-ondine commented 1 year ago

Ok, thanks I got it. I wish it would install gnatstudio on its own... Thanks.

Fabien-Chouteau commented 1 year ago

We really have to improve this error message.

rogermc2 commented 1 year ago

We really have to improve this error message.

Please do, I'm finding it extremely difficult to get far with alr as many of my efforts come up with this message which I just don't understand.

manthonyaiello commented 1 year ago

We really have to improve this error message.

git fetch outside of a git repository helpfully prints fatal: not a git repository (or any parent up to mount point /)

Perhaps Alire could say something similar? E.g., "fatal: not a crate (or any parent up to mount point /)"? And then follow up with "Perhaps you intended alr index --update-all"?

I think what threw me off the most was that alr update started out by doing something that seemed sensible (installing gnat and gprbuild). So when the error hit, I was pretty surprised.

Ptival commented 1 year ago

Ran into this error message today as a first-time user. The error message is indeed completely obscure, I had to look it up online and end up here to understand that what it really meant was "you must first set up an alr project via alr init".

jquorning commented 1 year ago

An definition of session would be nice https://en.wikipedia.org/wiki/Session_(computer_science) I guess the Alire team is open to pull requests :-) ; fear not !

mosteo commented 7 months ago

Fixed in #1390