-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Meta: Get building on NixOS #5005
Conversation
Ports/dropbear/package.sh
Outdated
@@ -1,4 +1,4 @@ | |||
#!/bin/bash ../.port_include.sh | |||
#!/usr/bin/env bash ../.port_include.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it actually work to specify multiple arguments in shebangs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember running into this when changing Serenity's env
. Some env
implementations allow that by default and others require a -S
flag or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so the kernel passes everything following the initial binary name as a single argument (in this case, /usr/bin/env "bash ../.port_include.sh"
), and the env
implementation can then optionally support splitting this as a shell would otherwise do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not quite following - is there a change you'd like me to do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might need to add -S
as @asynts says
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using -S
breaks support for OpenBSD: https://man.openbsd.org/env.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Portability in a nutshell...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So no -S
? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathandturner: I don't think it would work without it.
Not to sound negative — being able to build Serenity on Guix would be great 😀 — but the idea that But I realize that ship has sailed, and the design of Nix/Guix is not gonna change because of my preferences. |
Toolchain/BuildPython.sh
Outdated
@@ -1,5 +1,8 @@ | |||
#!/usr/bin/env bash | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, looks like an unresolved merge conflict snuck in. I also noticed there's a merge commit in your commit list -- we like to follow a rebase + squash workflow so that commits can be directly placed in master from each PR. https://github.com/SerenityOS/serenity/blob/master/CONTRIBUTING.md#code-submission-policy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
435cfaa
to
56d9795
Compare
@@ -390,7 +390,7 @@ add_custom_target(generate_PropertyID.h DEPENDS CSS/PropertyID.h) | |||
|
|||
add_custom_command( | |||
OUTPUT CSS/PropertyID.cpp | |||
COMMAND /bin/mkdir -p CSS | |||
COMMAND /usr/bin/env -S mkdir -p CSS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we somehow use cmake
to make directories instead of using /usr/bin/env -S mkdir -p ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMMAND /usr/bin/env -S mkdir -p CSS | |
COMMAND ${CMAKE_COMMAND} -E make_directory CSS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this didn't need -S
since it is not a shebang.
All right, let's get this merged since it seems fine, although I have a strong feeling that NixOS build support will bitrot unless somebody uses it regularly. |
Why do some shebangs say |
@linusg: because of how arguments are passed to programs with shebangs: With |
Managed to get this building on NixOS and figured I'd turn it into a PR so it didn't get lost. The gist is largely to not use
/bin/bash
or/bin/mkdir
, since those aren't available on NixOS and instead useenv
to find where they are.The rest of this is setting up the build dependencies so that both the bootstrap and Serenity can build successfully.