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

swift language support requires tweaking on unstable #514

Closed
hurricanehrndz opened this issue Mar 31, 2023 · 5 comments
Closed

swift language support requires tweaking on unstable #514

hurricanehrndz opened this issue Mar 31, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@hurricanehrndz
Copy link

Describe the bug
swift build fails on unstable

To Reproduce

language.swift.enable = true;

Version

Added via flake inputs

@hurricanehrndz hurricanehrndz added the bug Something isn't working label Mar 31, 2023
@hurricanehrndz
Copy link
Author

hurricanehrndz commented Apr 1, 2023

I believe issue: #507 is related, closing because it is essentially a duplicate

@hurricanehrndz
Copy link
Author

Sorry reopening because unsure if #507 is going to get merged. Additionally, when testing the patch in #507 it didn't resolve the issue:

Here is my shell definition:

{
  pkgs,
  inputs,
}: let
#   inherit (pkgs) mkShell;
# in
#   mkShell {
#     nativeBuildInputs = with pkgs; [swift swiftpm];
#   }

    inherit (inputs.devenv.lib) mkShell;
in
  mkShell {
    inherit inputs pkgs;
    modules = [
      ({
        config,
        pkgs,
        ...
      }:
        {
          packages = with pkgs; [swift swiftpm];
          languages.swift.enable = true;
        }
        // pkgs.lib.optionals pkgs.stdenv.isDarwin {
          packages = [
            pkgs.swiftPackages.Foundation
          ];
          env.CFLAGS = [" -iframework ${config.env.DEVENV_PROFILE}/Library/Frameworks"];
        })
    ];
  }

Here is direnv file
.envrc

use flake $HOME/src/me/nixcfg#swift --impure

Here is the error I get:

❯ direnv reload
direnv: loading ~/src/me/test/greeting/.envrc
direnv: using flake /Users/chernand/src/me/nixcfg#swift --impure
direnv: nix-direnv: renewed cache
direnv: export +CC +CFLAGS +C_INCLUDE_PATH +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_STATE +IN_NIX_SHELL +LD_LIBRARY_PATH +LIBRARY_PATH +PKG_CONFIG_PATH +name ~PATH ~XDG_CONFIG_DIRS ~XDG_DATA_DIRS

me/test/greeting via 🐦 v5.7.3 via ❄️  impure (devenv-shell-env) took 2s
❯ swift build
error: 'greeting': Invalid manifest
/Users/chernand/src/me/test/greeting/Package.swift:4:8: error: missing required module 'Foundation'
import PackageDescription
       ^
error: ExitCode(rawValue: 1)
[0/1] Planning builderror: 'greeting': Invalid manifest
/Users/chernand/src/me/test/greeting/Package.swift:4:8: error: missing required module 'Foundation'
import PackageDescription
       ^

@hurricanehrndz
Copy link
Author

Please let me know if there is any additional information I can provide. Also the working shell definition is commented.

@domenkozar
Copy link
Member

Could you give it a try now? It should be fixed.

@domenkozar
Copy link
Member

This should be fixed, please reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants