~sircmpwn/hare-users

Cound not open modue 'xxxxx': `typedef variable $HARE_TD_xxx not set`

Details
Message ID
<CADC8Pp5gq1g4cb7A0K-_-NPA+QuWO0wjSYXAHf-5DeY2OsJa_A@mail.gmail.com>
DKIM signature
pass
Download raw message
This is always a problem on FreeBSD/OpenBSD, but it's fine in Linux
(I've tested in ArchLinux and Alpine Linux). I hope that someone can
help me with this:

I put my personal `hare_utils` in `/usr/local/src/hare/third-party`
(listed in `hare version -vv`), as that's my share code between all my
hare projects. I found that if I named my module the same name as any
modules in `stdlib` (even sub module or just part of it), it would
produce the following error:

```bash
  Could not open module 'hare_utils::hex': typedef variable
$HARE_TD_hare_utils::hex not set
```

For example, I have a util module called `poll_tcp`, it combines or
has a part of `unix::poll` and `net::tcp`. So, `hare run` failed with
the above error (`$HARE_TD_hare_utils::poll_tcp not set`)!!!

So, I have to change my module name to something else, and it still
can't be solved sometimes.

For example, if I change the module (folder) name from `hex` to
`hexs`, it works in `OpenBSD` but still fails in `FreeBSD`:(

Here is my `hare_utils` tree list, just in case you need that:

```bash
/usr/local/src/hare/third-party
└── hare_utils
    ├── README
    ├── README.md
    ├── bit
    │   ├── +test.ha
    │   ├── README
    │   └── bit.ha
    ├── collections
    │   ├── README
    │   ├── hashmap
    │   │   ├── README
    │   │   └── separate_chainning
    │   │       ├── +test
    │   │       │   ├── hash_function_test.ha
    │   │       │   └── schm_test.ha
    │   │       ├── README
    │   │       ├── hash_function.ha
    │   │       ├── schm.ha
    │   │       └── types.ha
    │   ├── queue
    │   │   ├── README
    │   │   ├── linkedlist_queue
    │   │   │   ├── +test.ha
    │   │   │   ├── README
    │   │   │   └── linkedlist_queue.ha
    │   │   └── ring_buffer_queue
    │   │       ├── +test.ha
    │   │       ├── README
    │   │       └── ring_buffer_queue.ha
    │   └── stack
    │       ├── README
    │       ├── array_stack
    │       │   ├── +test.ha
    │       │   ├── README
    │       │   └── array_stack.ha
    │       ├── circular_stack
    │       │   ├── +test.ha
    │       │   ├── README
    │       │   └── circular_stack.ha
    │       └── list_stack
    │           ├── +test.ha
    │           ├── README
    │           └── list_stack.ha
    ├── examples
    │   ├── README
    │   └── undo_redo_example.ha
    ├── hex
    │   ├── +test.ha
    │   ├── README
    │   ├── error.ha
    │   └── hex.ha
    ├── logger
    │   ├── README
    │   └── logger.ha
    ├── memory
    │   ├── +test.ha
    │   ├── README
    │   └── print.ha
    ├── nc
    │   ├── +freebsd
    │   │   └── locale.ha
    │   ├── +linux
    │   │   └── locale.ha
    │   ├── README
    │   ├── color_and_attribute.ha
    │   ├── cursor.ha
    │   ├── input.ha
    │   ├── nc.ha
    │   ├── popup_menu.ha
    │   ├── popup_window.ha
    │   ├── window.ha
    │   └── window_border.ha
    ├── pthread
    │   ├── README
    │   ├── attribute_routines.ha
    │   ├── mutex_routines.ha
    │   ├── readwrite_lock_routines.ha
    │   ├── string_error.ha
    │   ├── thread_routines.ha
    │   └── types.ha
    ├── random
    │   ├── +test.ha
    │   ├── README
    │   └── random.ha
    ├── raylib
    │   ├── README
    │   └── types.ha
    ├── tcp
    │   ├── +test
    │   │   └── tcp_server_test.ha
    │   ├── README
    │   ├── error.ha
    │   ├── handlers.ha
    │   ├── tcp_client.ha
    │   ├── tcp_server.ha
    │   └── types.ha
    ├── temp.log
    └── unit-test.sh
```
Reply to thread Export thread (mbox)