-
Notifications
You must be signed in to change notification settings - Fork 39
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
omake in linux #1044
Comments
The problem is this omake doesn't work with any makefile. It always crashes with this error:
It seems it's looking for Here is the result of
|
Please move that to https://github.com/LADSoft/OMAKE, which should also make it easy to build without manual deletion of files. |
I am utterly unsurprised that omake doesn't function on linux, I'm more
surprised that it's a bad file descriptor.
A lot of the "OS" wrapper libraries that are set up for os-independence
aren't implemented on linux at the moment, after the next release I wanted
to go after tackling that so that there's some modicum of "linux" support
(even if it's not yet the compiler supporting compiling TO linux, just on),
outside of that there shouldn't be much of anything if at all being a
blocker.
If you want, I'd try modifying os.cpp such that everything supported on
windows is supported on Linux and seeing if that fixes anything....
As for the make.cfg issue, try changing ToolChain.cpp in the `util`, the
access call to have "F_OK", I think on Linux the F_OK call is something
different than on windows and that is the likely cause there...
Also, renaming it when you should have omake.cfg will cause it to hunt for
make.cfg for the check, so that's another weird thing...
…On Mon, Sep 9, 2024 at 1:54 PM Simon Sobisch ***@***.***> wrote:
Please move that to https://github.com/LADSoft/OMAKE, which should also
make it easy to build without manual deletion of files.
—
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSPBTXQXBASAUHW27CHP23ZVXOGZAVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZYG4ZTEMZYGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This repository is not synced with the latest changes. Getting your build system to work on Linux is also a hassle. This is why I decided to use my own build system (a RedPanda DevCpp project). |
@chuggafan I changed line 110 in ToolChain.cpp from |
Note: I build omake completely decoupled from orange c. |
Right. That repo's state is considered to be stable and has an issue tracker specific for omake, while this repo's master is both focused on the whole suite and on "latest testing" state.
That's a reasonable thing for the defaults - the builtin rules need an internal define for CC/CXX/AS (= if not explicit specified in the makefile) and those use the OrangeC tools; their fullpath is resolved from the ORANGEC environment variable and if not already set this is done internally, relative from |
I've done some investigation, it seems to be something up with my jobserver
implementation, I only did a preliminary investigation and I'll do a
further one over the weekend but it seems like my "quick fix" is actually
"wtf am I doing on Unix again?"
Probably from not initializing job checks, we'll see...
…On Tue, Sep 10, 2024 at 3:37 AM Simon Sobisch ***@***.***> wrote:
Please move that to https://github.com/LADSoft/OMAKE, which should also
make it easy to build without manual deletion of files.
This repository is not synced with the latest changes.
Right. That repo's state is considered to be stable and has an issue
tracker specific for omake, while this repo's master is both focused on the
whole suite and on "latest testing" state.
Note: I build omake completely decoupled from orange c.
ToolChain::StandardToolStartup makes a reference to the ORANGEC
environment variable. It seems omake is tied to orange c?
That's a reasonable thing for the *defaults* - the builtin rules need an
internal define for CC/CXX/AS (= if not explicit specified in the makefile)
and those use the OrangeC tools; their fullpath is resolved from the
ORANGEC environment variable and if not already set this is done
internally, relative from omakes path.
—
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSPBTSQ6LASQOVB7KW6JQ3ZV2OTVAVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA4TOMZQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@chuggafan Please have a look at your https://github.com/LADSoft/OrangeC/blob/master/src/util/ToolChain.cpp#L99 The name of the |
The problem is I only use just one make job (doesn't specify |
The install/package step should rename the file - but as an external build system is used here this is possiblity already done - if there are any options to override the binary names in our Makefiles in the first place...
|
I managed to compile the whole orange c suite in linux. This is the command I used:
But I don't know what to do after that. How to install it so I could set the Btw, I noticed that the binaries have |
Frankly speaking, I'm more interested in omake as a standalone tool. If I need the whole orange c suite to use omake then it's a lot less appealing to me. |
The omake in this repository will not even compile with |
Mr. ghost (#1038) is absolutely right. Please run static analyzers on your code. Or at least try compiling using latest GCC and Clang with the highest diagnostics. Goodbye. |
Thanks for the note, but the issue should be kept open as it is unresolved (please opt out of subscription instead if you don't want to receive any updates).
|
OK. |
I'm working on this issue now that it's the weekend, seems like it's a
multilayered issue with omake, the majority of it seems (to me) to be
individual little bits that I got wrong from not testing on Linux before
getting into the real meat of issues (i.e. semaphores being broken, the
jobserver pipe being broken, etc.) from making bad assumptions.
I'm now debugging why the VariableContainer isn't getting linux environment
variables, which will be the next steps to being able to say: "Hey, the
shell is /bin/sh, please stop this annoying stuff"
…On Thu, Sep 12, 2024 at 2:41 AM mh466lfa ***@***.***> wrote:
Thanks for the note, but the issue should be kept open as it is unresolved
(please opt out of subscription instead if you don't want to receive any
updates).
OK.
—
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSPBTTH55357NUZV27WGM3ZWEZRTAVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBVGM4TKNJTHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Please consider MSYS and possibly cygwin - using a test for the shell may break some parts if that's for finding the OS... You do know about the |
I do know of the OS environment variable being a thing on Windows, however
I also am aware that on Linux (specifically my WSL debian, Ubuntu, work's
RHEL 9.4 and 8.10 servers as well) installation `SHELL` is a defined
variable (and MSYS also does this).
Windows doesn't do this by default, but I'm taking the already (mediocre)
circuitry and just shorting it so that if it detects SHELL, it looks for
"sh" and sets the internal mechanisms to say "This is a (sh)ell system (as
I've found that pretty much every shell ends in sh, dash, bash, sh, zsh,
fish) and there's only a few I've found that don't (cancer (named because
it's terminal)).
Ideally we'd have separate compiled instances for windows and linux, which
is already somewhat of a thing, but needs more mechanisms to make that
truly happen outside of weird wine executions.
All in all this change is a bit more complex than I first realized and so
will probably take a few days to nail down each individual thing so that
omake is even passable on linux, then I can strip out every single `SHELL=`
thing in the makefiles so that we're not erroneously overriding that in WSL
where cmd.exe is actually available and breaks the builds.
…On Sat, Sep 14, 2024 at 3:00 AM Simon Sobisch ***@***.***> wrote:
Please consider MSYS and possibly cygwin - using a test for the shell may
break some parts if that's for finding the OS...
You do know about the OS environment variable, right?
—
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSPBTTBSDZLZIUCLDXKYSDZWPNHNAVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJQHA4DEOJQGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I do miss something. Within the compile we have #ifdef _WIN32, for the build system we can explicitly set variables during make as well...
|
@chuggafan thank you for looking into this. FWIW I've been trying to get away from checking the _WIN32 define and I made a define TARGET_OS_WINDOWS... the intention was when that isn't set it is for linux/unix but I don't suppose there is any reason we couldn't additionally add TARGET_OS_LINUX if that seems reasonable.... |
I mean, I understand the TARGET_OS_WINDOWS vs TARGET_OS_LINUX distinction,
but fundamentally I think it's mostly just a "smart renaming" of _WIN32,
and __unix__/__linux__/whatever gcc and clang are doing since realistically
they're the only relevant players outside of EDG compilers, and even
*those* define __unix__ when targeting unix-like platforms
https://godbolt.org/z/Yj8bvbc5a
I'm more than fine continuing with the smart renaming aspect, it's more so
just that there's already existing mechanisms that are intended for exactly
this kind of "check what platform we're on" stuff, I mostly just want to
wrap all of that into a little library like the OS libraries and get on
with that...
…On Sat, Sep 14, 2024 at 1:39 PM David Lindauer ***@***.***> wrote:
@chuggafan <https://github.com/chuggafan> thank you for looking into this.
FWIW I've been trying to get away from checking the _WIN32 define and I
made a define TARGET_OS_WINDOWS... the intention was when that isn't set it
is for linux/unix but I don't suppose there is any reason we couldn't
additionally add TARGET_OS_LINUX if that seems reasonable....
—
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSPBTWLOG7RON6GDXKDKC3ZWRYD5AVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRGA4DAMJQGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Whelp, the issue I ran into was simpler than I thought:
environ is a thing in POSIX as well as WINDOWS, just does it a little
differently, so I modified that.
OMAKE *STILL* does not run properly on linux, but it's no longer crashing
and (should) define the shell variable.
It's still bugging out at dealing with pretty much everything inside of OS,
it's just we now get environment variables 🎉
The places where this is still an os.cpp issue are process spawning (I
don't even know where to begin, on UNIX there's 8 different ways to do it
and it's unclear which is the "right" way nowadays, whereas on windows
there's a grand total of 2), GetFullPath, TerminateAll, and everything to
do with file times.
Work does also need to be done on using the default shell $(SHELL)
everywhere possible, especially since on windows omake is setting that to
cmd.exe by default (I checked), but that can be done at a later date.
I'll push my changes to a separate branch, and notify you about it to make
a PR sometime today/tomorrow depending on if I feel like tackling at least
some of the os.cpp changes that need to go through for proper omake
functioning on linux.
…On Sat, Sep 14, 2024 at 2:02 PM chugga fan ***@***.***> wrote:
I mean, I understand the TARGET_OS_WINDOWS vs TARGET_OS_LINUX distinction,
but fundamentally I think it's mostly just a "smart renaming" of _WIN32,
and __unix__/__linux__/whatever gcc and clang are doing since realistically
they're the only relevant players outside of EDG compilers, and even
*those* define __unix__ when targeting unix-like platforms
https://godbolt.org/z/Yj8bvbc5a
I'm more than fine continuing with the smart renaming aspect, it's more so
just that there's already existing mechanisms that are intended for exactly
this kind of "check what platform we're on" stuff, I mostly just want to
wrap all of that into a little library like the OS libraries and get on
with that...
On Sat, Sep 14, 2024 at 1:39 PM David Lindauer ***@***.***>
wrote:
> @chuggafan <https://github.com/chuggafan> thank you for looking into
> this.
>
> FWIW I've been trying to get away from checking the _WIN32 define and I
> made a define TARGET_OS_WINDOWS... the intention was when that isn't set it
> is for linux/unix but I don't suppose there is any reason we couldn't
> additionally add TARGET_OS_LINUX if that seems reasonable....
>
> —
> Reply to this email directly, view it on GitHub
> <#1044 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADSPBTWLOG7RON6GDXKDKC3ZWRYD5AVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRGA4DAMJQGQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Look at this for a reference on POSIX system (how to spawn new processes, environment variables, blah blah...): https://github.com/rmyorston/pdpmake Btw, I suggest using |
Your code is GPL-ed, and since the GPL can absorb code written in weaker licenses, I don't see there are any reasons to not look into the code of GNU make itself or BSD make and even copy it. bmake is here: https://www.crufty.net/help/sjg/bmake.html |
Note: CDDL is not |
Orange C failed to link on Cygwin and FreeBSD. Compilation is fine, but linking is not. Why? |
And as @mh466lfa has noted, the executables have |
And why |
It's linking fine on Linux, but failed to link on Cygwin and FreeBSD. On Cygwin:
On FreeBSD, it's complaining about missing of |
Here is the error message on FreeBSD:
Build command: |
Lack of the ceilf function indicates to me that one needs to add the `-lm`
linker flag to link libmath on those platforms for everything to build.
…On Sun, Sep 15, 2024 at 8:33 AM chatchoi ***@***.***> wrote:
Here is the error message on FreeBSD:
clang++ -c -D__MSVCRT__ -DHAVE_UNISTD_H=1 -DSQLITE_OS_UNIX -Wno-int-to-pointer-cast -I../util -I../exefmt -I../ -fpermissive -DGNUC -std=gnu++14 -o /test/OrangeC/src/netlib/obj/gcc-linux/NetLinkMain.o NetLinkMain.cpp
clang -L/test/OrangeC/src/../src/lib/gcc-linux -o netlib.exe /test/OrangeC/src/netlib/obj/gcc-linux/NetLinkMain.o -Wl,--start-group -lnetlib -lutil -Wl,--end-group -lstdc++ -lpthread -ldl
ld: error: undefined symbol: ceilf
>>> referenced by NetLinkMain.cpp
>>> /test/OrangeC/src/netlib/obj/gcc-linux/NetLinkMain.o:(std::__1::__math::ceil[abi:se180100](float))
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build command: gcc COMPILER="gcc-linux" CC=clang CXX=clang++.
—
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSPBTRNPFOTDXWJSQJPSB3ZWV5BFAVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRGU3TEOBRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
What about Cygwin? Don't tell me you only read the last email. Please login to your Github account to read the whole thread. Github is more like a social network or a forum. You can't work with it optimally if you treat it as a mailing list. You have conveniently ignored other things posted by me. |
It's either pure carelessness (only read the last email) or intentional. Because even as it non-optimal form (a mailing list), Github does send all of the messages people have posted to everyone subscribed to the thread. |
If a big thread is too difficult for you to keep track of, I will split my comments into new issues. |
I haven't used a github account in a while to respond, but yes, I've
seen the complaints.
However, do keep in mind that I do this for free, as a hobby, I am not
paid to do this, this is not my job, I do not have to answer to you
for literally anything, I am currently focusing on performing filetime
checks & figuring out how I will use posix_spawn because I see those
as actually pressing issues to getting omake to properly work on
linux, and then I can test on other platforms should I find an old
computer to turn into a BSD machine.
If these issues bother you so much, you are in fact, more than welcome
to submit a pull request fixing them on your own effort.
…On Mon, Sep 16, 2024 at 6:33 AM chatchoi ***@***.***> wrote:
If a big thread is too difficult for you to keep track of, I will split my comments into new issues.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I'm also testing your code for free. I need better cooperation. I don't like to talk alone. Btw, unsubscribed. Goodbye. |
Ok, so I've been lazy on this too, but I recently got around to testing the
actual code behind the wordexp changes so we can actually execute commands
on linux via posix_spawn so we can spawn a subprocess without `fork`.
Small problem: it only works on singular commands, this means that many
common `sh`isms and `bash`isms aren't accessible to us, for example:
`echo $LD_LIBRARY_PATH` will function fine,
But:
`echo $LD_LIBRARY_PATH && echo boo`
Will simply return an error, specifically:
"WRDE_BADCHAR" which means a meta-character appears in a wrong place,
despite the fact that && indicates that it's a "conjoining" of two
commands, which means for chained commands such as those (which are done in
makefiles), this technique is, sadly, near useless, and we'll have to swap
to parsing out everything by hand again.
I think we can still use this for expansion of CLI variables, we'd just
need to be cautious when we do it.
…On Mon, Sep 16, 2024 at 11:25 AM chatchoi ***@***.***> wrote:
I'm also testing your code for free. I need better cooperation. I don't
like to talk alone.
Btw, unsubscribed. Goodbye.
—
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSPBTXSOC5U464REGVTAADZW3Z5XAVCNFSM6AAAAABN5BGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJTGIZTINBVGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ya'know what, re-reading how GNU make does it, it turns out I'm an idiot.
|
Currently working on this since my revelation, currently trying to understand duplicating pipes since there's a way to duplicate a pipe using posix_spawn so that I can read it for the |
next month = next year = ... 24 hours :-) |
Yes, of course, I'll probably throw my work up over the next weekend just to get some eyeballs on the |
I extracted omake from the orangec source tree (copied all needed source files until the compiler stopped complaining) and added them into a RedPanda DevCpp project. I added
-DHAVE_UNISTD_H
and-pthread
. It compiled fine with a few warnings. But the warning by the linker seems to need attention.Anyway, I have a
make
binary (I named my omake binary simplymake
).The text was updated successfully, but these errors were encountered: