nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.03k stars 134 forks source link

uuidgen does not exist on Windows #722

Closed chipsenkbeil closed 5 months ago

chipsenkbeil commented 5 months ago

Describe the bug

I thought uuidgen - used for generating ids - existed on all platforms, but it turns out that Windows doesn't always have it available. I think the Github action environment does, but testing in a Windows vm, I get errors about it not existing.

Steps to reproduce

  1. Spin up a full Windows system (in my case windows 11)
  2. Call lua print(require("orgmode.org.id").new())
  3. Notice the error message about uuidgen not existing

Expected behavior

A UUID can get generated on Windows.

Emacs functionality

No response

Minimal init.lua


-- Stock loading of orgmode plugin

Screenshots and recordings

No response

OS / Distro

Windows 11

Neovim version/commit

0.9.5

Additional context

I wrote a workaround using a pure-Lua uuid generator I made for org-roam. This could potentially be used by orgmode as a fallback if uuidgen is not found.

https://github.com/chipsenkbeil/org-roam.nvim/commit/d261247cab48e43898eb6c25e40c9ae8192956ef

kristijanhusak commented 5 months ago

Program that is used for generating uuid is configurable in Emacs (https://github.com/tkf/org-mode/blob/master/lisp/org-id.el#L127) and also here https://github.com/nvim-orgmode/orgmode/blob/master/DOCS.md#org_id_uuid_program. Also, id can have different format (method), that can be changed (emacs: https://github.com/tkf/org-mode/blob/master/lisp/org-id.el#L132, nvim: https://github.com/nvim-orgmode/orgmode/blob/master/DOCS.md#org_id_method).

I didn't find any information how Windows Emacs users handle that, but since it's configurable in the same way I think it's good enough.

chipsenkbeil commented 5 months ago

Fair enough :) I'll close this out