Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Plan 9 #242

Closed
wants to merge 1 commit into from

Conversation

@lufia
Copy link

commented Jan 6, 2019

I ported libexpat to Plan 9 operating system.

This PR did:

  • To build libexpat library
  • To build runtests command

To build in Plan 9, just run few steps.

% cd lib
% mk
% mk install

Currently, 90% of tests are passed.
Could you merge this?

@hartwork hartwork self-requested a review Jan 6, 2019

@hartwork
Copy link
Member

left a comment

Hi @lufia ,

I'm very happy to join improving Expat for use on Plan 9 in general but the current approach does not seem like the right direction yet, e.g. because if we add another build system someone will need to maintain it and there's no guarantee you are going to be around forever and you're the first approach Expat about plan9 in many years. I'm rather new to plan9 so please excuse if some of these question will clearly show:

  • libexpat requires a C99 compiler, officially. Is that something that plan9 cannot offer and if not: why?
  • How come plan9 does not have a package for Expat, yet? Where can I find the official package collection?
  • Does plan9 have GNU make around? If yes: Let's drop mkfiles, if not: Why not? No objections against mk as a tool but this is not a good place to support both tools (due to cost)
  • If plan9 uses genrandom, let's not pretend it would be arc4random_buf. Let's be transparent and obvious
  • Is there a way to run plan9 in a chroot or container for me to verify your PR on Linux?

I hope we can figure something out that works for you and libexpat.

@lufia

This comment has been minimized.

Copy link
Author

commented Jan 7, 2019

Plan 9 is research OS from Bell labs.
It has Ken Thompson's C compiler that is dialect of ANSI C, and ANSI/POSIX compatible C compiler, but ANSI/POSIX environment is based C89 so is not compatible for C99 completely.

Though I'm working to add a part of lacked ANSI/POSIX API at 0intro/plan9-contrib#6, it is not easy that C compiler supports C99 features such as __func__, compound literals, macros.

Current status:

libexpat requires a C99 compiler, officially. Is that something that plan9 cannot offer and if not: why?

Because Plan 9 ANSI/POSIX C compiler is based on C89. If some API defined in POSIX will be added to APE, I will remove unneeded codes such as #define bool int.

How come plan9 does not have a package for Expat, yet? Where can I find the official package collection?

I think http://9p.io/wiki/plan9/Contrib_index/index.html may be official third party package collection for Plan 9.
But currently, it can't add a new account since 2015, so I haven't the account.

Does plan9 have GNU make around? If yes: Let's drop mkfiles, if not: Why not? No objections against mk as a tool but this is not a good place to support both tools (due to cost)

Plan 9 haven't GNU toolchain yet. Porting of these is very hard. (autoconf, automake, gawk, gettext, etc)

If plan9 uses genrandom, let's not pretend it would be arc4random_buf. Let's be transparent and obvious

genrandom(2) says:

Genrandom fills a buffer with bytes from the X9.17 pseudo–random number generator.
The X9.17 generator is seeded by 24 truly random bytes read from /dev/random.

Is there a way to run plan9 in a chroot or container for me to verify your PR on Linux?

Hmm...Because Plan 9 is not Linux distro, I think VM image is best solution for verify a patch.
Possibly I might be able to create container image that simulate Plan 9 environment but it is not perfect.

@hartwork

This comment has been minimized.

Copy link
Member

commented Jan 7, 2019

Because Plan 9 ANSI/POSIX C compiler is based on C89

Can that compiler be used to compile GCC or Clang and then use that to compile C99 code?

Plan 9 haven't GNU toolchain yet. Porting of these is very hard

Why is porting these hard? A Unix without a GNU toolchain available sounds crazy to me.
Are there kickstarters about this? I might even join if that work is funded.

I really don't want a new mk build system here as long as p9 is mostly at home in a museum. Because it adds cost to Expat and we're not exactly overpowered. If you look at #14 we're going the opposite direction: Getting rid of old build systems. We'll probably have CMake as the only build system for Expat at some point, we're just not there yet.

@hartwork

This comment has been minimized.

Copy link
Member

commented Jan 7, 2019

PS: Thanks for your detailed reply!

@lufia

This comment has been minimized.

Copy link
Author

commented Jan 8, 2019

@hartwork
Okey, I understand with your opinion.
I'll fork libexpat for Plan 9 and manage it.

Thank you for your reply.

@lufia lufia closed this Jan 8, 2019

@oridb

This comment has been minimized.

Copy link

commented Apr 21, 2019

FYI, there is a gnu make port (http://code.9front.org/hg/ports/file/71acde4f6455/dev-utils/gmake; The rest of the toolchain is not there, nor is it likely to be in the near future.)

A Unix without a GNU toolchain

Plan 9 isn't a unix. This port is using a Unix emulation layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.