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

xmake: 2.9.4 -> 2.9.5 #343185

Merged
merged 3 commits into from
Sep 27, 2024
Merged

xmake: 2.9.4 -> 2.9.5 #343185

merged 3 commits into from
Sep 27, 2024

Conversation

rennsax
Copy link
Member

@rennsax rennsax commented Sep 20, 2024

Description of changes

Xmake is actually broken in Nixpkgs. See #342966.

I'm surprised that this simple derivation "just works" - on my MacBook 2021 (aarch64-darwin), on my NixOS virtual machine (aarch64-linux) and on my lab's server (x86_64-linux).

However I'm not sure if the derivation is generic enough. Maybe more tests needed.

Here is the behavior of xmake:

$ xmake create -l c -P ./hello
create hello ...
  [+]: xmake.lua
  [+]: src/main.c
  [+]: .gitignore
create ok!
$ cd hello
$ xmake
checking for platform ... linux
checking for architecture ... x86_64
[ 50%]: cache compiling.release src/main.c
[ 75%]: linking.release hello
[100%]: build ok, spent 1.287s
$ xmake --version
xmake v2.9.5+19800101, A cross-platform build utility based on Lua
Copyright (C) 2015-present Ruki Wang, tboox.org, xmake.io
                         _
    __  ___ __  __  __ _| | ______
    \ \/ / |  \/  |/ _  | |/ / __ \
     >  <  | \__/ | /_| |   <  ___/
    /_/\_\_|_|  |_|\__ \|_|\_\____|
                         by ruki, xmake.io

    👉  Manual: https://xmake.io/#/getting_started
    🙏  Donate: https://xmake.io/#/sponsor

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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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.

@rennsax
Copy link
Member Author

rennsax commented Sep 20, 2024

ping @wineee

@Atemu
Copy link
Member

Atemu commented Sep 22, 2024

@wineee can I leave this one to you? You appear to have experience with this package.

@wineee wineee mentioned this pull request Sep 24, 2024
@rennsax
Copy link
Member Author

rennsax commented Sep 25, 2024

@wineee If you DO NOT want to use the submodules in xmake repo to build it (which is totally correct, just like the author of xmake did for Homebrew), please at least add broken = true to xmake. They are not well-tested and only available on your environment. And you should not add xmake-core-sv to Nixpkgs, because there is already libsv. Leave them in your NUR.

@rennsax
Copy link
Member Author

rennsax commented Sep 25, 2024

I've tried to build xmake with dependencies already available on Nixpkgs. And frankly speaking it's really ugly and unnecessary, Because the author of xmake uses such a hacky build system.

For example, tboox/tbox is a C library, and it has specified configure options for xmake. Hard-coding these options like you did in tbox/default.nix is not generic, and you cannot expect the upstream keeps the same options all the time.

Not to say, adding a package like xmake-core-sv in the top-level is totally unnecessary.

The goal of Nixpkgs is not making software packing so idiosyncratic and complex. It will tremendously hurt user experience when they find the software is either unavailable, or behave weirdly compared to the same one provided by another package manager.

@ofborg ofborg bot requested a review from wineee September 25, 2024 06:12
@rennsax rennsax marked this pull request as ready for review September 26, 2024 01:45
@wineee
Copy link
Member

wineee commented Sep 26, 2024

Please rebase and change commit message to: xmake: 2.9.4 -> 2.9.5

@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Sep 26, 2024
@rennsax
Copy link
Member Author

rennsax commented Sep 26, 2024

Done. Thanks for reviewing.

@wineee wineee changed the title xmake: rewrite xmake: 2.9.4 -> 2.9.5 Sep 26, 2024
@wineee wineee added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 26, 2024
@wineee
Copy link
Member

wineee commented Sep 26, 2024

Build failed on x86_64-darwin:

In file included from core/src/tbox/tbox/src/tbox/platform/file.c:41:
core/src/tbox/tbox/src/tbox/platform/posix/file.c:697:34: error: use of undeclared identifier 'UTIME_OMIT'
            else ts[0].tv_nsec = UTIME_OMIT;
                                 ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:699:34: error: use of undeclared identifier 'UTIME_OMIT'
            else ts[1].tv_nsec = UTIME_OMIT;
                                 ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:700:19: error: call to undeclared function 'utimensat'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
            ok = !utimensat(AT_FDCWD, path, ts, 0);
                  ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:715:38: error: use of undeclared identifier 'UTIME_OMIT'
                else ts[0].tv_nsec = UTIME_OMIT;
                                     ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:717:38: error: use of undeclared identifier 'UTIME_OMIT'
                else ts[1].tv_nsec = UTIME_OMIT;
                                     ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:718:23: error: call to undeclared function 'futimens'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                ok = !futimens(tb_file2fd(file), ts);
                      ^
6 errors generated.

https://logs.ofborg.org/?key=nixos/nixpkgs.343185&attempt_id=e2479983-f76a-4d28-a737-c1bc19a2ce6b

@wineee wineee removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 26, 2024
@rennsax
Copy link
Member Author

rennsax commented Sep 26, 2024

Build failed on x86_64-darwin:

In file included from core/src/tbox/tbox/src/tbox/platform/file.c:41:
core/src/tbox/tbox/src/tbox/platform/posix/file.c:697:34: error: use of undeclared identifier 'UTIME_OMIT'
            else ts[0].tv_nsec = UTIME_OMIT;
                                 ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:699:34: error: use of undeclared identifier 'UTIME_OMIT'
            else ts[1].tv_nsec = UTIME_OMIT;
                                 ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:700:19: error: call to undeclared function 'utimensat'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
            ok = !utimensat(AT_FDCWD, path, ts, 0);
                  ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:715:38: error: use of undeclared identifier 'UTIME_OMIT'
                else ts[0].tv_nsec = UTIME_OMIT;
                                     ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:717:38: error: use of undeclared identifier 'UTIME_OMIT'
                else ts[1].tv_nsec = UTIME_OMIT;
                                     ^
core/src/tbox/tbox/src/tbox/platform/posix/file.c:718:23: error: call to undeclared function 'futimens'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                ok = !futimens(tb_file2fd(file), ts);
                      ^
6 errors generated.

logs.ofborg.org?key=nixos/nixpkgs.343185&attempt_id=e2479983-f76a-4d28-a737-c1bc19a2ce6b

Surprising 🙁 I'll test it later.

@rennsax
Copy link
Member Author

rennsax commented Sep 26, 2024

Find the reason and a related post: #338695

utimensat requires macOS SDK >= 10.13 but Nixpkgs will stick to 10.12.2 for x86_64-darwin until the release of 25.05.

Solution: https://github.com/NixOS/nixpkgs/blob/master/doc/stdenv/platform-notes.chapter.md

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4fb008387e5c..50305ee41136 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -18916,7 +18916,7 @@ with pkgs;
 
   webdis = callPackage ../development/tools/database/webdis { };
 
-  xmake = callPackage ../development/tools/build-managers/xmake {
+  xmake = darwin.apple_sdk_11_0.callPackage ../development/tools/build-managers/xmake {
     inherit (darwin.apple_sdk.frameworks) CoreServices;
   };

@wineee Add a new commit, or rebase and override the old commits?

@wineee
Copy link
Member

wineee commented Sep 26, 2024

Add a new commit: xmake: fix buildon x86_64 darwin

Also should use same sdk for CoreServices:

--     inherit (darwin.apple_sdk.frameworks) CoreServices;
++     inherit (darwin.apple_sdk_11_0.frameworks) CoreServices;

xmake requires macOS SDK >= 10.13.0, but Nixpkgs sticks to macOS 10.12.0 for
x86_64-darwin now. Use 11.0 SDK as recommended by the doc.
@ofborg ofborg bot requested a review from wineee September 26, 2024 12:16
@wineee wineee merged commit de38446 into NixOS:master Sep 27, 2024
34 of 35 checks passed
@rennsax
Copy link
Member Author

rennsax commented Sep 27, 2024

Thanks

@rennsax rennsax mentioned this pull request Sep 29, 2024
@wineee wineee mentioned this pull request Oct 11, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: clean-up 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants