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

Cannot build #44

Open
zDEFz opened this issue Oct 17, 2023 · 7 comments
Open

Cannot build #44

zDEFz opened this issue Oct 17, 2023 · 7 comments

Comments

@zDEFz
Copy link

zDEFz commented Oct 17, 2023

Tried:

  • nix build github:jumper149/ssbm-nix/mbedtls2#slippi-netplay
    Result:
error: builder for '/nix/store/944zhnzwjgy2c2jmdzqicsh94cikjady-slippi-ishiiruka-3.3.0-netplay.drv' failed with exit code 2;
       last 10 log lines:
       > gcc-ranlib libglslang.a
       > /build/source/Source/Core/Common/Logging/LogManager.cpp:35:6: warning: no previous declaration for 'void SlippiRustExtensionsLogger(int, int, const char*)' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmissing-declarations-Wmissing-declarations8;;]
       >    35 | void SlippiRustExtensionsLogger(int level, int slp_log_type, const char *msg)
       >       |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
       > [ 34%] Built target glslang
       > [ 34%] Linking CXX static library libcommon.a
       > gcc-ar qc libcommon.a CMakeFiles/common.dir/Analytics.cpp.o CMakeFiles/common.dir/BreakPoints.cpp.o CMakeFiles/common.dir/CDUtils.cpp.o CMakeFiles/common.dir/ColorUtil.cpp.o CMakeFiles/common.dir/ENetUtil.cpp.o CMakeFiles/common.dir/FileSearch.cpp.o CMakeFiles/common.dir/FileUtil.cpp.o CMakeFiles/common.dir/GekkoDisassembler.cpp.o CMakeFiles/common.dir/Hash.cpp.o CMakeFiles/common.dir/IniFile.cpp.o CMakeFiles/common.dir/JitRegister.cpp.o CMakeFiles/common.dir/MathUtil.cpp.o CMakeFiles/common.dir/MemArena.cpp.o CMakeFiles/common.dir/MemoryUtil.cpp.o CMakeFiles/common.dir/Misc.cpp.o CMakeFiles/common.dir/MsgHandler.cpp.o CMakeFiles/common.dir/NandPaths.cpp.o CMakeFiles/common.dir/Network.cpp.o CMakeFiles/common.dir/PcapFile.cpp.o CMakeFiles/common.dir/PerformanceCounter.cpp.o CMakeFiles/common.dir/Profiler.cpp.o CMakeFiles/common.dir/SettingsHandler.cpp.o CMakeFiles/common.dir/SDCardUtil.cpp.o CMakeFiles/common.dir/StringUtil.cpp.o CMakeFiles/common.dir/SymbolDB.cpp.o CMakeFiles/common.dir/SysConf.cpp.o CMakeFiles/common.dir/Thread.cpp.o CMakeFiles/common.dir/Timer.cpp.o CMakeFiles/common.dir/TraversalClient.cpp.o CMakeFiles/common.dir/Version.cpp.o CMakeFiles/common.dir/x64ABI.cpp.o CMakeFiles/common.dir/x64Analyzer.cpp.o CMakeFiles/common.dir/x64Emitter.cpp.o CMakeFiles/common.dir/MD5.cpp.o CMakeFiles/common.dir/Crypto/bn.cpp.o CMakeFiles/common.dir/Crypto/ec.cpp.o CMakeFiles/common.dir/Logging/LogManager.cpp.o CMakeFiles/common.dir/Logging/ConsoleListenerNix.cpp.o CMakeFiles/common.dir/x64FPURoundMode.cpp.o CMakeFiles/common.dir/x64CPUDetect.cpp.o CMakeFiles/common.dir/GL/GLUtil.cpp.o CMakeFiles/common.dir/GL/GLExtensions/GLExtensions.cpp.o CMakeFiles/common.dir/GL/GLInterface/GLInterface.cpp.o CMakeFiles/common.dir/GL/GLInterface/GLX.cpp.o CMakeFiles/common.dir/GL/GLInterface/X11_Util.cpp.o
       > gcc-ranlib libcommon.a
       > [ 34%] Built target common
       > make: *** [Makefile:166: all] Error 2
       For full logs, run 'nix log /nix/store/944zhnzwjgy2c2jmdzqicsh94cikjady-slippi-ishiiruka-3.3.0-netplay.drv'.
error: 1 dependencies of derivation '/nix/store/zmv4sbpfrs3x6bw3q8gs5d85f0kj1zd3-slippi-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/njljfsxnbg693wlyksm50b5l8r0j6gh2-home-manager-files.drv' failed to build
error: 1 dependencies of derivation '/nix/store/dbk58fvl76wyfhj2kchj4bdk4j284mai-home-manager-generation.drv' failed to build

nix build github:djanatyn/ssbm-nix

error: flake 'github:djanatyn/ssbm-nix' does not provide attribute 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'

flake.nix

{
  description = "Home Manager configuration of blu";

  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
    home-manager = {
      url = "github:nix-community/home-manager/release-23.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    ssbm-nix = { # nix need to know where to look for ssbm-nix
      url = "github:djanatyn/ssbm-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, home-manager, ssbm-nix, ... }:
    let
      system = "x86_64-linux";
      pkgs=import nixpkgs{
  inherit system;
  overlays = [ssbm-nix.overlay];
};
    in {
      homeConfigurations."blu" = home-manager.lib.homeManagerConfiguration {
        inherit pkgs;

        # Specify your home configuration modules here, for example,
        # the path to your home.nix.
        modules = [ 
          ./home.nix
          ssbm-nix.homeManagerModule #and you also need tell it to include the module
        ];

        # Optionally use extraSpecialArgs
        # to pass through arguments to home.nix
      };
    };
}

home.nix

{ config, pkgs, ... }:

{
  # Home Manager needs a bit of information about you and the paths it should
  # manage.
  home.username = "blu";
  home.homeDirectory = "/home/blu";

  # This value determines the Home Manager release that your configuration is
  # compatible with. This helps avoid breakage when a new Home Manager release
  # introduces backwards incompatible changes.
  #
  # You should not change this value, even if you update Home Manager. If you do
  # want to update the value, then make sure to first check the Home Manager
  # release notes.
  home.stateVersion = "23.05"; # Please read the comment before changing.

  # The home.packages option allows you to install Nix packages into your
  # environment.
  home.packages = [
    # # Adds the 'hello' command to your environment. It prints a friendly
    # # "Hello, world!" when run.
    # pkgs.hello

    # # It is sometimes useful to fine-tune packages, for example, by applying
    # # overrides. You can do that directly here, just don't forget the
    # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
    # # fonts?
    # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })

    # # You can also create simple shell scripts directly inside your
    # # configuration. For example, this adds a command 'my-hello' to your
    # # environment:
    # (pkgs.writeShellScriptBin "my-hello" ''
    #   echo "Hello, ${config.home.username}!"
    # '')
  ];

  # Home Manager is pretty good at managing dotfiles. The primary way to manage
  # plain files is through 'home.file'.
  home.file = {
    # # Building this configuration will create a copy of 'dotfiles/screenrc' in
    # # the Nix store. Activating the configuration will then make '~/.screenrc' a
    # # symlink to the Nix store copy.
    # ".screenrc".source = dotfiles/screenrc;

    # # You can also set the file content immediately.
    # ".gradle/gradle.properties".text = ''
    #   org.gradle.console=verbose
    #   org.gradle.daemon.idletimeout=3600000
    # '';
  };

  # You can also manage environment variables but you will have to manually
  # source
  #
  #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
  #
  # or
  #
  #  /etc/profiles/per-user/blu/etc/profile.d/hm-session-vars.sh
  #
  # if you don't want to manage your shell through Home Manager.
  home.sessionVariables = {
    # EDITOR = "emacs";
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

# ssbm.slippi-launcher= {
#   enable = true;
#   # Replace with the path to your Melee ISO
#   isoPath = "Path/To/SSBM.ciso";
# };

   
}
@lytedev
Copy link

lytedev commented Oct 18, 2023

    ssbm-nix = { # nix need to know where to look for ssbm-nix
      url = "github:djanatyn/ssbm-nix";
      inputs.nixpkgs.follows = "nixpkgs";

I believe this could force ssbm-nix to use nixpkgs it is not compatible with which is likely the cause of your compilation errors. If you get rid of inputs.nixpkgs.follows = "nixpkgs"; does it work?

@zDEFz
Copy link
Author

zDEFz commented Oct 18, 2023

edit
nix run github:lytedev/ssbm-nix#slippi-netplay works
but url = "github:lytedev/ssbm-nix#slippi-netplay"; seems invalid syntax!
I think I have to edit the URL to that?

    ssbm-nix = { # nix need to know where to look for ssbm-nix
      url = "github:djanatyn/ssbm-nix";
      inputs.nixpkgs.follows = "nixpkgs";

I believe this could force ssbm-nix to use nixpkgs it is not compatible with which is likely the cause of your compilation errors. If you get rid of inputs.nixpkgs.follows = "nixpkgs"; does it work?

No its the exact same - and this is a fresh install... first time nixos...

       > gcc-ranlib libglslang.a
       > [ 34%] Linking CXX static library libcommon.a
       > [ 34%] Built target glslang
       > gcc-ar qc libcommon.a CMakeFiles/common.dir/Analytics.cpp.o CMakeFiles/common.dir/BreakPoints.cpp.o CMakeFiles/common.dir/CDUtils.cpp.o CMakeFiles/common.dir/ColorUtil.cpp.o CMakeFiles/common.dir/ENetUtil.cpp.o CMakeFiles/common.dir/FileSearch.cpp.o CMakeFiles/common.dir/FileUtil.cpp.o CMakeFiles/common.dir/GekkoDisassembler.cpp.o CMakeFiles/common.dir/Hash.cpp.o CMakeFiles/common.dir/IniFile.cpp.o CMakeFiles/common.dir/JitRegister.cpp.o CMakeFiles/common.dir/MathUtil.cpp.o CMakeFiles/common.dir/MemArena.cpp.o CMakeFiles/common.dir/MemoryUtil.cpp.o CMakeFiles/common.dir/Misc.cpp.o CMakeFiles/common.dir/MsgHandler.cpp.o CMakeFiles/common.dir/NandPaths.cpp.o CMakeFiles/common.dir/Network.cpp.o CMakeFiles/common.dir/PcapFile.cpp.o CMakeFiles/common.dir/PerformanceCounter.cpp.o CMakeFiles/common.dir/Profiler.cpp.o CMakeFiles/common.dir/SettingsHandler.cpp.o CMakeFiles/common.dir/SDCardUtil.cpp.o CMakeFiles/common.dir/StringUtil.cpp.o CMakeFiles/common.dir/SymbolDB.cpp.o CMakeFiles/common.dir/SysConf.cpp.o CMakeFiles/common.dir/Thread.cpp.o CMakeFiles/common.dir/Timer.cpp.o CMakeFiles/common.dir/TraversalClient.cpp.o CMakeFiles/common.dir/Version.cpp.o CMakeFiles/common.dir/x64ABI.cpp.o CMakeFiles/common.dir/x64Analyzer.cpp.o CMakeFiles/common.dir/x64Emitter.cpp.o CMakeFiles/common.dir/MD5.cpp.o CMakeFiles/common.dir/Crypto/bn.cpp.o CMakeFiles/common.dir/Crypto/ec.cpp.o CMakeFiles/common.dir/Logging/LogManager.cpp.o CMakeFiles/common.dir/Logging/ConsoleListenerNix.cpp.o CMakeFiles/common.dir/x64FPURoundMode.cpp.o CMakeFiles/common.dir/x64CPUDetect.cpp.o CMakeFiles/common.dir/GL/GLUtil.cpp.o CMakeFiles/common.dir/GL/GLExtensions/GLExtensions.cpp.o CMakeFiles/common.dir/GL/GLInterface/GLInterface.cpp.o CMakeFiles/common.dir/GL/GLInterface/GLX.cpp.o CMakeFiles/common.dir/GL/GLInterface/X11_Util.cpp.o
       > gcc-ranlib libcommon.a
       > [ 34%] Built target common
       > make: *** [Makefile:166: all] Error 2
       For full logs, run 'nix log /nix/store/icz61fnfpwgnss871ybjxip3v21ibakn-slippi-ishiiruka-3.3.1-netplay.drv'.
error: 1 dependencies of derivation '/nix/store/gdnrv32ail0ywgq43n58025ydfr4mkxl-slippi-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/i27lcg9nilhbqw90qqrabc4ag4j9zinw-home-manager-files.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mh2sxfsav18rz67c9xvscfs4148lnrvj-home-manager-generation.drv' failed to build
blu@mainrig-MS-7D51:~ $                                                                                                           

@lytedev
Copy link

lytedev commented Oct 18, 2023

From within a flake you can only reference another flake, not a flake attribute.

Also, I'm not sure it works without the nixpkgs overlay, which it looks like you are missing?

@zDEFz
Copy link
Author

zDEFz commented Oct 18, 2023

From within a flake you can only reference another flake, not a flake attribute.

Also, I'm not sure it works without the nixpkgs overlay, which it looks like you are missing?

I am new to NixOS - it would be nice to have a installation guide in this project for NixOS - I am not understanding what I'm doing.

@zDEFz
Copy link
Author

zDEFz commented Oct 19, 2023

@lytedev could it be I am lacking dependencies? If so, which could they be?
I mean I can partially build, just not fully.

@lytedev
Copy link

lytedev commented Oct 24, 2023

I'm still new, too. This flake.nix seems to work. All I really changed was that nixpkgs and home-manager are using the nixos-unstable and master branches respectively. I would expect the ssbm-nix flake to use its own nixpkgs, so I'm guessing something is wrong with the way the flake is put together.

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  inputs.home-manager.url = "github:nix-community/home-manager/master";
  inputs.ssbm-nix.url = "github:lytedev/ssbm-nix";
  outputs = {home-manager, ssbm-nix, nixpkgs, ...}: {
    homeConfigurations."blu" = home-manager.lib.homeManagerConfiguration {
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        overlays = [ssbm-nix.overlay];
      };
      modules = [
        ./home.nix
        ssbm-nix.homeManagerModule
      ];
    };
  };
}

You can always run the application using nix run as above as well.

@lytedev
Copy link

lytedev commented Oct 24, 2023

Ah I'm silly! I realize that since we're using the ssbm-nix homeManagerModule, the pkgs we define in the homeManagerConfiguration will of course propagate to the module, and so it will not use the right packages. There's probably a way to force the module to use its own nixpkgs like so, but I'm not sure what that would be off the top of my head.

But ultimately we should probably have the NixOS and homeManager modules use their own nixpkgs since we know that's what they should build with. I'm not sure what the standard expectation is here for modules here, though.

For now, I'll update my fork to do this and then folks using stable nixpkgs should be able to use the flake just fine. Stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants