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

Update Vulkan packages #55959

Merged
merged 7 commits into from Mar 30, 2019
Merged

Update Vulkan packages #55959

merged 7 commits into from Mar 30, 2019

Conversation

Ralith
Copy link
Contributor

@Ralith Ralith commented Feb 17, 2019

Motivation for this change

This brings us up to the latest loader/tools/validation layers, and switches from git builds to stable releases for glslang and spirv-tools.

glslang is handled a bit oddly because it has three different sources, all of which must be overridden simultaneously by e.g. vulkan-validation-layers. I'd prefer to do this in a way that uses the overrideAttrs pattern and doesn't force callers to invoke callPackage and thereby complicate overriding dependencies, but it's not clear to me how to do that.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Ralith
Copy link
Contributor Author

Ralith commented Feb 17, 2019

cc @alyssais

@alyssais
Copy link
Member

Why the ping, sorry?

@Ralith
Copy link
Contributor Author

Ralith commented Feb 19, 2019

This attempts to address the stability issues we previously discussed in #51672.

@dywedir dywedir mentioned this pull request Feb 21, 2019
10 tasks
@alyssais
Copy link
Member

alyssais commented Feb 22, 2019

glslang is handled a bit oddly because it has three different sources, all of which must be overridden simultaneously by e.g. vulkan-validation-layers. I'd prefer to do this in a way that uses the overrideAttrs pattern and doesn't force callers to invoke callPackage and thereby complicate overriding dependencies, but it's not clear to me how to do that.

I'd do it like this:

glslang.override {
  spirv-tools = …;
}.overrideAttrs ({ ... }: {
  version = …;
  src = fetchFromGitHub { … };
})

@Ralith
Copy link
Contributor Author

Ralith commented Feb 22, 2019

The stable releases of spirv-* aren't used by the stable release of glslang. If we override them within glslang's expression, then downstream packages which need different overrides break, and it's not clear to me how to write a wrapper expression that's better than what I've already got here.

@Ralith
Copy link
Contributor Author

Ralith commented Mar 8, 2019

Any thoughts? Was hoping to get this in for 19.03.

@alyssais
Copy link
Member

alyssais commented Mar 17, 2019 via email

@Ralith
Copy link
Contributor Author

Ralith commented Mar 17, 2019

If the glslang expression looks like:

{ spirv-headers, ... }:
let spirv-headers = spirv-headers.overrideAttrs (...);
...

then a caller cannot usefully do

glslang.override { spirv-headers = spirv-headers.overrideAttrs (...); }

because the override will be clobbered inside glslang's expression. Unfortunately, the stable version of spirv-*, the versions of spirv-* used by the stable version of glslang itself, and the versions of spirv-* used with glslang by packages that depend on glslang are all different.

@Ralith
Copy link
Contributor Author

Ralith commented Mar 18, 2019

One option would be to pass the necessary overridden dependencies in from all-packages.nix; this would be unconventional, and take up a lot more space in an already-massive file, but it'd allow for a more conventional structure.

@Ralith
Copy link
Contributor Author

Ralith commented Mar 19, 2019

The latest commit fixes a regression I discovered that's present in master (and presumably 19.03). It can be easily worked around by depending on vulkan-headers directly. Perhaps we should be using propagatedBuildInputs for that in the first place?

@alyssais
Copy link
Member

alyssais commented Mar 20, 2019 via email

@Ralith
Copy link
Contributor Author

Ralith commented Mar 20, 2019

In all-packages.nix:

glslang = callPackage ../development/compilers/glslang {
  spirv-tools = spirv-tools.overrideAttrs (_: {
    src = fetchFromGitHub { ... };
  });
  spirv-headers = spirv-tools.overrideAttrs (_: {
    src = fetchFromGitHub { ... };
  });
};

Then glslang/default.nix would be totally conventional.

@alyssais
Copy link
Member

alyssais commented Mar 21, 2019 via email

@Ralith
Copy link
Contributor Author

Ralith commented Mar 21, 2019

Drafted the proposed changes, and further bumped the versions while I was at it.

@Ralith
Copy link
Contributor Author

Ralith commented Mar 30, 2019

Is this blocked?

These now live in vulkan-headers.
@infinisil
Copy link
Member

As discussed with @Ralith on IRC, I don't think we need to include these headers just for backwards compatibility. They were removed from vulkan-loader upstream some time ago, it's up to the people using it to read the release notes that the headers aren't included anymore.

@infinisil infinisil merged commit c1e2855 into NixOS:master Mar 30, 2019
@Ralith Ralith deleted the vulkan branch March 30, 2019 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants