unison icon indicating copy to clipboard operation
unison copied to clipboard

New build has version `unknown`

Open ndearns opened this issue 3 months ago • 7 comments

~/P/unison (master) [i] ⋊> ucm

Now starting the Unison Codebase Manager (UCM)...


| | |||_ ___ ___ | | | | |_ -| . | | |||||||||

👋 Welcome to Unison!

You are running version: unknown

📚 Read the official docs at https://www.unison-lang.org/docs/

Hint: Type 'projects' to list all your projects, or 'project.create' to start something new.

wordle/main>

Fresh build an hour ago from the `Download Zip' file.

ndearns avatar Sep 25 '25 16:09 ndearns

That would be coming from this code.

What does git describe --tags --always --dirty="'" return on your system? I wonder if it can't find git on the path or if you have cloned the repo without pulling its tags or something.

ceedubs avatar Sep 25 '25 17:09 ceedubs

Possibly downloaded unison release source ~~.zip~~ tarball?

aryairani avatar Sep 26 '25 02:09 aryairani

Oh I assumed that this was built from source. @ndearns can you please specify how you obtained this version of ucm?

ceedubs avatar Sep 26 '25 13:09 ceedubs

From the main unison page, I picked the Code drop down and grabbed the 'Download Zip' file. This expands into a 'unison-trunk' directory. I went into that and did the 'stack build...' thing.

'stack install unison' fails to come up with a build plan, so I use a soft link from /usr/bin/ucm -> /unison-trunk/.stack-work/install/x86_64-linux/273e09a1cfdcf654a3879d5f9157f5da538c54227fd37c349f06422e7ed51e56/9.6.5/bin/unison

I don't remember having to do all this when I first installed unison, but that was quite a while ago.

BTW, I'm on UK time so if I'm not responding it may mean I'm asleep ;-)

ndearns avatar Sep 26 '25 13:09 ndearns

Ah okay that makes sense then. If you just grabbed the source code without the git repository and built from that source as opposed to pulling a pre-built binary, there wouldn't really be any way for it to know the version number. I suppose that you could work around that by maintaining a metadata file under source control that gets changed for each version. But this seems like a fairly niche use-case; I imagine that almost everyone is going to either pull a pre-built binary or clone the git repo. So I don't know if it's worth jumping through many hoops to show something other than "unknown" in this case. Perhaps you could change the output to something more helpful than unknown without actually being a meaningful version number. Probably @aryairani's call to make.

ceedubs avatar Sep 26 '25 14:09 ceedubs

I think it would be good to fix this, but it's a low priority. I'm going to leave the ticket open.

There was the separate issue where it talked about the codebase schema being from too old of a version of ucm, and I'm not sure how that factors into this issue if at all, but that could at least be improved. e.g. maybe list the schema versions in the error, and in the version command output.

aryairani avatar Sep 26 '25 15:09 aryairani

Yeah, this build is working fine with the libs I downloaded yesterday.

ndearns avatar Sep 26 '25 15:09 ndearns