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

softether: build fix #375656

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Nobody-alias-N
Copy link
Contributor

@Nobody-alias-N Nobody-alias-N commented Jan 21, 2025

Resolves #375419

ref. #356812

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1 10.rebuild-linux: 1-10 labels Jan 21, 2025
@nix-owners nix-owners bot requested a review from rick68 January 21, 2025 22:39
@Nobody-alias-N
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 375656


x86_64-linux

✅ 1 package built:
  • softether

@Nobody-alias-N
Copy link
Contributor Author

@FliegendeWurst
I want to ask your opinion :)
This builds and the packages work for me,
but the /bin contains bash scripts launching the binaries
and they point to the wrong path.

So what I get after build is
nix_store_path/bin/ bash scripts pointing to /var/lib/softether/... wrong path
nix_store_path/var/lib/softether/... where they actually are

Should that be changed in this pr?

@Nobody-alias-N
Copy link
Contributor Author

Nobody-alias-N commented Jan 21, 2025

Because starting the server or client requires modifying the nix store with sudo
I assume for this package nix_store_path/var/... is supposed to be copied to /var/... before use?

@FliegendeWurst
Copy link
Member

Usually the result should be usable without copying it somewhere else.

@FliegendeWurst
Copy link
Member

Alright, I would recommend: putting bash in buildInputs, so the scripts get a proper shebang.

Adding substituteInPlace "$out/bin/vpnclient" --replace-fail /var/lib/softether/vpnclient "$out/bin" and similar in postInstall.

@Nobody-alias-N
Copy link
Contributor Author

Sorry for taking so long to reply, I went to sleep.

@Nobody-alias-N
Copy link
Contributor Author

Thank you very much for your recommendation and explanation; they are really helpful to me :)

@Nobody-alias-N
Copy link
Contributor Author

For some reason adding bash to buildInputs did not change the shebang for me but that is probably an issue on my end.

@FliegendeWurst
Copy link
Member

It only matters for cross builds or if you set strictDeps = true. (#178468)
The current default (strictDeps = false) means you got the builder shell before.

@Nobody-alias-N
Copy link
Contributor Author

Nobody-alias-N commented Jan 22, 2025

Thank you for your explanation.
I tried setting strictDeps to true, but that did not change the output for me.
I also tried to cross compile but I was not successful.

I say don't worry about it, it is probably just something on my end, don't waste your time on this.
I just want to make sure I don't misunderstand the part:
in the bash scripts I am supposed to see something like
#!/bin/sh instead of
#!/nix/store/4fvc5fm8bszmkydng1ivrvr5cbvr1g60-bash-5.2p37/bin/sh ?

or is #!/nix/store/4fvc5fm8bszmkydng1ivrvr5cbvr1g60-bash-5.2p37/bin/sh
the correct format I should get, and I just had it from the start?

@FliegendeWurst
Copy link
Member

I tried setting strictDeps to true, but that did not change the output for me.

Yes it only mattered before, when you did not have bash in buildInputs.

#!/bin/sh (or similar) is what is provided upstream, we patch it to use our bash.

@FliegendeWurst
Copy link
Member

cross is broken for different reasons. If you want, you can include:

diff --git a/pkgs/by-name/so/softether/package.nix b/pkgs/by-name/so/softether/package.nix
index abd112ce5e19..14cdb08a8009 100644
--- a/pkgs/by-name/so/softether/package.nix
+++ b/pkgs/by-name/so/softether/package.nix
@@ -27,10 +27,6 @@ stdenv.mkDerivation (finalAttrs: {
     zlib
   ];
 
-  preConfigure = ''
-    ./configure
-  '';
-
   buildPhase = ''
     mkdir -p $out/bin
     sed -i \
@@ -50,5 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
       "x86_64-linux"
       "aarch64-linux"
     ];
+    # internal build tool hamcorebuilder is difficult to build for the build platform
+    broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
   };
 })

Otherwise I will take care of it in another PR.

@Nobody-alias-N
Copy link
Contributor Author

Yes it only mattered before, when you did not have bash in buildInputs.

#!/bin/sh (or similar) is what is provided upstream, we patch it to use our bash.

Thank you soo much!

@Nobody-alias-N
Copy link
Contributor Author

cross is broken for different reasons. If you want, you can include:

Otherwise I will take care of it in another PR.

You already helped me so much I don't want to take away the opportunity from you to get another pr in :)
Thank you, but I will let you have it :)

I can't thank you enough for being so patient with me, so thank you again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build failure: softether
2 participants