c3lang / c3c

Compiler for the C3 language
https://c3-lang.org
GNU Lesser General Public License v3.0
3.02k stars 183 forks source link

wrote manpage in c3c.1 and added manpage install to CMakeLists.txt #1581

Closed goneal26 closed 1 month ago

goneal26 commented 1 month ago

Addressing #1377

lerno commented 1 month ago

Thank you!

bpo217 commented 3 weeks ago

I think this actually broke the MacOS brew install --head. Copying a man page fails with operation not permitted and homebrew doesn't support sudo installs. I switched to the using brew install --head instead of compiling myself because of lld being moved into a separate package on homebrew and I couldn't find any info about setting an LLD cmake flag akin to the LLVM_DIR for compling on at the latest and it seemed easier but now the whole thing fails because of the man page sudo priviledges.

bpo217 commented 3 weeks ago

Maybe I should create a new issue for this and reference?

lerno commented 3 weeks ago

We could place the man page in different pages on MacOS perhaps?

goneal26 commented 3 weeks ago

I think this actually broke the MacOS brew install --head. Copying a man page fails with operation not permitted and homebrew doesn't support sudo installs. I switched to the using brew install --head instead of compiling myself because of lld being moved into a separate package on homebrew and I couldn't find any info about setting an LLD cmake flag akin to the LLVM_DIR for compling on at the latest and it seemed easier but now the whole thing fails because of the man page sudo priviledges.

I had a friend point out a similar issue with MacOS to me on their M2- brew had also installed their man pages directory to a different location, I think it was /opt/man/ instead of something like /usr/local/share/man/ so man c3c wouldn't work when compiling from source. I started working unofficially on a fix to account for this but I haven't been able to test it yet. Should the man pages be removed until the brew stuff is worked out?

bpo217 commented 3 weeks ago

We could place the man page in different pages on MacOS perhaps?

I agree with this as the first obvious solution and ran with it a bit. For completeness here is the failure I am referring to: Screenshot 2024-11-03 at 08 50 00.

Here's homebrew being protective:

Screenshot 2024-11-03 at 09 22 54

Further investigation revealed this file: /private/etc/manpaths and it's contents are:

/usr/share/man
/usr/local/share/man

Another file is /private/etc/man.conf. This is a portion of it:

...
# Every automatically generated MANPATH includes these fields
#
MANPATH /usr/share/man
MANPATH /usr/local/share/man
MANPATH /usr/X11/man
MANPATH /Library/Apple/usr/share/man
#
# Uncomment if you want to include one of these by default
#
# MANPATH   /opt/*/man
# MANPATH   /usr/lib/*/man
# MANPATH   /usr/share/*/man
# MANPATH   /usr/kerberos/man
...

I think where it's going is the right place. One just needs sudo priviledges... which fails with homebrew... Which is confusing because surely some other tool in homebrew installs a man page? Apparently not? I mean all these dirs require sudo priviledges. I switched back to compile from source and then it's just a matter of copying the man page file really. So this will need to be some kind of informative message after installing c3c for the man page. The brew script would need to install the man page along side c3c in it's own opt folder and then display a message that in order to use the man page you have to copy or symlink it or something. What do we think about this?

bpo217 commented 3 weeks ago

Actually that X11 man page is probably not standard maybe brew installed that. I'll check it out.

lerno commented 3 weeks ago

Does it work now after the patch?

bpo217 commented 3 weeks ago

Does it work now after the patch?

If you mean: does it work after this particular merge I am commenting on... The answer is I made the comment because the merge caused the break. The latest brew install c3c --HEAD fails. Unless you are referring to a newer one.

bpo217 commented 3 weeks ago

Looks like there was a new patch which fixed it today! Coolio.