diff --git a/doc/languages-frameworks/go.section.md b/doc/languages-frameworks/go.section.md index 6db0e73505d2..2f4cb0326a8a 100644 --- a/doc/languages-frameworks/go.section.md +++ b/doc/languages-frameworks/go.section.md @@ -142,6 +142,7 @@ Many attributes [controlling the build phase](#variables-controlling-the-build-p - [`patchFlags`](#var-stdenv-patchFlags) - [`postPatch`](#var-stdenv-postPatch) - [`preBuild`](#var-stdenv-preBuild) +- `env`: useful for passing down variables such as `GOWORK`. To control test execution of the build derivation, the following attributes are of interest: diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 22eee41d3e5b..a84b56b119d0 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5019,6 +5019,12 @@ github = "DimitarNestorov"; githubId = 8790386; }; + diniamo = { + name = "diniamo"; + email = "diniamo53@gmail.com"; + github = "diniamo"; + githubId = 55629891; + }; diogotcorreia = { name = "Diogo Correia"; email = "me@diogotc.com"; @@ -8689,6 +8695,12 @@ githubId = 137306; name = "Michele Catalano"; }; + isabelroses = { + email = "isabel@isabelroses.com"; + github = "isabelroses"; + githubId = 71222764; + name = "Isabel Roses"; + }; isaozler = { email = "isaozler@gmail.com"; github = "isaozler"; diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index faa0b9b10f59..9fcfd6defc57 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -74,6 +74,8 @@ Use `services.pipewire.extraConfig` or `services.pipewire.configPackages` for Pi - Plasma 6 is now available and can be installed with `services.xserver.desktopManager.plasma6.enable = true;`. Plasma 5 will likely be deprecated in the next release (24.11). Note that Plasma 6 runs as Wayland by default, and the X11 session needs to be explicitly selected if necessary. +- The desktop mode of Lomiri (formerly known as Unity8), using Mir 2.x to function as a Wayland compositor, is now available and can be installed with `services.desktopManager.lomiri.enable = true`. Note that some core applications, services and indicators have yet to be packaged, and some functions may remain incomplete, but the base experience should be there. + ## New Services {#sec-release-24.05-new-services} @@ -315,6 +317,12 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - The `cudaPackages` package scope has been updated to `cudaPackages_12`. +- The deprecated `cudaPackages.cudatoolkit` has been replaced with a + symlink-based wrapper for the splayed redistributable CUDA packages. The + wrapper only includes tools and libraries necessary to build common packages + like e.g. tensorflow. The original runfile-based `cudatoolkit` is still + available as `cudatoolkit-legacy-runfile`. + - The `halloy` package was updated past 2024.5 which introduced a breaking change by switching the config format from YAML to TOML. See https://github.com/squidowl/halloy/releases/tag/2024.5 for details. - Ada packages (libraries and tools) have been moved into the `gnatPackages` scope. `gnatPackages` uses the default GNAT compiler, `gnat12Packages` and `gnat13Packages` use the respective matching compiler version. diff --git a/nixos/modules/services/desktop-managers/lomiri.nix b/nixos/modules/services/desktop-managers/lomiri.nix new file mode 100644 index 000000000000..469144aef4e0 --- /dev/null +++ b/nixos/modules/services/desktop-managers/lomiri.nix @@ -0,0 +1,165 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.services.desktopManager.lomiri; +in { + options.services.desktopManager.lomiri = { + enable = lib.mkEnableOption '' + the Lomiri graphical shell (formerly known as Unity8) + ''; + }; + + config = lib.mkIf cfg.enable { + environment = { + systemPackages = (with pkgs; [ + glib # XDG MIME-related tools identify it as GNOME, add gio for MIME identification to work + libayatana-common + ubports-click + ]) ++ (with pkgs.lomiri; [ + content-hub + hfd-service + history-service + libusermetrics + lomiri + lomiri-download-manager + lomiri-schemas # exposes some required dbus interfaces + lomiri-session # wrappers to properly launch the session + lomiri-sounds + lomiri-system-settings + lomiri-terminal-app + lomiri-thumbnailer + lomiri-url-dispatcher + lomiri-wallpapers + mediascanner2 # TODO possibly needs to be kicked off by graphical-session.target + morph-browser + qtmir # not having its desktop file for Xwayland available causes any X11 application to crash the session + suru-icon-theme + telephony-service + ]); + }; + + systemd.packages = with pkgs.lomiri; [ + hfd-service + lomiri-download-manager + ]; + + services.dbus.packages = with pkgs.lomiri; [ + hfd-service + libusermetrics + lomiri-download-manager + ]; + + fonts.packages = with pkgs; [ + # Applications tend to default to Ubuntu font + ubuntu_font_family + ]; + + # Copy-pasted basic stuff + hardware.opengl.enable = lib.mkDefault true; + fonts.enableDefaultPackages = lib.mkDefault true; + programs.dconf.enable = lib.mkDefault true; + + # Xwayland is partly hardcoded in Mir so it can't really be fully turned off, and it must be on PATH for X11 apps *and Lomiri's web browser* to work. + # Until Mir/Lomiri can be properly used without it, force it on so everything behaves as expected. + programs.xwayland.enable = lib.mkForce true; + + services.accounts-daemon.enable = true; + + services.ayatana-indicators = { + enable = true; + packages = (with pkgs; [ + ayatana-indicator-datetime + ayatana-indicator-messages + ayatana-indicator-session + ]) ++ (with pkgs.lomiri; [ + telephony-service + ]); + }; + + services.udisks2.enable = true; + services.upower.enable = true; + services.geoclue2.enable = true; + + services.gnome.evolution-data-server = { + enable = true; + plugins = with pkgs; [ + # TODO: lomiri.address-book-service + ]; + }; + + services.telepathy.enable = true; + + services.displayManager = { + defaultSession = lib.mkDefault "lomiri"; + sessionPackages = with pkgs.lomiri; [ lomiri-session ]; + }; + + services.xserver = { + enable = lib.mkDefault true; + displayManager.lightdm = { + enable = lib.mkDefault true; + greeters.lomiri.enable = lib.mkDefault true; + }; + }; + + environment.pathsToLink = [ + # Configs for inter-app data exchange system + "/share/content-hub/peers" + # Configs for inter-app URL requests + "/share/lomiri-url-dispatcher/urls" + # Splash screens & other images for desktop apps launched via lomiri-app-launch + "/share/lomiri-app-launch" + # TODO Try to get maliit stuff working + "/share/maliit/plugins" + # Data + "/share/locale" # TODO LUITK hardcoded default locale path, fix individual apps to not rely on it + "/share/sounds" + "/share/wallpapers" + ]; + + systemd.user.services = { + # Unconditionally run service that collects system-installed URL handlers before LUD + # TODO also run user-installed one? + "lomiri-url-dispatcher-update-system-dir" = { + description = "Lomiri URL dispatcher system directory updater"; + wantedBy = [ "lomiri-url-dispatcher.service" ]; + before = [ "lomiri-url-dispatcher.service" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.lomiri.lomiri-url-dispatcher}/libexec/lomiri-url-dispatcher/lomiri-update-directory /run/current-system/sw/share/lomiri-url-dispatcher/urls/"; + }; + }; + }; + + systemd.services = { + "dbus-com.lomiri.UserMetrics" = { + serviceConfig = { + Type = "dbus"; + BusName = "com.lomiri.UserMetrics"; + User = "usermetrics"; + StandardOutput = "syslog"; + SyslogIdentifier = "com.lomiri.UserMetrics"; + ExecStart = "${pkgs.lomiri.libusermetrics}/libexec/libusermetrics/usermetricsservice"; + } // lib.optionalAttrs (!config.security.apparmor.enable) { + # Due to https://gitlab.com/ubports/development/core/libusermetrics/-/issues/8, auth must be disabled when not using AppArmor, lest the next database usage breaks + Environment = "USERMETRICS_NO_AUTH=1"; + }; + }; + }; + + users.users.usermetrics = { + group = "usermetrics"; + home = "/var/lib/usermetrics"; + createHome = true; + isSystemUser = true; + }; + + users.groups.usermetrics = { }; + + # TODO content-hub cannot pass files between applications without asking AA for permissions. And alot of the Lomiri stack is designed with AA availability in mind. This might be a requirement to be closer to upstream? + # But content-hub currently fails to pass files between applications even with AA enabled, and we can get away without AA in many places. Let's see how this develops before requiring this for good. + # security.apparmor.enable = true; + }; + + meta.maintainers = lib.teams.lomiri.members; +} diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index e9d51b51f14d..7e707a13b790 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -537,7 +537,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. @@ -609,7 +609,7 @@ let }; promTypes.digitalocean_sd_config = mkSdConfigModule { - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -626,7 +626,7 @@ let ''; }; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from, when `role` is nodes, and for discovered tasks and services that don't have published ports. ''; @@ -687,7 +687,7 @@ let The type of DNS query to perform. One of SRV, A, or AAAA. ''; - port = mkOpt types.int '' + port = mkOpt types.port '' The port number used if the query type is not SRV. ''; @@ -731,7 +731,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. @@ -840,7 +840,7 @@ let ''; }; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -999,7 +999,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. ''; @@ -1007,7 +1007,7 @@ let }; promTypes.linode_sd_config = mkSdConfigModule { - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -1148,7 +1148,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. ''; @@ -1193,7 +1193,7 @@ let Refresh interval to re-read the resources list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; }; @@ -1231,7 +1231,7 @@ let ''; }; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -1307,7 +1307,7 @@ let If omitted all containers owned by the requesting account are scraped. ''; - port = mkDefOpt types.int "9163" '' + port = mkDefOpt types.port "9163" '' The port to use for discovery and metric scraping. ''; diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix index 621a44ad123c..6fe606f92267 100644 --- a/nixos/modules/services/x11/desktop-managers/default.nix +++ b/nixos/modules/services/x11/desktop-managers/default.nix @@ -21,7 +21,7 @@ in ./none.nix ./xterm.nix ./phosh.nix ./xfce.nix ./plasma5.nix ../../desktop-managers/plasma6.nix ./lumina.nix ./lxqt.nix ./enlightenment.nix ./gnome.nix ./retroarch.nix ./kodi.nix ./mate.nix ./pantheon.nix ./surf-display.nix ./cde.nix - ./cinnamon.nix ./budgie.nix ./deepin.nix + ./cinnamon.nix ./budgie.nix ./deepin.nix ../../desktop-managers/lomiri.nix ]; options = { diff --git a/nixos/modules/services/x11/display-managers/lightdm-greeters/lomiri.nix b/nixos/modules/services/x11/display-managers/lightdm-greeters/lomiri.nix new file mode 100644 index 000000000000..0cc79178358b --- /dev/null +++ b/nixos/modules/services/x11/display-managers/lightdm-greeters/lomiri.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +let + + dmcfg = config.services.displayManager; + ldmcfg = config.services.xserver.displayManager.lightdm; + cfg = ldmcfg.greeters.lomiri; + +in +{ + meta.maintainers = lib.teams.lomiri.members; + + options = { + services.xserver.displayManager.lightdm.greeters.lomiri = { + enable = lib.mkEnableOption "lomiri's greeter as the lightdm greeter"; + }; + }; + + config = lib.mkIf (ldmcfg.enable && cfg.enable) { + services.xserver.displayManager.lightdm.greeters.gtk.enable = false; + + services.xserver.displayManager.lightdm.greeter = lib.mkDefault { + package = pkgs.lomiri.lomiri.greeter; + name = "lomiri-greeter"; + }; + + # Greeter needs to be run through its wrapper + # Greeter doesn't work with our set-session.py script, need to set default user-session + services.xserver.displayManager.lightdm.extraSeatDefaults = '' + greeter-wrapper = ${lib.getExe' pkgs.lomiri.lomiri "lomiri-greeter-wrapper"} + user-session = ${dmcfg.defaultSession} + ''; + }; +} diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix index 63561934be08..25e6c597adcb 100644 --- a/nixos/modules/services/x11/display-managers/lightdm.nix +++ b/nixos/modules/services/x11/display-managers/lightdm.nix @@ -81,6 +81,7 @@ in ./lightdm-greeters/mini.nix ./lightdm-greeters/enso-os.nix ./lightdm-greeters/pantheon.nix + ./lightdm-greeters/lomiri.nix ./lightdm-greeters/tiny.nix ./lightdm-greeters/slick.nix ./lightdm-greeters/mobile.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 7944952e2f4e..fd5a0186bdec 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -503,6 +503,7 @@ in { lxd = pkgs.recurseIntoAttrs (handleTest ./lxd { inherit handleTestOn; }); lxd-image-server = handleTest ./lxd-image-server.nix {}; #logstash = handleTest ./logstash.nix {}; + lomiri = handleTest ./lomiri.nix {}; lomiri-system-settings = handleTest ./lomiri-system-settings.nix {}; lorri = handleTest ./lorri/default.nix {}; maddy = discoverTests (import ./maddy { inherit handleTest; }); diff --git a/nixos/tests/lomiri.nix b/nixos/tests/lomiri.nix new file mode 100644 index 000000000000..c1e777873b08 --- /dev/null +++ b/nixos/tests/lomiri.nix @@ -0,0 +1,281 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: let + # Just to make sure everything is the same, need it for OCR & navigating greeter + user = "alice"; + description = "Alice Foobar"; + password = "foobar"; +in { + name = "lomiri"; + + meta = { + maintainers = lib.teams.lomiri.members; + }; + + nodes.machine = { config, ... }: { + imports = [ + ./common/user-account.nix + ]; + + users.users.${user} = { + inherit description password; + }; + + services.desktopManager.lomiri.enable = lib.mkForce true; + services.displayManager.defaultSession = lib.mkForce "lomiri"; + + fonts.packages = [ pkgs.inconsolata ]; + + environment = { + # Help with OCR + etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } { + font = rec { + normal.family = "Inconsolata"; + bold.family = normal.family; + italic.family = normal.family; + bold_italic.family = normal.family; + size = 16; + }; + colors = rec { + primary = { + foreground = "0x000000"; + background = "0xffffff"; + }; + normal = { + green = primary.foreground; + }; + }; + }; + + variables = { + # So we can test what content-hub is working behind the scenes + CONTENT_HUB_LOGGING_LEVEL = "2"; + }; + + systemPackages = with pkgs; [ + # For a convenient way of kicking off content-hub peer collection + lomiri.content-hub.examples + + # Forcing alacritty to run as an X11 app when opened from the starter menu + (symlinkJoin { + name = "x11-${alacritty.name}"; + + paths = [ alacritty ]; + + nativeBuildInputs = [ makeWrapper ]; + + postBuild = '' + wrapProgram $out/bin/alacritty \ + --set WINIT_UNIX_BACKEND x11 \ + --set WAYLAND_DISPLAY "" + ''; + + inherit (alacritty) meta; + }) + ]; + }; + + # Help with OCR + systemd.tmpfiles.settings = let + white = "255, 255, 255"; + black = "0, 0, 0"; + colorSection = color: { + Color = color; + Bold = true; + Transparency = false; + }; + terminalColors = pkgs.writeText "customized.colorscheme" (lib.generators.toINI {} { + Background = colorSection white; + Foreground = colorSection black; + Color2 = colorSection black; + Color2Intense = colorSection black; + }); + terminalConfig = pkgs.writeText "terminal.ubports.conf" (lib.generators.toINI {} { + General = { + colorScheme = "customized"; + fontSize = "16"; + fontStyle = "Inconsolata"; + }; + }); + confBase = "${config.users.users.${user}.home}/.config"; + userDirArgs = { + mode = "0700"; + user = user; + group = "users"; + }; + in { + "10-lomiri-test-setup" = { + "${confBase}".d = userDirArgs; + "${confBase}/terminal.ubports".d = userDirArgs; + "${confBase}/terminal.ubports/customized.colorscheme".L.argument = "${terminalColors}"; + "${confBase}/terminal.ubports/terminal.ubports.conf".L.argument = "${terminalConfig}"; + }; + }; + }; + + enableOCR = true; + + testScript = { nodes, ... }: '' + def open_starter(): + """ + Open the starter, and ensure it's opened. + """ + machine.send_key("meta_l-a") + # Look for any of the default apps + machine.wait_for_text(r"(Search|System|Settings|Morph|Browser|Terminal|Alacritty)") + + def toggle_maximise(): + """ + Send the keybind to maximise the current window. + """ + machine.send_key("ctrl-meta_l-up") + + # For some reason, Lomiri in these VM tests very frequently opens the starter menu a few seconds after sending the above. + # Because this isn't 100% reproducible all the time, and there is no command to await when OCR doesn't pick up some text, + # the best we can do is send some Escape input after waiting some arbitrary time and hope that it works out fine. + machine.sleep(5) + machine.send_key("esc") + machine.sleep(5) + + start_all() + machine.wait_for_unit("multi-user.target") + + # Lomiri in greeter mode should work & be able to start a session + with subtest("lomiri greeter works"): + machine.wait_for_unit("display-manager.service") + # Start page shows current tie + machine.wait_for_text(r"(AM|PM)") + machine.screenshot("lomiri_greeter_launched") + + # Advance to login part + machine.send_key("ret") + machine.wait_for_text("${description}") + machine.screenshot("lomiri_greeter_login") + + # Login + machine.send_chars("${password}\n") + # Best way I can think of to differenciate "Lomiri in LightDM greeter mode" from "Lomiri in user shell mode" + machine.wait_until_succeeds("pgrep -u ${user} -f 'lomiri --mode=full-shell'") + + # The session should start, and not be stuck in i.e. a crash loop + with subtest("lomiri starts"): + # Output rendering from Lomiri has started when it starts printing performance diagnostics + machine.wait_for_console_text("Last frame took") + # Look for datetime's clock, one of the last elements to load + machine.wait_for_text(r"(AM|PM)") + machine.screenshot("lomiri_launched") + + # Working terminal keybind is good + with subtest("terminal keybind works"): + machine.send_key("ctrl-alt-t") + machine.wait_for_text(r"(${user}|machine)") + machine.screenshot("terminal_opens") + + # lomiri-terminal-app has a separate VM test to test its basic functionality + + # for the LSS content-hub test to work reliably, we need to kick off peer collecting + machine.send_chars("content-hub-test-importer\n") + machine.wait_for_text(r"(/build/source|hub.cpp|handler.cpp|void|virtual|const)") # awaiting log messages from content-hub + machine.send_key("ctrl-c") + + machine.send_key("alt-f4") + + # We want the ability to launch applications + with subtest("starter menu works"): + open_starter() + machine.screenshot("starter_opens") + + # Just try the terminal again, we know that it should work + machine.send_chars("Terminal\n") + machine.wait_for_text(r"(${user}|machine)") + machine.send_key("alt-f4") + + # We want support for X11 apps + with subtest("xwayland support works"): + open_starter() + machine.send_chars("Alacritty\n") + machine.wait_for_text(r"(${user}|machine)") + machine.screenshot("alacritty_opens") + machine.send_key("alt-f4") + + # LSS provides DE settings + with subtest("system settings open"): + open_starter() + machine.send_chars("System Settings\n") + machine.wait_for_text("Rotation Lock") + machine.screenshot("settings_open") + + # lomiri-system-settings has a separate VM test, only test Lomiri-specific content-hub functionalities here + + # Make fullscreen, can't navigate to Background plugin via keyboard unless window has non-phone-like aspect ratio + toggle_maximise() + + # Load Background plugin + machine.send_key("tab") + machine.send_key("tab") + machine.send_key("tab") + machine.send_key("tab") + machine.send_key("tab") + machine.send_key("tab") + machine.send_key("ret") + machine.wait_for_text("Background image") + + # Try to load custom background + machine.send_key("shift-tab") + machine.send_key("shift-tab") + machine.send_key("shift-tab") + machine.send_key("shift-tab") + machine.send_key("shift-tab") + machine.send_key("shift-tab") + machine.send_key("ret") + + # Peers should be loaded + machine.wait_for_text("Morph") # or Gallery, but Morph is already packaged + machine.screenshot("settings_content-hub_peers") + + # Sadly, it doesn't seem possible to actually select a peer and attempt a content-hub data exchange with just the keyboard + + machine.send_key("alt-f4") + + # Morph is how we go online + with subtest("morph browser works"): + open_starter() + machine.send_chars("Morph\n") + machine.wait_for_text(r"(Bookmarks|address|site|visited any)") + machine.screenshot("morph_open") + + # morph-browser has a separate VM test, there isn't anything new we could test here + + machine.send_key("alt-f4") + + # The ayatana indicators are an important part of the experience, and they hold the only graphical way of exiting the session. + # Reaching them via the intended way requires wayland mouse control, but ydotool lacks a module for its daemon: + # https://github.com/NixOS/nixpkgs/issues/183659 + # Luckily, there's a test app that also displays their contents, but it's abit inconsistent. Hopefully this is *good-enough*. + with subtest("ayatana indicators work"): + open_starter() + machine.send_chars("Indicators\n") + machine.wait_for_text(r"(Indicators|Client|List|datetime|session)") + machine.screenshot("indicators_open") + + # Element tab order within the indicator menus is not fully deterministic + # Only check that the indicators are listed & their items load + + with subtest("ayatana indicator datetime works"): + # Select ayatana-indicator-datetime + machine.send_key("tab") + machine.send_key("ret") + machine.wait_for_text("Time and Date Settings") + machine.screenshot("indicators_timedate") + + machine.send_key("shift-tab") + machine.send_key("ret") + machine.wait_for_text(r"(Indicators|Client|List|datetime|session)") + + with subtest("ayatana indicator session works"): + # Select ayatana-indicator-session + machine.send_key("tab") + machine.send_key("down") + machine.send_key("ret") + machine.wait_for_text("Log Out") + machine.screenshot("indicators_session") + ''; +}) diff --git a/pkgs/applications/audio/listenbrainz-mpd/default.nix b/pkgs/applications/audio/listenbrainz-mpd/default.nix index 9bf9c35d4bd7..5a7ef4417876 100644 --- a/pkgs/applications/audio/listenbrainz-mpd/default.nix +++ b/pkgs/applications/audio/listenbrainz-mpd/default.nix @@ -14,17 +14,17 @@ rustPlatform.buildRustPackage rec { pname = "listenbrainz-mpd"; - version = "2.3.3"; + version = "2.3.4"; src = fetchFromGitea { domain = "codeberg.org"; owner = "elomatreb"; repo = "listenbrainz-mpd"; rev = "v${version}"; - hash = "sha256-4FNFaVi+fxoXo2tl+bynHqh8yRt0Q4z/El/4m0GXZUY="; + hash = "sha256-QHhSrmBNvUTffPzjns670Tn3Z3UDcDvarq605Qx9k4w="; }; - cargoHash = "sha256-FS7OYzKx/lQh86QQ8Dk9v1JrWUxPHNz3kITiEJ3sNng="; + cargoHash = "sha256-vtU439Pd3zWx+qakh1xTENQhun7S+WsJMndXqPWrPWU="; nativeBuildInputs = [ pkg-config installShellFiles asciidoctor ]; diff --git a/pkgs/applications/editors/android-studio/default.nix b/pkgs/applications/editors/android-studio/default.nix index 2339503977af..5f7b3d259dec 100644 --- a/pkgs/applications/editors/android-studio/default.nix +++ b/pkgs/applications/editors/android-studio/default.nix @@ -18,8 +18,8 @@ let sha256Hash = "sha256-zROBKzQiP4V2P67HgOIkHgn8q/M0zy5MkZozVSiQsWU="; }; latestVersion = { - version = "2024.1.1.2"; # "Android Studio Koala | 2024.1.1 Canary 4" - sha256Hash = "sha256-d/bzgKimps0Tw7GQD9sc2LLDNaVpWlqNTKkuyxKrCWo="; + version = "2024.1.1.3"; # "Android Studio Koala | 2024.1.1 Canary 5" + sha256Hash = "sha256-JL2cloR0RhSnr8e62fHhxIzF286fT9sahTuv2OoQVRY="; }; in { # Attributes are named by their corresponding release channels diff --git a/pkgs/applications/misc/deckmaster/default.nix b/pkgs/applications/misc/deckmaster/default.nix index f977fd1980bb..03e5e05852ad 100644 --- a/pkgs/applications/misc/deckmaster/default.nix +++ b/pkgs/applications/misc/deckmaster/default.nix @@ -17,7 +17,7 @@ buildGoModule rec { hash = "sha256-1hZ7yAKTvkk20ho+QOqFEtspBvFztAtfmITs2uxhdmQ="; }; - vendorHash = "sha256-d38s5sSvENIou+rlphXIrrOcGOdsvkNaMJlhiXVWN6c="; + vendorHash = "sha256-DFssAic2YtXNH1Jm6zCDv1yPNz3YUXaFLs7j7rNHhlE="; proxyVendor = true; diff --git a/pkgs/applications/misc/fuzzel/default.nix b/pkgs/applications/misc/fuzzel/default.nix index 496ef38626bc..8b98b27667b2 100644 --- a/pkgs/applications/misc/fuzzel/default.nix +++ b/pkgs/applications/misc/fuzzel/default.nix @@ -22,16 +22,16 @@ assert svgSupport -> enableCairo; -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "fuzzel"; - version = "1.9.2"; + version = "1.10.0"; src = fetchFromGitea { domain = "codeberg.org"; owner = "dnkl"; - repo = pname; - rev = version; - hash = "sha256-X1P/ghX97KCQcrNk44Cy2IAGuZ8DDwHBWzh1AHLDvd4="; + repo = "fuzzel"; + rev = finalAttrs.version; + hash = "sha256-4wTwsjnmPsg+kc05izeyXilzDO0LpD3g3PRBqgLPK2I="; }; depsBuildBuild = [ @@ -73,4 +73,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ fionera polykernel rodrgz ]; platforms = with platforms; linux; }; -} +}) diff --git a/pkgs/applications/misc/klipper-estimator/default.nix b/pkgs/applications/misc/klipper-estimator/default.nix index 2eff4a1cf08d..243a485c4a52 100644 --- a/pkgs/applications/misc/klipper-estimator/default.nix +++ b/pkgs/applications/misc/klipper-estimator/default.nix @@ -11,16 +11,16 @@ rustPlatform.buildRustPackage rec { pname = "klipper-estimator"; - version = "3.7.1"; + version = "3.7.2"; src = fetchFromGitHub { owner = "Annex-Engineering"; repo = "klipper_estimator"; rev = "v${version}"; - hash = "sha256-zRHV8Bc4+diSfb/hhBxBTaSiZHlKZ9wgd8DZ4Kt6nf0="; + hash = "sha256-OvDdANowsz3qU2KV4WbUWyDrh3sG02+lBKNtcq6ecZ8="; }; - cargoHash = "sha256-zozZuVzn/xYjmP9+B5uzIBuu/rx/tymgvOuiKz617eo="; + cargoHash = "sha256-1O3kXeGPALSa/kNWRArk6ULG0+3UgTxVBzrsqDHHpDU="; buildInputs = [ openssl ] diff --git a/pkgs/applications/misc/pop/default.nix b/pkgs/applications/misc/pop/default.nix index 3fbf063e7315..f20ab86c85c9 100644 --- a/pkgs/applications/misc/pop/default.nix +++ b/pkgs/applications/misc/pop/default.nix @@ -13,7 +13,7 @@ buildGoModule rec { vendorHash = "sha256-8YcJXvR0cdL9PlP74Qh6uN2XZoN16sz/yeeZlBsk5N8="; - GOWORK = "off"; + env.GOWORK = "off"; nativeBuildInputs = [ installShellFiles diff --git a/pkgs/applications/misc/ratt/default.nix b/pkgs/applications/misc/ratt/default.nix index afdc3c231418..fd882b3b572c 100644 --- a/pkgs/applications/misc/ratt/default.nix +++ b/pkgs/applications/misc/ratt/default.nix @@ -11,7 +11,7 @@ buildGoModule rec { }; proxyVendor = true; - vendorHash = "sha256-6cpHDwnxdc/9YPj77JVuT5ZDFjKkF6nBX4RgZr/9fFY="; + vendorHash = "sha256-L8mDs9teQJW6P3dhKSLfzbpA7kzhJk61oR2q0ME+u0M="; # tests try to access the internet to scrape websites doCheck = false; diff --git a/pkgs/applications/misc/skate/default.nix b/pkgs/applications/misc/skate/default.nix index 16849996441f..b344a0e0639e 100644 --- a/pkgs/applications/misc/skate/default.nix +++ b/pkgs/applications/misc/skate/default.nix @@ -12,7 +12,7 @@ buildGoModule rec { }; proxyVendor = true; - vendorHash = "sha256-xNM4qmpv+wcoiGrQ585N3VoKW6tio0cdHmUHRl2Pvio="; + vendorHash = "sha256-/qZB/GGEkoqRoNhEmZw9Q2lsUPZRg5/xVxWgdBZTMLk="; ldflags = [ "-s" "-w" "-X=main.Version=${version}" ]; diff --git a/pkgs/applications/misc/wtf/default.nix b/pkgs/applications/misc/wtf/default.nix index f604f50eb7fc..a32527de7dab 100644 --- a/pkgs/applications/misc/wtf/default.nix +++ b/pkgs/applications/misc/wtf/default.nix @@ -17,7 +17,7 @@ buildGoModule rec { sha256 = "sha256-DFrA4bx+wSOxmt1CVA1oNiYVmcWeW6wpfR5F1tnhyDY="; }; - vendorHash = "sha256-9uuLidieBMoKz/FLcBnp9wenyveOIzB0IvRBRasulZk="; + vendorHash = "sha256-mQdKw3DeBEkCOtV2/B5lUIHv5EBp+8QSxpA13nFxESw="; proxyVendor = true; doCheck = false; diff --git a/pkgs/applications/networking/browsers/ladybird/default.nix b/pkgs/applications/networking/browsers/ladybird/default.nix index 04e786bcaad4..fc81be712441 100644 --- a/pkgs/applications/networking/browsers/ladybird/default.nix +++ b/pkgs/applications/networking/browsers/ladybird/default.nix @@ -151,7 +151,7 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://ladybird.dev"; license = licenses.bsd2; maintainers = with maintainers; [ fgaz ]; - platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; + platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; mainProgram = "Ladybird"; }; }) diff --git a/pkgs/applications/networking/cluster/argocd-autopilot/default.nix b/pkgs/applications/networking/cluster/argocd-autopilot/default.nix index 55028845e2cb..63466a3efdbf 100644 --- a/pkgs/applications/networking/cluster/argocd-autopilot/default.nix +++ b/pkgs/applications/networking/cluster/argocd-autopilot/default.nix @@ -11,7 +11,7 @@ buildGoModule rec { sha256 = "sha256-txbs1SzAaV1nCl104m0Ht5DwzCmK+sBDn4rZ1newdLc="; }; - vendorHash = "sha256-1nolJLWkArzSKf11fzlvvgiCnvMYSu5MHRNAn1lryms="; + vendorHash = "sha256-QbjiQVclT8paEKYQmMwj5MLq40mAVh5Ji5VJJTOmEZI="; proxyVendor = true; diff --git a/pkgs/applications/networking/cluster/atmos/default.nix b/pkgs/applications/networking/cluster/atmos/default.nix index b08f1b524e40..0c371bfac2cd 100644 --- a/pkgs/applications/networking/cluster/atmos/default.nix +++ b/pkgs/applications/networking/cluster/atmos/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "atmos"; - version = "1.68.0"; + version = "1.69.0"; src = fetchFromGitHub { owner = "cloudposse"; repo = pname; rev = "v${version}"; - sha256 = "sha256-tyK45RWLZFC2yLqEvEE/U0QjNaQ0Kwx37BL/5d9Bmdc="; + sha256 = "sha256-H2RyxUeOgIiGpR50sDP6bjZ6BKRB47oLUpdtawSRnmo="; }; vendorHash = "sha256-dJJPq2HcGZ+MqtJ848gsrvzD1rMVrwJQKwq+UpZsFB0="; diff --git a/pkgs/applications/networking/cluster/talosctl/default.nix b/pkgs/applications/networking/cluster/talosctl/default.nix index afc3b7bdf5aa..3651d4652fc7 100644 --- a/pkgs/applications/networking/cluster/talosctl/default.nix +++ b/pkgs/applications/networking/cluster/talosctl/default.nix @@ -15,7 +15,7 @@ buildGoModule rec { ldflags = [ "-s" "-w" ]; - GOWORK = "off"; + env.GOWORK = "off"; subPackages = [ "cmd/talosctl" ]; diff --git a/pkgs/applications/networking/cluster/terraform-providers/providers.json b/pkgs/applications/networking/cluster/terraform-providers/providers.json index 2f605b8837e4..2428750c6961 100644 --- a/pkgs/applications/networking/cluster/terraform-providers/providers.json +++ b/pkgs/applications/networking/cluster/terraform-providers/providers.json @@ -242,7 +242,7 @@ "repo": "terraform-provider-cloudfoundry", "rev": "v0.52.0", "spdx": "MPL-2.0", - "vendorHash": "sha256-g1T6kH8Rv9bpvb6Q3YHCseEi1ayydJIxlplH3k12s8c=" + "vendorHash": "sha256-6MKWpiDq4yI3mfIJyzEsWLa7gi0+DScI5jKcOcM6Qs0=" }, "cloudinit": { "hash": "sha256-etZeCGtYhO0szRGxnj1c3/WOelxScWiHEA9w1Jb7bEE=", @@ -316,7 +316,7 @@ "repo": "terraform-provider-dhall", "rev": "v0.0.7", "spdx": "BSD-3-Clause", - "vendorHash": "sha256-e/+czUeOACwRC7xY90pZp2EWDzDpLU6Ud9RPzuNKaOY=" + "vendorHash": "sha256-quoFrJbB1vjz+MdV+jnr7FPACHuUe5Gx9POLubD2IaM=" }, "digitalocean": { "hash": "sha256-wwb62tZZxpr7NXbiqcS40aF9E2msagj2Mqy4kogDsEA=", @@ -434,7 +434,7 @@ "repo": "terraform-provider-fortios", "rev": "1.19.0", "spdx": "MPL-2.0", - "vendorHash": "sha256-DwRfbD4AqB+4KLuYtqY5fUdzRrEpTIvL4VAM7nieJJA=" + "vendorHash": "sha256-mE25KfP2+7K7nHpkQOn1pfilm+fz5kGDDW8U+P2zglY=" }, "gandi": { "hash": "sha256-fsCtmwyxkXfOtiZG27VEb010jglK35yr4EynnUWlFog=", @@ -552,7 +552,7 @@ "repo": "terraform-provider-htpasswd", "rev": "v1.0.4", "spdx": "MIT", - "vendorHash": "sha256-+D8HxLRUSh7bCN6j+NSkPZTabvqknY7uJ9F5JxefomA=" + "vendorHash": "sha256-6jaAgyHS5H63YKnm4xcYmjKVhPbWm6KK6qHzxg/78yU=" }, "http": { "hash": "sha256-druSExXZeZMNWFIJQoQ/Xh0gCQQx0AnKbIAJQlRi8Po=", diff --git a/pkgs/applications/networking/mailreaders/aerc/default.nix b/pkgs/applications/networking/mailreaders/aerc/default.nix index 2c776a05d053..003b07d2d5f6 100644 --- a/pkgs/applications/networking/mailreaders/aerc/default.nix +++ b/pkgs/applications/networking/mailreaders/aerc/default.nix @@ -22,7 +22,7 @@ buildGoModule rec { }; proxyVendor = true; - vendorHash = "sha256-rycAGqZhO48bPTFO2y2J1d16oon24sEEUns4EayWDvg="; + vendorHash = "sha256-AHEhIWa6PP8f+hhIdY+0brLF2HYhvTal7qXfCwG9iyo="; nativeBuildInputs = [ scdoc diff --git a/pkgs/applications/science/electronics/simulide/default.nix b/pkgs/applications/science/electronics/simulide/default.nix index fbd76a0e0ffc..613ec21dbd96 100644 --- a/pkgs/applications/science/electronics/simulide/default.nix +++ b/pkgs/applications/science/electronics/simulide/default.nix @@ -121,9 +121,9 @@ in simulide_1_1_0 = generic { version = "1.1.0"; - release = "RC1"; + release = "SR0"; branch = "1.1.0"; - rev = "1912"; - sha256 = "sha256-bgRAqt7h2LtU2Ze6Jiz8APhyPcV15v4ofxIilIeZV9E="; + rev = "1917"; + sha256 = "sha256-qNBaGWl89Le9uC1VFK+xYhrLzIvOIWjkQbutnrAmZ2M="; }; } diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix index 25f7229a845a..2a84d4b27b14 100644 --- a/pkgs/applications/science/math/caffe/default.nix +++ b/pkgs/applications/science/math/caffe/default.nix @@ -22,7 +22,7 @@ }: let - inherit (cudaPackages) cudatoolkit nccl; + inherit (cudaPackages) backendStdenv cudatoolkit nccl; # The default for cudatoolkit 10.1 is CUDNN 8.0.5, the last version to support CUDA 10.1. # However, this caffe does not build with CUDNN 8.x, so we use CUDNN 7.6.5 instead. # Earlier versions of cudatoolkit use pre-8.x CUDNN, so we use the default. @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { "-DBLAS=open" ] ++ (if cudaSupport then [ "-DCUDA_ARCH_NAME=All" - "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" + "-DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin/cc" ] else [ "-DCPU_ONLY=ON" ]) ++ ["-DUSE_NCCL=${toggle ncclSupport}"] ++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"] diff --git a/pkgs/applications/science/math/mxnet/default.nix b/pkgs/applications/science/math/mxnet/default.nix index 993da2b89898..839537438962 100644 --- a/pkgs/applications/science/math/mxnet/default.nix +++ b/pkgs/applications/science/math/mxnet/default.nix @@ -5,7 +5,7 @@ }: let - inherit (cudaPackages) cudatoolkit cudaFlags cudnn; + inherit (cudaPackages) backendStdenv cudatoolkit cudaFlags cudnn; in assert cudnnSupport -> cudaSupport; @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { ++ (if cudaSupport then [ "-DUSE_OLDCMAKECUDA=ON" # see https://github.com/apache/incubator-mxnet/issues/10743 "-DCUDA_ARCH_NAME=All" - "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" + "-DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin/cc" "-DMXNET_CUDA_ARCH=${builtins.concatStringsSep ";" cudaFlags.realArches}" ] else [ "-DUSE_CUDA=OFF" ]) ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF"; diff --git a/pkgs/applications/version-management/gitlab/data.json b/pkgs/applications/version-management/gitlab/data.json index c0d38801216b..1e72e6d49802 100644 --- a/pkgs/applications/version-management/gitlab/data.json +++ b/pkgs/applications/version-management/gitlab/data.json @@ -1,15 +1,15 @@ { - "version": "16.10.1", - "repo_hash": "sha256-Bd2BvdWUJJm+hJZHFaW2PyMdaNTZWArpaQ3nY06BBBY=", + "version": "16.10.2", + "repo_hash": "sha256-hKd++fjBaCidBB9DbitWTJjvmiXU0iN1HY4S2gtscW8=", "yarn_hash": "0yzywfg4lqxjwm5cqsm4bn97zcrfvpnrs8rjrv9wv3xqvi9h9skd", "owner": "gitlab-org", "repo": "gitlab", - "rev": "v16.10.1-ee", + "rev": "v16.10.2-ee", "passthru": { - "GITALY_SERVER_VERSION": "16.10.1", - "GITLAB_PAGES_VERSION": "16.10.1", + "GITALY_SERVER_VERSION": "16.10.2", + "GITLAB_PAGES_VERSION": "16.10.2", "GITLAB_SHELL_VERSION": "14.34.0", "GITLAB_ELASTICSEARCH_INDEXER_VERSION": "4.8.0", - "GITLAB_WORKHORSE_VERSION": "16.10.1" + "GITLAB_WORKHORSE_VERSION": "16.10.2" } } diff --git a/pkgs/applications/version-management/gitlab/gitaly/default.nix b/pkgs/applications/version-management/gitlab/gitaly/default.nix index 7cdcebb5ba4d..994cdafc4109 100644 --- a/pkgs/applications/version-management/gitlab/gitaly/default.nix +++ b/pkgs/applications/version-management/gitlab/gitaly/default.nix @@ -6,7 +6,7 @@ }: let - version = "16.10.1"; + version = "16.10.2"; package_version = "v${lib.versions.major version}"; gitaly_package = "gitlab.com/gitlab-org/gitaly/${package_version}"; @@ -18,7 +18,7 @@ let owner = "gitlab-org"; repo = "gitaly"; rev = "v${version}"; - hash = "sha256-YMvxSQcvFj/ugTGjTThmwi1V9M+rc3fldrmChWzXKR8="; + hash = "sha256-oV6MV9W5kC43orMn78A3UpuR71crN7tcN3xy56S/Ar0="; }; vendorHash = "sha256-zaldiRg7fk/HncpfR7k+dDprsOp1ziQHgX8B4l7bwe0="; diff --git a/pkgs/applications/version-management/gitlab/gitlab-container-registry/default.nix b/pkgs/applications/version-management/gitlab/gitlab-container-registry/default.nix index fbea45b432bd..c7f241aa0f42 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-container-registry/default.nix +++ b/pkgs/applications/version-management/gitlab/gitlab-container-registry/default.nix @@ -2,7 +2,7 @@ buildGoModule rec { pname = "gitlab-container-registry"; - version = "3.91.0"; + version = "3.92.0"; rev = "v${version}-gitlab"; # nixpkgs-update: no auto update @@ -10,7 +10,7 @@ buildGoModule rec { owner = "gitlab-org"; repo = "container-registry"; inherit rev; - hash = "sha256-C6tCwVfVZ9CMP0X5NiOdPAuSz5yeu9LAnvOPrq2QLJo="; + hash = "sha256-NHpqfqv3RCbWZilhXLGnQTN+ytzifAix6mcLk5Bw124="; }; vendorHash = "sha256-KZWdM8Q8ipsgm7OoLyOuHo+4Vg2Nve+yZtTSUDgjOW4="; diff --git a/pkgs/applications/version-management/gitlab/gitlab-pages/default.nix b/pkgs/applications/version-management/gitlab/gitlab-pages/default.nix index 92ca11e7884b..c203d4a6db6f 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-pages/default.nix +++ b/pkgs/applications/version-management/gitlab/gitlab-pages/default.nix @@ -2,14 +2,14 @@ buildGoModule rec { pname = "gitlab-pages"; - version = "16.10.1"; + version = "16.10.2"; # nixpkgs-update: no auto update src = fetchFromGitLab { owner = "gitlab-org"; repo = "gitlab-pages"; rev = "v${version}"; - hash = "sha256-jUTUYbkUad2WrI8lkktd2pr3+GPraEUXT+efOb7JcKw="; + hash = "sha256-lJYQBNJFAVq9SKS1gc2rhdE3qFO7x7xcCXT4hlDwtB8="; }; vendorHash = "sha256-WrR4eZRAuYkhr7ZqP7OXqJ6uwvxzn+t+3OdBNcNaq0M="; diff --git a/pkgs/applications/version-management/gitlab/gitlab-workhorse/default.nix b/pkgs/applications/version-management/gitlab/gitlab-workhorse/default.nix index 213989465b52..2fbd41cff8d1 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-workhorse/default.nix +++ b/pkgs/applications/version-management/gitlab/gitlab-workhorse/default.nix @@ -5,7 +5,7 @@ in buildGoModule rec { pname = "gitlab-workhorse"; - version = "16.10.1"; + version = "16.10.2"; # nixpkgs-update: no auto update src = fetchFromGitLab { diff --git a/pkgs/applications/video/frigate/default.nix b/pkgs/applications/video/frigate/default.nix index 9aee25c46ce5..cf381a5f4265 100644 --- a/pkgs/applications/video/frigate/default.nix +++ b/pkgs/applications/video/frigate/default.nix @@ -65,6 +65,12 @@ python.pkgs.buildPythonApplication rec { url = "https://github.com/blakeblackshear/frigate/commit/56bdacc1c661eff8a323e033520e75e2ba0a3842.patch"; hash = "sha256-s/goUJxIbjq/woCEOEZECdcZoJDoWc1eM63sd60cxeY="; }) + (fetchpatch2 { + # https://github.com/blakeblackshear/frigate/pull/10967 + name = "frigate-wsdl-path.patch"; + url = "https://github.com/blakeblackshear/frigate/commit/b65656fa8733c1c2f3d944f716d2e9493ae7c99f.patch"; + hash = "sha256-taPWFV4PldBGUKAwFMKag4W/3TLMSGdKLYG8bj1Y5mU="; + }) ]; postPatch = '' diff --git a/pkgs/applications/video/mlv-app/default.nix b/pkgs/applications/video/mlv-app/default.nix index e3bd3cbf99a2..72e53090d33c 100644 --- a/pkgs/applications/video/mlv-app/default.nix +++ b/pkgs/applications/video/mlv-app/default.nix @@ -9,13 +9,13 @@ mkDerivation rec { pname = "mlv-app"; - version = "1.11"; + version = "1.14"; src = fetchFromGitHub { owner = "ilia3101"; repo = "MLV-App"; rev = "QTv${version}"; - sha256 = "0s5sjdxi8a17ddvih4ara7mlb2xrc9xqx52jmhfaca6ng341gi4x"; + sha256 = "sha256-RfZXHmWSjZBxNFwQ/bzHppsLS0LauURIdnkAzxAIBcU="; }; patches = if stdenv.isAarch64 then ./aarch64-flags.patch else null; diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index ab8491da34cd..6f568c0eb4f9 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -84,6 +84,7 @@ let preBuild = args.preBuild or ""; postBuild = args.modPostBuild or ""; sourceRoot = args.sourceRoot or ""; + env = args.env or { }; impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ "GIT_PROXY_COMMAND" diff --git a/pkgs/by-name/ay/ayatana-indicator-messages/package.nix b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix index 936c39a7fdce..c630b1b4e4ad 100644 --- a/pkgs/by-name/ay/ayatana-indicator-messages/package.nix +++ b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix @@ -119,6 +119,15 @@ stdenv.mkDerivation (finalAttrs: { chmod +w doc/reference/html/* ''; + # Indicators that talk to it may issue requests to parse desktop files, which needs binaries in Exec on PATH + # messaging_menu_app_set_desktop_id -> g_desktop_app_info_new -...-> g_desktop_app_info_load_from_keyfile -> g_find_program_for_path + # When launched via systemd, PATH is very narrow + preFixup = '' + gappsWrapperArgs+=( + --suffix PATH : '/run/current-system/sw/bin' + ) + ''; + passthru = { ayatana-indicators = [ "ayatana-indicator-messages" diff --git a/pkgs/by-name/be/bepass/package.nix b/pkgs/by-name/be/bepass/package.nix index 9e74015f8d4c..b18dce4c0108 100644 --- a/pkgs/by-name/be/bepass/package.nix +++ b/pkgs/by-name/be/bepass/package.nix @@ -23,7 +23,7 @@ buildGoModule rec{ hash = "sha256-ruOhPWNs1WWM3r6X+6ch0HoDCu/a+IkBQiCr0Wh6yS8="; }; - vendorHash = "sha256-SiggDy6vc19yIw15g45yjl8gscE91zUoR6woECbAtR0="; + vendorHash = "sha256-Juie/Hq3i6rvAK19x6ah3SCQJL0uCrmV9gvzHih3crY="; subPackages = [ "cmd/cli" diff --git a/pkgs/by-name/bu/butler/package.nix b/pkgs/by-name/bu/butler/package.nix index 29407276aba6..62d215dc5af0 100644 --- a/pkgs/by-name/bu/butler/package.nix +++ b/pkgs/by-name/bu/butler/package.nix @@ -31,7 +31,7 @@ buildGoModule rec { proxyVendor = true; - vendorHash = "sha256-CtBwc5mcgLvl2Bvg5gI+ULJMQEEibx1aN3IpmRNUtwE="; + vendorHash = "sha256-GvUUCQ2BPW0HlXZljBWJ2Wyys9OEIM55dEWAa6J19Zg="; doCheck = false; diff --git a/pkgs/by-name/ga/gamescope/package.nix b/pkgs/by-name/ga/gamescope/package.nix index a0dd62ab9494..96102fe2258c 100644 --- a/pkgs/by-name/ga/gamescope/package.nix +++ b/pkgs/by-name/ga/gamescope/package.nix @@ -24,9 +24,11 @@ , stb , wlroots , libliftoff +, libdecor , libdisplay-info , lib , makeBinaryWrapper +, patchelfUnstable , nix-update-script , enableExecutable ? true , enableWsi ? true @@ -41,14 +43,14 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "gamescope"; - version = "3.14.2"; + version = "3.14.3"; src = fetchFromGitHub { owner = "ValveSoftware"; repo = "gamescope"; rev = "refs/tags/${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-Ym1kl9naAm1MGlxCk32ssvfiOlstHiZPy7Ga8EZegus="; + hash = "sha256-+6RyrdHRDk9aeM52wcgLo966jP70EAiXSMR3sffNeZM="; }; patches = [ @@ -99,7 +101,7 @@ stdenv.mkDerivation (finalAttrs: { glm ] ++ lib.optionals enableWsi [ vulkan-headers - ] ++ lib.optionals enableExecutable [ + ] ++ lib.optionals enableExecutable (wlroots.buildInputs ++ [ # gamescope uses a custom wlroots branch xorg.libXcomposite xorg.libXcursor xorg.libXdamage @@ -114,7 +116,7 @@ stdenv.mkDerivation (finalAttrs: { libdrm libliftoff SDL2 - wlroots + libdecor libinput libxkbcommon gbenchmark @@ -122,9 +124,13 @@ stdenv.mkDerivation (finalAttrs: { libcap stb libdisplay-info - ]; + ]); postInstall = lib.optionalString enableExecutable '' + # using patchelf unstable because the stable version corrupts the binary + ${lib.getExe patchelfUnstable} $out/bin/gamescope \ + --add-rpath ${vulkan-loader}/lib --add-needed libvulkan.so.1 + # --debug-layers flag expects these in the path wrapProgram "$out/bin/gamescope" \ --prefix PATH : ${with xorg; lib.makeBinPath [xprop xwininfo]} diff --git a/pkgs/by-name/lo/local-ai/package.nix b/pkgs/by-name/lo/local-ai/package.nix index 7142a529b486..f597097dc8e3 100644 --- a/pkgs/by-name/lo/local-ai/package.nix +++ b/pkgs/by-name/lo/local-ai/package.nix @@ -371,12 +371,12 @@ let stdenv; pname = "local-ai"; - version = "2.12.3"; + version = "2.12.4"; src = fetchFromGitHub { owner = "go-skynet"; repo = "LocalAI"; rev = "v${version}"; - hash = "sha256-/Q0t5OozpgqmjUOYHvVAj1k7VnIixfOS8gNAguuu6p0="; + hash = "sha256-piu2B6u4ZfxiOd9SXrE7jiiiwL2SM8EqXo2s5qeKRl0="; }; self = buildGoModule.override { stdenv = effectiveStdenv; } { diff --git a/pkgs/by-name/mc/mcap-cli/package.nix b/pkgs/by-name/mc/mcap-cli/package.nix index 81853d252efa..80ddcd574b02 100644 --- a/pkgs/by-name/mc/mcap-cli/package.nix +++ b/pkgs/by-name/mc/mcap-cli/package.nix @@ -20,7 +20,7 @@ buildGoModule { modRoot = "go/cli/mcap"; - GOWORK="off"; + env.GOWORK="off"; # copy the local versions of the workspace modules postConfigure = '' diff --git a/pkgs/by-name/mi/minijinja/package.nix b/pkgs/by-name/mi/minijinja/package.nix index 6e4a404f4f87..686cb741ebc6 100644 --- a/pkgs/by-name/mi/minijinja/package.nix +++ b/pkgs/by-name/mi/minijinja/package.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "minijinja"; - version = "1.0.17"; + version = "1.0.20"; src = fetchFromGitHub { owner = "mitsuhiko"; repo = "minijinja"; rev = version; - hash = "sha256-NMDPOvSTBEw0469BKEAjL5T/OfVw807KESOpflNe3GI="; + hash = "sha256-NVG9Zpt/CRumlJYsILzjJLo5nY6IZxVdjf6asrglIW0="; }; - cargoHash = "sha256-50fJ7Pb4MLICv3JkeeqiXEcu5cYYU0653YYWEd8HlJU="; + cargoHash = "sha256-fMlk48H9qz8r3gwDD5tXHc+CEgOnQo0pWzhsD9dvl0I="; # The tests relies on the presence of network connection doCheck = false; diff --git a/pkgs/by-name/pa/pace/package.nix b/pkgs/by-name/pa/pace/package.nix new file mode 100644 index 000000000000..738077648c1b --- /dev/null +++ b/pkgs/by-name/pa/pace/package.nix @@ -0,0 +1,38 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + installShellFiles, +}: let + version = "0.15.2"; +in + rustPlatform.buildRustPackage { + pname = "pace"; + inherit version; + + src = fetchFromGitHub { + owner = "pace-rs"; + repo = "pace"; + rev = "refs/tags/pace-rs-v${version}"; + hash = "sha256-gyyf4GGHIEdiAWvzKbaOApFikoh3RLWBCZUfJ0MjbIE="; + }; + + cargoHash = "sha256-D7jxju2R0S5wAsK7Gd8W32t/KKFaDjLHNZ2X/OEuPtk="; + + nativeBuildInputs = [installShellFiles]; + + postInstall = '' + installShellCompletion --cmd pace \ + --bash <($out/bin/pace setup completions bash) \ + --fish <($out/bin/pace setup completions fish) \ + --zsh <($out/bin/pace setup completions zsh) + ''; + + meta = { + description = "Command-line program for mindful time tracking"; + homepage = "https://github.com/pace-rs/pace"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [isabelroses]; + mainProgram = "pace"; + }; + } diff --git a/pkgs/by-name/rp/rpcs3/package.nix b/pkgs/by-name/rp/rpcs3/package.nix index ebd4fedee2ad..87470d96c2b7 100644 --- a/pkgs/by-name/rp/rpcs3/package.nix +++ b/pkgs/by-name/rp/rpcs3/package.nix @@ -32,10 +32,10 @@ let # Keep these separate so the update script can regex them - rpcs3GitVersion = "16271-4ecf8ecd0"; - rpcs3Version = "0.0.31-16271-4ecf8ecd0"; - rpcs3Revision = "4ecf8ecd06c15f0557e1d9243f31e4c2d7baebe2"; - rpcs3Hash = "sha256-y7XLYo1qYYiNE4TXVxfUTCmyGkthpj3IU1gdKTgb8KY="; + rpcs3GitVersion = "16334-fba1db29b"; + rpcs3Version = "0.0.31-16334-fba1db29b"; + rpcs3Revision = "fba1db29b32b5cfeb66cb6bd3c2745e190557b10"; + rpcs3Hash = "sha256-vCdZVecvFeWXYG9Hb0oT/gGdlLnTFOORTUdKGBD9onM="; inherit (qt6Packages) qtbase qtmultimedia wrapQtAppsHook qtwayland; in diff --git a/pkgs/by-name/te/tenv/package.nix b/pkgs/by-name/te/tenv/package.nix index 9916cbced371..37724fe2d166 100644 --- a/pkgs/by-name/te/tenv/package.nix +++ b/pkgs/by-name/te/tenv/package.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "tenv"; - version = "1.7.0"; + version = "1.7.1"; src = fetchFromGitHub { owner = "tofuutils"; repo = "tenv"; rev = "v${version}"; - hash = "sha256-yAwjNh4Qc09VNpVZ6/e6nnPrz61K/tkSa1df+sMXBj8="; + hash = "sha256-Iq1yv80qiQxISS0r1ShjJOXVtp/ryodgih1m3ykI8+0="; }; vendorHash = "sha256-NMkR90+kJ3VsuhF45l5K68uOqenPfINZDEE0GfjULro="; diff --git a/pkgs/by-name/zi/zitadel/console.nix b/pkgs/by-name/zi/zitadel/console.nix index 163ed7aded29..ffef4ca1d4e5 100644 --- a/pkgs/by-name/zi/zitadel/console.nix +++ b/pkgs/by-name/zi/zitadel/console.nix @@ -23,7 +23,7 @@ let workDir = "console"; bufArgs = "../proto --include-imports --include-wkt"; outputPath = "src/app/proto"; - hash = "sha256-h/5K6PvEFyjzS5p7SfuDIk91TkN1iPc+iXor8T/QSeE="; + hash = "sha256-BBXFt4f2SQphr106sQ0eEL4Z2ooAI8fxXhu2rKqhjb4="; }; in mkYarnPackage rec { diff --git a/pkgs/by-name/zi/zitadel/package.nix b/pkgs/by-name/zi/zitadel/package.nix index cb5888bab476..14c9ff1a3ad8 100644 --- a/pkgs/by-name/zi/zitadel/package.nix +++ b/pkgs/by-name/zi/zitadel/package.nix @@ -22,7 +22,7 @@ let rev = "v${version}"; hash = "sha256-Uv0iEIFkTdBAi0WDBQHf0ATs4L2FOU4NmiE9p1MHSa0="; }; - goModulesHash = "sha256-PQch046YjYhAmVlNNdgDLWIqFvEpXRgXAYFMwSZmk4w="; + goModulesHash = "sha256-thd1bhbPVedYd+Yq1IYYUJFr66AWRTzA3DceCXFTEQo="; buildZitadelProtocGen = name: buildGoModule { @@ -92,7 +92,7 @@ let protoc-gen-zitadel ]; outputPath = ".artifacts"; - hash = "sha256-3qDVY2CvtY8lZDr+p5i0vV6zZ5KyTtxBLyV7Os9KuIw="; + hash = "sha256-ntIKudNFBs7kHjK7cfzbOfDCA6J8uvJRUbCTa6afK/I="; }; in buildGoModule rec { diff --git a/pkgs/data/themes/colloid-gtk-theme/default.nix b/pkgs/data/themes/colloid-gtk-theme/default.nix index 71e7fb9a2863..be35d1c544bb 100644 --- a/pkgs/data/themes/colloid-gtk-theme/default.nix +++ b/pkgs/data/themes/colloid-gtk-theme/default.nix @@ -22,13 +22,13 @@ lib.checkListOfEnum "${pname}: tweaks" [ "nord" "dracula" "gruvbox" "all" "black stdenvNoCC.mkDerivation rec { inherit pname; - version = "2023-10-28"; + version = "2024-04-14"; src = fetchFromGitHub { owner = "vinceliuice"; repo = pname; rev = version; - hash = "sha256-NxIWH3qLW8sEguovAv9wfgnlnmPlTipRJTmMo3rSHNY="; + hash = "sha256-DQYnR2V86KbIJfAA4ObRtKQq1IuECie1qdOBYVu8NtA="; }; nativeBuildInputs = [ diff --git a/pkgs/desktops/lomiri/applications/lomiri-system-settings/default.nix b/pkgs/desktops/lomiri/applications/lomiri-system-settings/default.nix index 82ffce3fd247..a4050e596d09 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-system-settings/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-system-settings/default.nix @@ -125,6 +125,11 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace plugins/language/{PageComponent,SpellChecking,ThemeValues}.qml plugins/language/onscreenkeyboard-plugin.cpp plugins/sound/PageComponent.qml \ --replace-fail 'com.lomiri.keyboard.maliit' 'org.maliit.keyboard.maliit' + # Gets list of available localisations from current system, but later drops any language that doesn't cover LSS + # So just give it its own prefix + substituteInPlace plugins/language/language-plugin.cpp \ + --replace-fail '/usr/share/locale' '${placeholder "out"}/share/locale' + # Decide which entries should be visible based on the current system substituteInPlace plugins/*/*.settings \ --replace-warn '/etc' '/run/current-system/sw/etc' diff --git a/pkgs/desktops/lomiri/applications/lomiri/9901-lomiri-Disable-Wizard.patch b/pkgs/desktops/lomiri/applications/lomiri/9901-lomiri-Disable-Wizard.patch new file mode 100644 index 000000000000..7fe6332cadab --- /dev/null +++ b/pkgs/desktops/lomiri/applications/lomiri/9901-lomiri-Disable-Wizard.patch @@ -0,0 +1,30 @@ +From b7757a71bbce18b4718474cab6a7ff7b613f8c86 Mon Sep 17 00:00:00 2001 +From: OPNA2608 +Date: Sun, 19 Nov 2023 13:25:55 +0100 +Subject: [PATCH] lomiri: Disable Wizard + +NixOS does all of this configuration statically at generation build & setup time. For us this just ends up being series of screens +re-confirming abunch of things set in your configuration, so pointless. +--- + plugins/Wizard/System.cpp | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/plugins/Wizard/System.cpp b/plugins/Wizard/System.cpp +index aee8184a8..06c867023 100644 +--- a/plugins/Wizard/System.cpp ++++ b/plugins/Wizard/System.cpp +@@ -69,10 +69,7 @@ bool System::wizardPathExists() { + + bool System::wizardEnabled() const + { +- if (!wizardPathExists()) { +- return true; +- } +- return isUpdate(); ++ return false; + } + + QString System::readCurrentFramework() +-- +2.40.1 + diff --git a/pkgs/desktops/lomiri/applications/lomiri/default.nix b/pkgs/desktops/lomiri/applications/lomiri/default.nix new file mode 100644 index 000000000000..2c1b64bf0ca8 --- /dev/null +++ b/pkgs/desktops/lomiri/applications/lomiri/default.nix @@ -0,0 +1,289 @@ +{ stdenv +, lib +, fetchFromGitLab +, fetchpatch +, fetchpatch2 +, gitUpdater +, linkFarm +, nixosTests +, ayatana-indicator-datetime +, bash +, biometryd +, boost +, cmake +, cmake-extras +, coreutils +, dbus +, dbus-test-runner +, deviceinfo +, geonames +, glib +, glm +, gnome-desktop +, gsettings-qt +, gtk3 +, hfd-service +, libevdev +, libqtdbustest +, libqtdbusmock +, libusermetrics +, libuuid +, lightdm_qt +, lomiri-api +, lomiri-app-launch +, lomiri-download-manager +, lomiri-indicator-network +, lomiri-ui-toolkit +, lomiri-settings-components +, lomiri-system-settings-unwrapped +, lomiri-schemas +, lomiri-notifications +, lomiri-thumbnailer +, maliit-keyboard +, mir +, nixos-icons +, pam +, pkg-config +, properties-cpp +, protobuf +, python3 +, qmenumodel +, qtbase +, qtdeclarative +, qtmir +, qtmultimedia +, qtsvg +, telephony-service +, wrapGAppsHook +, wrapQtAppsHook +, xwayland +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "lomiri"; + version = "0.2.1"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/lomiri"; + rev = finalAttrs.version; + hash = "sha256-V5Lt870eHgmJ63OF8bTiNFLAFrxdgNihkd7aodSO3v8="; + }; + + patches = [ + # Remove when version > 0.2.1 + (fetchpatch { + name = "0001-lomiri-Fix-overwriting-INCLUDE_DIRECTORIES-variable.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri/-/commit/53190bf2f03c8a35491efb26222b8d67ff6caa34.patch"; + hash = "sha256-sbwqOqpTf5OlEB4NZZZTFNXyKq4rTQAxJ6U8YP/DT5s="; + }) + + # fetchpatch2 for renames + # Use GNUInstallDirs variables better, replace more /usr references + # Remove when https://gitlab.com/ubports/development/core/lomiri/-/merge_requests/137 merged & in release + (fetchpatch2 { + name = "0002-lomiri-Make-less-FHS-assumptions.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri/-/commit/817ae1d8ed927e661fbc006851163ba99c46ae13.patch"; + hash = "sha256-NLvpzI2MtjKcGrgTn6PbLXSy3/Jg8KxdSvVYO9KYu9g="; + }) + + # Fix greeter & related settings + # These patches are seemingly not submitted upstream yet + (fetchpatch { + name = "1000-lomiri-QT_IM_MODULE-maliit.patch"; + url = "https://salsa.debian.org/ubports-team/lomiri/-/raw/ebbe0f3f568bd145bb58a2e47f7112442328a0a5/debian/patches/2003_maliit-not-maliitphablet-as-im-module-namespace.patch"; + hash = "sha256-5HEMl0x1S9Hb7spxPRgu8OBebmpaLa6zko2uVEYtBmY="; + }) + (fetchpatch { + name = "1001-lomiri-QT_QPA_PLATFORM-wayland.patch"; + url = "https://salsa.debian.org/ubports-team/lomiri/-/raw/ebbe0f3f568bd145bb58a2e47f7112442328a0a5/debian/patches/2004_qt-qpa-platform-is-wayland.patch"; + hash = "sha256-4C6X2TW+yjZhqYPIcQ3GJeTKbz785i7p/DpT+vX1DSQ="; + }) + (fetchpatch { + name = "1002-lomiri-Fix-Lomiri-greeter.patch"; + url = "https://salsa.debian.org/ubports-team/lomiri/-/raw/ebbe0f3f568bd145bb58a2e47f7112442328a0a5/debian/patches/1008_lomiri-greeter-wayland.patch"; + excludes = [ "data/lomiri-greeter.desktop.in.in" ]; # conflict with GNUInstallDirs patch + hash = "sha256-XSSxf06Su8PMoqYwqevN034b/li8G/cNXjrqOXyhTRg="; + }) + (fetchpatch { + name = "1003-lomiri-Hide-launcher-in-greeter-mode.patch"; + url = "https://salsa.debian.org/ubports-team/lomiri/-/raw/ebbe0f3f568bd145bb58a2e47f7112442328a0a5/debian/patches/0002_qml-shell-hide-and-disallow-launcher-in-greeter-only-mode.patch"; + hash = "sha256-R0aMlb7N7XACCthML4SQSd0LvbadADfdQJqrYFhmujk="; + }) + (fetchpatch { + name = "1004-lomiri-Dont-reset-OSK-setting.patch"; + url = "https://salsa.debian.org/ubports-team/lomiri/-/raw/ebbe0f3f568bd145bb58a2e47f7112442328a0a5/debian/patches/2005_dont-reset-alwaysShowOsk-to-system-defaults-on-login.patch"; + hash = "sha256-guq/Ykcq4WcuXxNKO1eA4sJFyGSpZo0gtyFTdeK/GeE="; + }) + + ./9901-lomiri-Disable-Wizard.patch + ]; + + postPatch = '' + # Part of greeter fix, applies separately due to merge conflicts + substituteInPlace data/lomiri-greeter.desktop.in.in \ + --replace-fail '@CMAKE_INSTALL_FULL_BINDIR@/lomiri-greeter-wrapper @CMAKE_INSTALL_FULL_BINDIR@/lomiri --mode=greeter' '@CMAKE_INSTALL_FULL_BINDIR@/lomiri --mode=greeter' \ + --replace-fail 'X-LightDM-Session-Type=mir' 'X-LightDM-Session-Type=wayland' + + # Need to replace prefix + substituteInPlace data/systemd-user/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USERUNITDIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USERUNITDIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' + + # Don't embed full paths into regular desktop files (but do embed them into lightdm greeter one) + substituteInPlace data/{indicators-client,lomiri}.desktop.in.in \ + --replace-fail '@CMAKE_INSTALL_FULL_BINDIR@/' "" + + # Exclude tests that don't compile (Mir headers these relied on were removed in mir 2.9) + # fatal error: mirtest/mir/test/doubles/stub_surface.h: No such file or directory + substituteInPlace tests/mocks/CMakeLists.txt \ + --replace-fail 'add_subdirectory(QtMir/Application)' "" + + #substituteInPlace plugins/AccountsService/CMakeLists.txt \ + # --replace-fail 'CMAKE_INSTALL_DATADIR' 'CMAKE_INSTALL_FULL_DATADIR' + + # NixOS-ify + + # Use Nix flake instead of Canonical's Ubuntu logo + rm qml/Launcher/graphics/home.svg + ln -s ${nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg qml/Launcher/graphics/home.svg + + # Look up default wallpaper in current system + substituteInPlace plugins/Utils/constants.cpp \ + --replace-fail '/usr/share/backgrounds' '/run/current-system/sw/share/wallpapers' + '' + lib.optionalString finalAttrs.finalPackage.doCheck '' + patchShebangs tests/whitespace/check_whitespace.py + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + glib # populates GSETTINGS_SCHEMAS_PATH + pkg-config + wrapGAppsHook # XDG_DATA_DIRS wrapper flags for schemas + wrapQtAppsHook + ]; + + buildInputs = [ + ayatana-indicator-datetime + bash + boost + cmake-extras + dbus + dbus-test-runner + deviceinfo + geonames + glib + glm + gnome-desktop + gsettings-qt + gtk3 + libevdev + libusermetrics + libuuid + lightdm_qt + lomiri-api + lomiri-app-launch + lomiri-download-manager + lomiri-indicator-network + lomiri-schemas + lomiri-system-settings-unwrapped + lomiri-ui-toolkit + maliit-keyboard + mir + pam + properties-cpp + protobuf + qmenumodel + qtbase + qtdeclarative + qtmir + qtsvg + + # QML import path + biometryd + hfd-service + lomiri-notifications + lomiri-settings-components + lomiri-thumbnailer + qtmultimedia + telephony-service + ]; + + nativeCheckInputs = [ + (python3.withPackages (ps: with ps; [ + python-dbusmock + ])) + ]; + + checkInputs = [ + libqtdbustest + libqtdbusmock + ]; + + # Need its flags + dontWrapGApps = true; + + # Manually calling, to avoid double & unnecessary wrapping + dontWrapQtApps = true; + + cmakeFlags = [ + (lib.cmakeBool "NO_TESTS" (!finalAttrs.finalPackage.doCheck)) + ]; + + postInstall = '' + install -Dm755 ../data/lomiri-greeter-wrapper $out/bin/lomiri-greeter-wrapper + ''; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + preCheck = '' + export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix} + export XDG_DATA_DIRS=${libqtdbusmock}/share + ''; + + preFixup = '' + qtWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + postFixup = '' + wrapQtApp $out/bin/lomiri + wrapQtApp $out/bin/indicators-client + wrapQtApp $out/bin/lomiri-mock-indicator-service + + wrapProgram $out/bin/lomiri-greeter-wrapper \ + --prefix PATH : ${lib.makeBinPath [ coreutils dbus deviceinfo glib ]} \ + --set LOMIRI_BINARY "$out/bin/lomiri" + + wrapProgram $out/libexec/Xwayland.lomiri \ + --prefix PATH : ${lib.makeBinPath [ deviceinfo ]} + + wrapProgram $out/libexec/lomiri-systemd-wrapper \ + --prefix PATH : ${lib.makeBinPath [ dbus ]} + ''; + + passthru = { + tests.lomiri = nixosTests.lomiri; + updateScript = gitUpdater { }; + greeter = linkFarm "lomiri-greeter" [{ + path = "${finalAttrs.finalPackage}/share/lightdm/greeters/lomiri-greeter.desktop"; + name = "lomiri-greeter.desktop"; + }]; + }; + + meta = with lib; { + description = "Shell of the Lomiri Operating environment"; + longDescription = '' + Shell of the Lomiri Operating environment optimized for touch based human-machine interaction, but also supporting + convergence (i.e. switching between tablet/phone and desktop mode). + + Lomiri is the user shell driving Ubuntu Touch based mobile devices. + ''; + homepage = "https://lomiri.com/"; + changelog = "https://gitlab.com/ubports/development/core/lomiri/-/blob/${finalAttrs.version}/ChangeLog"; + license = licenses.gpl3Only; + mainProgram = "lomiri"; + maintainers = teams.lomiri.members; + platforms = platforms.linux; + }; +}) diff --git a/pkgs/desktops/lomiri/applications/morph-browser/default.nix b/pkgs/desktops/lomiri/applications/morph-browser/default.nix index 910008136d7e..f6e92d0c3504 100644 --- a/pkgs/desktops/lomiri/applications/morph-browser/default.nix +++ b/pkgs/desktops/lomiri/applications/morph-browser/default.nix @@ -56,9 +56,12 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \ --replace '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" - # Don't use absolute paths in desktop file + # We normally don't want to use absolute paths in desktop file, but this one is special + # There appears to be some issue in lomiri-app-launch's lookup of relative Icon entries (while lomiri is starting up?) + # that makes the session segfault. + # As a compromise, hardcode /run/current-system substituteInPlace src/app/webbrowser/morph-browser.desktop.in.in \ - --replace 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=morph-browser' \ + --replace 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=/run/current-system/sw/share/icons/hicolor/scalable/apps/morph-browser.svg' \ --replace 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg' '' + lib.optionalString (!finalAttrs.doCheck) '' substituteInPlace CMakeLists.txt \ @@ -124,7 +127,13 @@ stdenv.mkDerivation (finalAttrs: { passthru = { updateScript = gitUpdater { }; - tests.standalone = nixosTests.morph-browser; + tests = { + # Test of morph-browser itself + standalone = nixosTests.morph-browser; + + # Lomiri-specific issues with the desktop file may break the entire session, make sure it still works + lomiri = nixosTests.lomiri; + }; }; meta = with lib; { diff --git a/pkgs/desktops/lomiri/data/lomiri-session/default.nix b/pkgs/desktops/lomiri/data/lomiri-session/default.nix new file mode 100644 index 000000000000..c62e4ab572bd --- /dev/null +++ b/pkgs/desktops/lomiri/data/lomiri-session/default.nix @@ -0,0 +1,198 @@ +{ stdenvNoCC +, lib +, fetchFromGitLab +, fetchpatch +, fetchpatch2 +, gitUpdater +, nixosTests +, bash +, cmake +, dbus +, deviceinfo +, inotify-tools +, lomiri +, makeWrapper +, pkg-config +, runtimeShell +, systemd +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "lomiri-session"; + version = "0.2"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/lomiri-session"; + rev = finalAttrs.version; + hash = "sha256-1ZpAn1tFtlXIfeejG0TnrJBRjf3tyz7CD+riWo+sd0s="; + }; + + patches = [ + # Properly gate of UBtouch-specific code + # Otherwise session won't launch, errors out on a removed Mir setting + # Remove when version > 0.2 + (fetchpatch { + name = "0001-lomiri-session-Properly-differentiate-between-Ubuntu-Touch-and-Lomiri-Desktop-session.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/780c19d8b4f18ce24ceb64b8abfae70018579dce.patch"; + hash = "sha256-eFiagFEpH43WpVGA6xkI1IiQ99HHizonhXYg1wYAhwU="; + }) + + # Export Lomiri-prefixed stop envvar + # Remove when version > 0.2 + (fetchpatch { + name = "0002-lomiri-session-Use-LOMIRI_MIR_EMITS_SIGSTOP.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/452e38b489b5893aac3481410d708f4397b1fa1c.patch"; + hash = "sha256-w/kifBLfDm8+CBliVjm4o8JtjaOByHf97XyPhVk6Gho="; + }) + + # Removes broken first-time wizard check + # Remove when version > 0.2 + (fetchpatch { + name = "0003-lomiri-session-Drop-old-wizard-has-run-check.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/c16ae87d8848f9909850072f7728c03c894b1a47.patch"; + hash = "sha256-AIwgztFOGwG2zUsaUen/Z3Mes9m7VgbvNKWp/qYp4g4="; + }) + + # Fix quoting on ps check + # Remove when version > 0.2 + (fetchpatch { + name = "0004-lomiri-session-Put-evaluation-of-ps-call-in-quotes.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/2d7368eae99f07200c814c840636206b9eaa485d.patch"; + hash = "sha256-6LqurJqi/I+Qw64hWTrvA8uA/EIRZbcS6TRRXK+9s1s="; + }) + + # Check for Xwayland presense to determine X11 support + # Remove when version > 0.2 + (fetchpatch { + name = "0005-lomiri-session-Check-for-Xwayland-presence.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/707e43d3b1a6200535b7682e63817265a8e4ee7e.patch"; + hash = "sha256-sI00P31QVF7ZKdwNep2r+0MetNGg/bbrd2YfEzZPLFI="; + }) + + # Fix systemd service startup things, drop upstart hacks + # Remove when https://gitlab.com/ubports/development/core/lomiri-session/-/merge_requests/13 merged & in release + (fetchpatch { + name = "0100-lomiri-session-Drop-Before-Wants-for-App-Indicator-targets.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/ccebdc1c47d7411a9cf4ad2e529471fb0403433a.patch"; + hash = "sha256-vGFvcCjbwcuLrAUIsL5y/QmoOR5i0560LNv01ZT9OOg="; + }) + (fetchpatch { + name = "0101-lomiri-session-Start-lal-application-end.target-on-stop-restart.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/9a945b09feff0c1d2b3203caaf3cec5230481e80.patch"; + hash = "sha256-1vD+I5YDEh2wF7UDn6ZxPTBRrdUvwWVXt5x5QdkIAkY="; + }) + (fetchpatch { + name = "0102-lomiri-session-Drop-manual-Xwayland-start-logic.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/6aee0d6cfd76ab1904876f4166621f9f6d833056.patch"; + hash = "sha256-iW/Ko+Xm2ZuJuNE7ATeuMTSHby0fXD+D5nWjX6LLLwU="; + }) + (fetchpatch { + name = "0103-lomiri-session-Set-SyslogIdentifier.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/09d378728685411a04333040279cdaef487dedc8.patch"; + hash = "sha256-minJSxrn2d0+FBlf7bdN3ddSvsn6YWdeH6ZuCW7qbII="; + }) + (fetchpatch { + name = "0104-lomiri-session-Use-LOMIRI_AS_SYSTEMD_UNIT-to-launch-session.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/9bd2552c2638c139a0abff527fda99f2ef94cc42.patch"; + hash = "sha256-7ipsGrQRJ98uVSRp2e0U4q3iTuyeUalqZIohbxXpT9k="; + }) + (fetchpatch { + name = "0105-lomiri-session-Allow-sd_notify-calls-for-NOTIFY_SOCKET.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/2157bfc472f2d35e7c81002a924a1f6aa85f7395.patch"; + hash = "sha256-qtArOG4gysFWGnXbz3KpXEppaZ1PGDQKEGqnJvU6/RE="; + }) + (fetchpatch { + name = "0106-lomiri-session-Change-envvar-for-1-time-binary.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/0cd1dbd30f3d5c6e50bce79146e8511e0ee56153.patch"; + hash = "sha256-b8/Mrs36JPJE6l6/Dc/PN+zNV8Oq37HOFx+zMQvWPBY="; + }) + (fetchpatch { + name = "0107-lomiri-session-Drag-lomiri-process-under-umbrella-of-wrapper-script.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/d8212b1862924eb283fd1ee7ea390a144d5ee97e.patch"; + hash = "sha256-UJzV0pYEBBrXSpYxdFoBoMRzPeIQtvtPzDW2/Ljz+uI="; + }) + (fetchpatch { + name = "0108-lomiri-session-Dont-hide-exit-code-from-systemd.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/9ac78d736caa891a4923be8d040fe8224e335215.patch"; + hash = "sha256-yPg1K0IfaGYKqg9536i9AFCLTcAENlsJNdHjrElSeZ4="; + }) + + # Don't require a C & C++ compiler, nothing to compile + # Remove when https://gitlab.com/ubports/development/core/lomiri-session/-/merge_requests/14 merged & in release + (fetchpatch { + name = "0200-lomiri-session-Dont-require-a-compiler.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/6915a5678e09e5dbcb26d29a8e5585d032a19186.patch"; + hash = "sha256-2SWiOLDLsdTjRHaJcnZe/WKcFMFmHtpZsuj7bQCtB4A="; + }) + + # Use GNUInstallDirs for install locations, find_program() for locations of used binaries + # fetchpatch2 due to renames, need to resolve merge conflict manually in postPatch + # Remove when https://gitlab.com/ubports/development/core/lomiri-session/-/merge_requests/15 merged & in release + (fetchpatch2 { + name = "0201-lomiri-session-Hardcode-less-locations.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-session/-/commit/d5b93ecaf08ba776a79c69e8a9dd05d0b6181947.patch"; + excludes = [ "systemd/lomiri.service" ]; + hash = "sha256-BICb6ZwU/sUBzmM4udsOndIgw1A03I/UEG000YvMZ9Y="; + }) + ]; + + postPatch = '' + # Resolving merge conflict + mv systemd/lomiri.service{,.in} + substituteInPlace systemd/lomiri.service.in \ + --replace-fail '/usr/bin/lomiri-session' '@CMAKE_INSTALL_FULL_BINDIR@/lomiri-session' \ + --replace-fail '/usr/bin/dbus-update-activation-environment' '@DUAE_BIN@' + + substituteInPlace lomiri-session \ + --replace-fail '/usr/libexec/Xwayland.lomiri' '${lib.getBin lomiri}/libexec/Xwayland.lomiri' + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + makeWrapper + pkg-config + ]; + + buildInputs = [ + bash + deviceinfo + dbus + inotify-tools + lomiri + systemd + ]; + + cmakeFlags = [ + # Requires lomiri-system-compositor -> not ported to Mir 2.x yet + (lib.cmakeBool "ENABLE_TOUCH_SESSION" false) + ]; + + postInstall = '' + patchShebangs $out/bin/lomiri-session + wrapProgram $out/bin/lomiri-session \ + --prefix PATH : ${lib.makeBinPath [ deviceinfo inotify-tools lomiri ]} + ''; + + passthru = { + providedSessions = [ + "lomiri" + # not packaged/working yet + # "lomiri-touch" + ]; + tests.lomiri = nixosTests.lomiri; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Integrates Lomiri desktop/touch sessions into display / session managers"; + homepage = "https://gitlab.com/ubports/development/core/lomiri-session"; + changelog = "https://gitlab.com/ubports/development/core/lomiri-session/-/blob/${finalAttrs.version}/ChangeLog"; + license = licenses.gpl3Only; + mainProgram = "lomiri-session"; + maintainers = teams.lomiri.members; + platforms = platforms.linux; + }; +}) diff --git a/pkgs/desktops/lomiri/default.nix b/pkgs/desktops/lomiri/default.nix index 4ac9a72eb7fb..76e0351e5a07 100644 --- a/pkgs/desktops/lomiri/default.nix +++ b/pkgs/desktops/lomiri/default.nix @@ -8,6 +8,7 @@ let inherit (self) callPackage; in { #### Core Apps + lomiri = callPackage ./applications/lomiri { }; lomiri-system-settings-unwrapped = callPackage ./applications/lomiri-system-settings { }; lomiri-system-settings-security-privacy = callPackage ./applications/lomiri-system-settings/plugins/lomiri-system-settings-security-privacy.nix { }; lomiri-system-settings = callPackage ./applications/lomiri-system-settings/wrapper.nix { }; @@ -16,6 +17,7 @@ let #### Data lomiri-schemas = callPackage ./data/lomiri-schemas { }; + lomiri-session = callPackage ./data/lomiri-session { }; lomiri-sounds = callPackage ./data/lomiri-sounds { }; lomiri-wallpapers = callPackage ./data/lomiri-wallpapers { }; suru-icon-theme = callPackage ./data/suru-icon-theme { }; diff --git a/pkgs/desktops/lomiri/development/libusermetrics/2002-Launch-module-created-systemd-service.patch b/pkgs/desktops/lomiri/development/libusermetrics/2002-Launch-module-created-systemd-service.patch new file mode 100644 index 000000000000..82961cd4ba79 --- /dev/null +++ b/pkgs/desktops/lomiri/development/libusermetrics/2002-Launch-module-created-systemd-service.patch @@ -0,0 +1,21 @@ +From cf8ba54d22f5ac839004c0d984fb402bde82b527 Mon Sep 17 00:00:00 2001 +From: OPNA2608 +Date: Mon, 8 Apr 2024 15:22:55 +0200 +Subject: [PATCH] Launch module-created systemd service + +--- + data/com.lomiri.UserMetrics.service.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/data/com.lomiri.UserMetrics.service.in b/data/com.lomiri.UserMetrics.service.in +index c2e6ae1..212e24f 100644 +--- a/data/com.lomiri.UserMetrics.service.in ++++ b/data/com.lomiri.UserMetrics.service.in +@@ -3,3 +3,4 @@ Name=com.lomiri.UserMetrics + Exec=@CMAKE_INSTALL_FULL_LIBEXECDIR@/libusermetrics/usermetricsservice + User=usermetrics + StandardOutput=syslog ++SystemdService=dbus-com.lomiri.UserMetrics.service +-- +2.42.0 + diff --git a/pkgs/desktops/lomiri/development/libusermetrics/default.nix b/pkgs/desktops/lomiri/development/libusermetrics/default.nix index d4767b705825..351900af7f13 100644 --- a/pkgs/desktops/lomiri/development/libusermetrics/default.nix +++ b/pkgs/desktops/lomiri/development/libusermetrics/default.nix @@ -43,6 +43,10 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Not submitted yet, waiting for decision on how CMake testing should be handled ./2001-Remove-custom-check-target.patch + + # Due to https://gitlab.com/ubports/development/core/libusermetrics/-/issues/8, we require knowledge about AppArmor availability at launch time + # Custom patch to launch a module-defined service that can handle this + ./2002-Launch-module-created-systemd-service.patch ]; postPatch = '' @@ -91,6 +95,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true) (lib.cmakeBool "GSETTINGS_COMPILE" true) + (lib.cmakeBool "ENABLE_CLICK" true) (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (lib.concatStringsSep ";" [ # Exclude tests diff --git a/pkgs/desktops/lomiri/services/content-hub/default.nix b/pkgs/desktops/lomiri/services/content-hub/default.nix index 17120d5370f5..7cbf7f205871 100644 --- a/pkgs/desktops/lomiri/services/content-hub/default.nix +++ b/pkgs/desktops/lomiri/services/content-hub/default.nix @@ -161,6 +161,7 @@ stdenv.mkDerivation (finalAttrs: { moveToOutput share/applications/$exampleExe.desktop $examples done moveToOutput share/icons $examples + moveToOutput share/content-hub/peers $examples ''; postFixup = '' diff --git a/pkgs/desktops/lomiri/services/telephony-service/default.nix b/pkgs/desktops/lomiri/services/telephony-service/default.nix index 63a426aa30e0..975f96bce992 100644 --- a/pkgs/desktops/lomiri/services/telephony-service/default.nix +++ b/pkgs/desktops/lomiri/services/telephony-service/default.nix @@ -176,6 +176,10 @@ stdenv.mkDerivation (finalAttrs: { sed -i $out/lib/systemd/user/"$service".service \ -e '/ofono-setup.service/d' done + + # Parses the call & SMS indicator desktop files & tries to find its own executable in PATH + wrapProgram $out/bin/telephony-service-indicator \ + --prefix PATH : "$out/bin" ''; passthru = { diff --git a/pkgs/development/compilers/llvm/18/clang/default.nix b/pkgs/development/compilers/llvm/18/clang/default.nix deleted file mode 100644 index 1e777c6132e4..000000000000 --- a/pkgs/development/compilers/llvm/18/clang/default.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ lib, stdenv, llvm_meta -, monorepoSrc, runCommand -, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 -, buildLlvmTools -, fixDarwinDylibNames -, enableManpages ? false -}: - -let - self = stdenv.mkDerivation (finalAttrs: rec { - pname = "clang"; - inherit version; - - src = runCommand "${pname}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${pname} "$out" - cp -r ${monorepoSrc}/clang-tools-extra "$out" - ''; - - sourceRoot = "${src.name}/${pname}"; - - nativeBuildInputs = [ cmake ninja python3 ] - ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ libxml2 libllvm ]; - - cmakeFlags = [ - "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang" - "-DCLANGD_BUILD_XPC=OFF" - "-DLLVM_ENABLE_RTTI=ON" - "-DLLVM_INCLUDE_TESTS=OFF" - ] ++ lib.optionals enableManpages [ - "-DCLANG_INCLUDE_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" - # Added in LLVM15: - # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb - # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7 - "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen" - "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen" - ]; - - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - ../../common/clang/add-nostdlibinc-flag.patch - (substituteAll { - src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' - (cd tools && ln -s ../../clang-tools-extra extra) - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; - - outputs = [ "out" "lib" "dev" "python" ]; - - postInstall = '' - ln -sv $out/bin/clang $out/bin/cpp - - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." - - mkdir -p $python/bin $python/share/clang/ - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - rm $out/bin/c-index-test - patchShebangs $python/bin - - mkdir -p $dev/bin - cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin - ''; - - passthru = { - inherit libllvm; - isClang = true; - hardeningUnsupportedFlags = [ - "fortify3" - ]; - hardeningUnsupportedFlagsByTargetPlatform = targetPlatform: - lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs" - ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []); - }; - - meta = llvm_meta // { - homepage = "https://clang.llvm.org/"; - description = "A C language family frontend for LLVM"; - longDescription = '' - The Clang project provides a language front-end and tooling - infrastructure for languages in the C language family (C, C++, Objective - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. - It aims to deliver amazingly fast compiles, extremely useful error and - warning messages and to provide a platform for building great source - level tools. The Clang Static Analyzer and clang-tidy are tools that - automatically find bugs in your code, and are great examples of the sort - of tools that can be built using the Clang frontend as a library to - parse C/C++ code. - ''; - mainProgram = "clang"; - }; - } // lib.optionalAttrs enableManpages { - pname = "clang-manpages"; - - ninjaFlags = [ "docs-clang-man" ]; - - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; - - outputs = [ "out" ]; - - doCheck = false; - - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - }); -in self diff --git a/pkgs/development/cuda-modules/cudatoolkit/default.nix b/pkgs/development/cuda-modules/cudatoolkit/default.nix index 5a983aaf5c70..e5606f939512 100644 --- a/pkgs/development/cuda-modules/cudatoolkit/default.nix +++ b/pkgs/development/cuda-modules/cudatoolkit/default.nix @@ -411,7 +411,7 @@ backendStdenv.mkDerivation rec { }; meta = with lib; { - description = "A compiler for NVIDIA GPUs, math libraries, and tools"; + description = "The deprecated runfile-based CUDAToolkit installation (a compiler for NVIDIA GPUs, math libraries, and tools)"; homepage = "https://developer.nvidia.com/cuda-toolkit"; platforms = [ "x86_64-linux" ]; license = licenses.nvidiaCuda; diff --git a/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix b/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix new file mode 100644 index 000000000000..6bdcdecbacd6 --- /dev/null +++ b/pkgs/development/cuda-modules/cudatoolkit/redist-wrapper.nix @@ -0,0 +1,86 @@ +{ + lib, + symlinkJoin, + backendStdenv, + cudaOlder, + cudatoolkit-legacy-runfile, + cudaVersion, + cuda_cccl ? null, + cuda_cudart ? null, + cuda_cuobjdump ? null, + cuda_cupti ? null, + cuda_cuxxfilt ? null, + cuda_gdb ? null, + cuda_nvcc ? null, + cuda_nvdisasm ? null, + cuda_nvml_dev ? null, + cuda_nvprune ? null, + cuda_nvrtc ? null, + cuda_nvtx ? null, + cuda_profiler_api ? null, + cuda_sanitizer_api ? null, + libcublas ? null, + libcufft ? null, + libcurand ? null, + libcusolver ? null, + libcusparse ? null, + libnpp ? null, +}: + +let + getAllOutputs = p: [ + (lib.getBin p) + (lib.getLib p) + (lib.getDev p) + ]; + hostPackages = [ + cuda_cuobjdump + cuda_gdb + cuda_nvcc + cuda_nvdisasm + cuda_nvprune + ]; + targetPackages = [ + cuda_cccl + cuda_cudart + cuda_cupti + cuda_cuxxfilt + cuda_nvml_dev + cuda_nvrtc + cuda_nvtx + cuda_profiler_api + cuda_sanitizer_api + libcublas + libcufft + libcurand + libcusolver + libcusparse + libnpp + ]; + + # This assumes we put `cudatoolkit` in `buildInputs` instead of `nativeBuildInputs`: + allPackages = (map (p: p.__spliced.buildHost or p) hostPackages) ++ targetPackages; +in + +if cudaOlder "11.4" then + cudatoolkit-legacy-runfile +else + symlinkJoin rec { + name = "cuda-merged-${cudaVersion}"; + version = cudaVersion; + + paths = builtins.concatMap getAllOutputs allPackages; + + passthru = { + cc = lib.warn "cudaPackages.cudatoolkit is deprecated, refer to the manual and use splayed packages instead" backendStdenv.cc; + lib = symlinkJoin { + inherit name; + paths = map (p: lib.getLib p) allPackages; + }; + }; + + meta = with lib; { + description = "A wrapper substituting the deprecated runfile-based CUDA installation"; + license = licenses.nvidiaCuda; + }; + } diff --git a/pkgs/development/libraries/boringssl/default.nix b/pkgs/development/libraries/boringssl/default.nix index fadf478e037f..9bb0967bd5c6 100644 --- a/pkgs/development/libraries/boringssl/default.nix +++ b/pkgs/development/libraries/boringssl/default.nix @@ -20,7 +20,7 @@ buildGoModule { nativeBuildInputs = [ cmake ninja perl ]; - vendorHash = "sha256-McSmG+fMO8/T/bJR6YAJDYw9pxsWJoj1hcSTPv/wMsI="; + vendorHash = "sha256-074bgtoBRS3SOxLrwZbBdK1jFpdCvF6tRtU1CkrhoDY="; proxyVendor = true; # hack to get both go and cmake configure phase diff --git a/pkgs/development/libraries/lightgbm/default.nix b/pkgs/development/libraries/lightgbm/default.nix index 5f8e6ceaecd0..57d3407aef91 100644 --- a/pkgs/development/libraries/lightgbm/default.nix +++ b/pkgs/development/libraries/lightgbm/default.nix @@ -77,7 +77,7 @@ stdenv.mkDerivation rec { ''; cmakeFlags = lib.optionals doCheck [ "-DBUILD_CPP_TEST=ON" ] - ++ lib.optionals cudaSupport [ "-DUSE_CUDA=1" "-DCMAKE_CXX_COMPILER=${cudaPackages.cudatoolkit.cc}/bin/cc" ] + ++ lib.optionals cudaSupport [ "-DUSE_CUDA=1" "-DCMAKE_CXX_COMPILER=${cudaPackages.backendStdenv.cc}/bin/cc" ] ++ lib.optionals openclSupport [ "-DUSE_GPU=ON" ] ++ lib.optionals mpiSupport [ "-DUSE_MPI=ON" ] ++ lib.optionals hdfsSupport [ diff --git a/pkgs/development/libraries/nghttp3/default.nix b/pkgs/development/libraries/nghttp3/default.nix index d2bd0900dd3c..849a464b1c0d 100644 --- a/pkgs/development/libraries/nghttp3/default.nix +++ b/pkgs/development/libraries/nghttp3/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchFromGitHub , cmake +, CoreServices , curlHTTP3 }: @@ -18,6 +19,9 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "doc" ]; nativeBuildInputs = [ cmake ]; + buildInputs = lib.optionals stdenv.isDarwin [ + CoreServices + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_STATIC_LIB" false) diff --git a/pkgs/development/libraries/ngtcp2/default.nix b/pkgs/development/libraries/ngtcp2/default.nix index 344d85591eef..6a0e15dfcd9c 100644 --- a/pkgs/development/libraries/ngtcp2/default.nix +++ b/pkgs/development/libraries/ngtcp2/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchFromGitHub , cmake , brotli, libev, nghttp3, quictls +, CoreServices , withJemalloc ? false, jemalloc , curlHTTP3 }: @@ -20,7 +21,14 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "doc" ]; nativeBuildInputs = [ cmake ]; - buildInputs = [ brotli libev nghttp3 quictls ] ++ lib.optional withJemalloc jemalloc; + buildInputs = [ + brotli + libev + nghttp3 + quictls + ] ++ lib.optionals stdenv.isDarwin [ + CoreServices + ] ++ lib.optional withJemalloc jemalloc; cmakeFlags = [ (lib.cmakeBool "ENABLE_STATIC_LIB" false) diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 377ebb3acdb5..5e9409368cc7 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -39,7 +39,7 @@ assert blas.implementation == "openblas" && lapack.implementation == "openblas"; assert enablePython -> pythonPackages != null; let - inherit (cudaPackages) cudatoolkit; + inherit (cudaPackages) backendStdenv cudatoolkit; inherit (cudaPackages.cudaFlags) cudaCapabilities; version = "3.4.18"; @@ -241,7 +241,7 @@ stdenv.mkDerivation { (opencvFlag "TBB" enableTbb) ] ++ lib.optionals enableCuda [ "-DCUDA_FAST_MATH=ON" - "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" + "-DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin/cc" "-DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr" "-DCUDA_ARCH_BIN=${lib.concatStringsSep ";" cudaCapabilities}" "-DCUDA_ARCH_PTX=${lib.last cudaCapabilities}" diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix index a1ae57f8824f..0018a73341e3 100644 --- a/pkgs/development/libraries/xgboost/default.nix +++ b/pkgs/development/libraries/xgboost/default.nix @@ -75,8 +75,8 @@ stdenv.mkDerivation rec { "-DUSE_CUDA=ON" # Their CMakeLists.txt does not respect CUDA_HOST_COMPILER, instead using the CXX compiler. # https://github.com/dmlc/xgboost/blob/ccf43d4ba0a94e2f0a3cc5a526197539ae46f410/CMakeLists.txt#L145 - "-DCMAKE_C_COMPILER=${cudaPackages.cudatoolkit.cc}/bin/gcc" - "-DCMAKE_CXX_COMPILER=${cudaPackages.cudatoolkit.cc}/bin/g++" + "-DCMAKE_C_COMPILER=${cudaPackages.backendStdenv.cc}/bin/gcc" + "-DCMAKE_CXX_COMPILER=${cudaPackages.backendStdenv.cc}/bin/g++" ] ++ lib.optionals (cudaSupport && lib.versionAtLeast cudaPackages.cudatoolkit.version "11.4.0") diff --git a/pkgs/development/python-modules/ansicolor/default.nix b/pkgs/development/python-modules/ansicolor/default.nix index 697ded7ac4e2..8ec12d37f598 100644 --- a/pkgs/development/python-modules/ansicolor/default.nix +++ b/pkgs/development/python-modules/ansicolor/default.nix @@ -1,18 +1,35 @@ -{ lib, buildPythonPackage, fetchPypi }: +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + pythonOlder, + setuptools, +}: buildPythonPackage rec { pname = "ansicolor"; version = "0.3.2"; - format = "setuptools"; + pyproject = true; - src = fetchPypi { - inherit pname version; - sha256 = "3b840a6b1184b5f1568635b1adab28147947522707d41ceba02d5ed0a0877279"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "numerodix"; + repo = "ansicolor"; + rev = "refs/tags/${version}"; + hash = "sha256-a/BAU42AfMR8C94GwmrLkvSvolFEjV0LbDypvS9UuOA="; }; + build-system = [ setuptools ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "ansicolor" ]; + meta = with lib; { - homepage = "https://github.com/numerodix/ansicolor/"; description = "A library to produce ansi color output and colored highlighting and diffing"; + homepage = "https://github.com/numerodix/ansicolor/"; license = licenses.asl20; maintainers = with maintainers; [ ]; }; diff --git a/pkgs/development/python-modules/django-ipware/default.nix b/pkgs/development/python-modules/django-ipware/default.nix index 34f17a8d7304..26b4cc7308b8 100644 --- a/pkgs/development/python-modules/django-ipware/default.nix +++ b/pkgs/development/python-modules/django-ipware/default.nix @@ -7,14 +7,14 @@ buildPythonPackage rec { pname = "django-ipware"; - version = "6.0.4"; + version = "6.0.5"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-YU0PCpEfinZeVbbTWLFxW7he62PR67d0R9CdZF8TQ+g="; + hash = "sha256-s54nQDKH1r6wUT5pQCQBfbpY0Sn9QQoQFKyKFYTnP84="; }; propagatedBuildInputs = [ django ]; diff --git a/pkgs/development/python-modules/mdformat-mkdocs/default.nix b/pkgs/development/python-modules/mdformat-mkdocs/default.nix index a7740111324f..8bca9230d914 100644 --- a/pkgs/development/python-modules/mdformat-mkdocs/default.nix +++ b/pkgs/development/python-modules/mdformat-mkdocs/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "mdformat-mkdocs"; - version = "2.0.7"; + version = "2.0.8"; pyproject = true; disabled = pythonOlder "3.8"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "KyleKing"; repo = "mdformat-mkdocs"; rev = "refs/tags/v${version}"; - hash = "sha256-8fatoXZTi7yQhbs95AN8japcPfbqcpjsDiLlqsG0QWI="; + hash = "sha256-HBRhmCqi13D+y+Vp2F27twU2eaRmJTcAzGOPCWMDtZU="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/pyprecice/default.nix b/pkgs/development/python-modules/pyprecice/default.nix index f6c5d8fc2387..b390314dd981 100644 --- a/pkgs/development/python-modules/pyprecice/default.nix +++ b/pkgs/development/python-modules/pyprecice/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { pname = "pyprecice"; - version = "3.0.0.0"; + version = "3.1.0"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -20,7 +20,7 @@ buildPythonPackage rec { owner = "precice"; repo = "python-bindings"; rev = "refs/tags/v${version}"; - hash = "sha256-iW3Mll28Z3Ew+eIJxeF1HR7JhVhXs9FiYaAb5TwYSpg="; + hash = "sha256-5K6oVBhR6mBdkyOb/Ec0qg9x63tkoTnLIrE8dz8oCtc="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/qdldl/default.nix b/pkgs/development/python-modules/qdldl/default.nix index 1a988afce428..a5af403d4d7a 100644 --- a/pkgs/development/python-modules/qdldl/default.nix +++ b/pkgs/development/python-modules/qdldl/default.nix @@ -10,12 +10,12 @@ buildPythonPackage rec { pname = "qdldl"; - version = "0.1.7.post0"; + version = "0.1.7.post1"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-80ahFMg0LubU29ZHHu8xQZn7Jo0797lYhco1H94rAj8="; + hash = "sha256-eY2IwW4CU2rmXHHwa2Tj+/MbdNfke8EP+YFnaGMrOmQ="; }; dontUseCmakeConfigure = true; diff --git a/pkgs/development/python-modules/yq/default.nix b/pkgs/development/python-modules/yq/default.nix index 16a5ea17c8e9..58ffc9a516c2 100644 --- a/pkgs/development/python-modules/yq/default.nix +++ b/pkgs/development/python-modules/yq/default.nix @@ -13,12 +13,12 @@ buildPythonPackage rec { pname = "yq"; - version = "3.2.3"; + version = "3.3.0"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-Kcj+HTa09kFj9NATFMauIXU5hw9hAhbe5gJd+16vr7E="; + hash = "sha256-0qtWLxGx4OW5ZUubBtQ/iiBSacx72izgdzJfWhI2Udw="; }; patches = [ diff --git a/pkgs/development/rocm-modules/6/llvm/add-compression-to-clang-offload-bundler.patch b/pkgs/development/rocm-modules/6/llvm/add-compression-to-clang-offload-bundler.patch new file mode 100644 index 000000000000..8589ac527dcb --- /dev/null +++ b/pkgs/development/rocm-modules/6/llvm/add-compression-to-clang-offload-bundler.patch @@ -0,0 +1,1191 @@ +From 058d9ba2f54a8c7c47b6522db808db87fed82e78 Mon Sep 17 00:00:00 2001 +From: "Yaxun (Sam) Liu" +Date: Thu, 4 Apr 2024 03:25:28 +0200 +Subject: [PATCH] backport 7e2823438e920d25364ff92b62ad90020c31bb59 + +Reland "[HIP] Support compressing device binary" + +Original PR: https://github.com/llvm/llvm-project/pull/67162 + +The commit was reverted due to UB detected by santizer: + +https://lab.llvm.org/buildbot/#/builders/238/builds/5955 + +clang/lib/Driver/OffloadBundler.cpp:1012:25: runtime error: + load of misaligned address 0xaaaae2d90e7c for type + 'const uint64_t' (aka 'const unsigned long'), which + requires 8 byte alignment + +It was fixed by using memcpy instead of dereferencing int* +casted from unaligned char*. + +Co-Authored-By: Martin Schwaighofer +(only did the backport) +--- + clang/docs/ClangOffloadBundler.rst | 27 ++ + clang/include/clang/Driver/OffloadBundler.h | 37 ++ + clang/include/clang/Driver/Options.td | 5 + + clang/lib/Driver/OffloadBundler.cpp | 346 +++++++++++++++--- + clang/lib/Driver/ToolChains/Clang.cpp | 7 + + clang/lib/Driver/ToolChains/HIPUtility.cpp | 6 + + .../test/Driver/clang-offload-bundler-zlib.c | 75 ++++ + .../test/Driver/clang-offload-bundler-zstd.c | 72 ++++ + .../test/Driver/hip-offload-compress-zlib.hip | 45 +++ + .../test/Driver/hip-offload-compress-zstd.hip | 45 +++ + .../clang-offload-bundler/CMakeLists.txt | 1 + + .../ClangOffloadBundler.cpp | 10 + + llvm/include/llvm/BinaryFormat/Magic.h | 28 +- + llvm/lib/BinaryFormat/Magic.cpp | 11 + + llvm/lib/Object/Binary.cpp | 2 + + llvm/lib/Object/ObjectFile.cpp | 2 + + 16 files changed, 659 insertions(+), 60 deletions(-) + create mode 100644 clang/test/Driver/clang-offload-bundler-zlib.c + create mode 100644 clang/test/Driver/clang-offload-bundler-zstd.c + create mode 100644 clang/test/Driver/hip-offload-compress-zlib.hip + create mode 100644 clang/test/Driver/hip-offload-compress-zstd.hip + +diff --git a/clang/docs/ClangOffloadBundler.rst b/clang/docs/ClangOffloadBundler.rst +index 432da787249b..d47997bf718d 100644 +--- a/clang/docs/ClangOffloadBundler.rst ++++ b/clang/docs/ClangOffloadBundler.rst +@@ -498,3 +498,30 @@ target by comparing bundle ID's. Two bundle ID's are considered compatible if: + Verbose printing of matched/unmatched comparisons between bundle entry id of + a device binary from HDA and bundle entry ID of a given target processor + (see :ref:`compatibility-bundle-entry-id`). ++ ++Compression and Decompression ++============================= ++ ++``clang-offload-bundler`` provides features to compress and decompress the full ++bundle, leveraging inherent redundancies within the bundle entries. Use the ++`-compress` command-line option to enable this compression capability. ++ ++The compressed offload bundle begins with a header followed by the compressed binary data: ++ ++- **Magic Number (4 bytes)**: ++ This is a unique identifier to distinguish compressed offload bundles. The value is the string 'CCOB' (Compressed Clang Offload Bundle). ++ ++- **Version Number (16-bit unsigned int)**: ++ This denotes the version of the compressed offload bundle format. The current version is `1`. ++ ++- **Compression Method (16-bit unsigned int)**: ++ This field indicates the compression method used. The value corresponds to either `zlib` or `zstd`, represented as a 16-bit unsigned integer cast from the LLVM compression enumeration. ++ ++- **Uncompressed Binary Size (32-bit unsigned int)**: ++ This is the size (in bytes) of the binary data before it was compressed. ++ ++- **Hash (64-bit unsigned int)**: ++ This is a 64-bit truncated MD5 hash of the uncompressed binary data. It serves for verification and caching purposes. ++ ++- **Compressed Data**: ++ The actual compressed binary data follows the header. Its size can be inferred from the total size of the file minus the header size. +diff --git a/clang/include/clang/Driver/OffloadBundler.h b/clang/include/clang/Driver/OffloadBundler.h +index fe263f0540b9..fc96f200414d 100644 +--- a/clang/include/clang/Driver/OffloadBundler.h ++++ b/clang/include/clang/Driver/OffloadBundler.h +@@ -19,6 +19,7 @@ + + #include "llvm/Support/Error.h" + #include "llvm/TargetParser/Triple.h" ++#include + #include + #include + +@@ -26,11 +27,15 @@ namespace clang { + + class OffloadBundlerConfig { + public: ++ OffloadBundlerConfig(); ++ + bool AllowNoHost = false; + bool AllowMissingBundles = false; + bool CheckInputArchive = false; + bool PrintExternalCommands = false; + bool HipOpenmpCompatible = false; ++ bool Compress = false; ++ bool Verbose = false; + + unsigned BundleAlignment = 1; + unsigned HostInputIndex = ~0u; +@@ -82,6 +87,38 @@ struct OffloadTargetInfo { + std::string str() const; + }; + ++// CompressedOffloadBundle represents the format for the compressed offload ++// bundles. ++// ++// The format is as follows: ++// - Magic Number (4 bytes) - A constant "CCOB". ++// - Version (2 bytes) ++// - Compression Method (2 bytes) - Uses the values from ++// llvm::compression::Format. ++// - Uncompressed Size (4 bytes). ++// - Truncated MD5 Hash (8 bytes). ++// - Compressed Data (variable length). ++ ++class CompressedOffloadBundle { ++private: ++ static inline const size_t MagicSize = 4; ++ static inline const size_t VersionFieldSize = sizeof(uint16_t); ++ static inline const size_t MethodFieldSize = sizeof(uint16_t); ++ static inline const size_t SizeFieldSize = sizeof(uint32_t); ++ static inline const size_t HashFieldSize = 8; ++ static inline const size_t HeaderSize = MagicSize + VersionFieldSize + ++ MethodFieldSize + SizeFieldSize + ++ HashFieldSize; ++ static inline const llvm::StringRef MagicNumber = "CCOB"; ++ static inline const uint16_t Version = 1; ++ ++public: ++ static llvm::Expected> ++ compress(const llvm::MemoryBuffer &Input, bool Verbose = false); ++ static llvm::Expected> ++ decompress(const llvm::MemoryBuffer &Input, bool Verbose = false); ++}; ++ + } // namespace clang + + #endif // LLVM_CLANG_DRIVER_OFFLOADBUNDLER_H +diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td +index c206ab84508f..f8df98678396 100644 +--- a/clang/include/clang/Driver/Options.td ++++ b/clang/include/clang/Driver/Options.td +@@ -984,6 +984,11 @@ def fconvergent_functions : Flag<["-"], "fconvergent-functions">, Group + def gpu_use_aux_triple_only : Flag<["--"], "gpu-use-aux-triple-only">, + InternalDriverOpt, HelpText<"Prepare '-aux-triple' only without populating " + "'-aux-target-cpu' and '-aux-target-feature'.">; ++ ++def offload_compress : Flag<["--"], "offload-compress">, ++ HelpText<"Compress offload device binaries (HIP only)">; ++def no_offload_compress : Flag<["--"], "no-offload-compress">; ++ + def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">, Flags<[NoXarchOption]>, + HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">; + def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXarchOption]>, +diff --git a/clang/lib/Driver/OffloadBundler.cpp b/clang/lib/Driver/OffloadBundler.cpp +index 29250c49eb0c..69e14679da1c 100644 +--- a/clang/lib/Driver/OffloadBundler.cpp ++++ b/clang/lib/Driver/OffloadBundler.cpp +@@ -21,24 +21,29 @@ + #include "llvm/ADT/ArrayRef.h" + #include "llvm/ADT/SmallString.h" + #include "llvm/ADT/SmallVector.h" ++#include "llvm/ADT/StringExtras.h" + #include "llvm/ADT/StringMap.h" + #include "llvm/ADT/StringRef.h" ++#include "llvm/BinaryFormat/Magic.h" + #include "llvm/Object/Archive.h" + #include "llvm/Object/ArchiveWriter.h" + #include "llvm/Object/Binary.h" + #include "llvm/Object/ObjectFile.h" + #include "llvm/Support/Casting.h" ++#include "llvm/Support/Compression.h" + #include "llvm/Support/Debug.h" + #include "llvm/Support/EndianStream.h" + #include "llvm/Support/Errc.h" + #include "llvm/Support/Error.h" + #include "llvm/Support/ErrorOr.h" + #include "llvm/Support/FileSystem.h" ++#include "llvm/Support/MD5.h" + #include "llvm/Support/MemoryBuffer.h" + #include "llvm/Support/Path.h" + #include "llvm/Support/Program.h" + #include "llvm/Support/Signals.h" + #include "llvm/Support/StringSaver.h" ++#include "llvm/Support/Timer.h" + #include "llvm/Support/WithColor.h" + #include "llvm/Support/raw_ostream.h" + #include "llvm/TargetParser/Host.h" +@@ -48,6 +53,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -58,6 +64,10 @@ using namespace llvm; + using namespace llvm::object; + using namespace clang; + ++static llvm::TimerGroup ++ ClangOffloadBundlerTimerGroup("Clang Offload Bundler Timer Group", ++ "Timer group for clang offload bundler"); ++ + /// Magic string that marks the existence of offloading data. + #define OFFLOAD_BUNDLER_MAGIC_STR "__CLANG_OFFLOAD_BUNDLE__" + +@@ -229,20 +239,22 @@ public: + + /// Write the header of the bundled file to \a OS based on the information + /// gathered from \a Inputs. +- virtual Error WriteHeader(raw_fd_ostream &OS, ++ virtual Error WriteHeader(raw_ostream &OS, + ArrayRef> Inputs) = 0; + + /// Write the marker that initiates a bundle for the triple \a TargetTriple to + /// \a OS. +- virtual Error WriteBundleStart(raw_fd_ostream &OS, +- StringRef TargetTriple) = 0; ++ virtual Error WriteBundleStart(raw_ostream &OS, StringRef TargetTriple) = 0; + + /// Write the marker that closes a bundle for the triple \a TargetTriple to \a + /// OS. +- virtual Error WriteBundleEnd(raw_fd_ostream &OS, StringRef TargetTriple) = 0; ++ virtual Error WriteBundleEnd(raw_ostream &OS, StringRef TargetTriple) = 0; + + /// Write the bundle from \a Input into \a OS. +- virtual Error WriteBundle(raw_fd_ostream &OS, MemoryBuffer &Input) = 0; ++ virtual Error WriteBundle(raw_ostream &OS, MemoryBuffer &Input) = 0; ++ ++ /// Finalize output file. ++ virtual Error finalizeOutputFile() { return Error::success(); } + + /// List bundle IDs in \a Input. + virtual Error listBundleIDs(MemoryBuffer &Input) { +@@ -330,7 +342,7 @@ static uint64_t Read8byteIntegerFromBuffer(StringRef Buffer, size_t pos) { + } + + /// Write 8-byte integers to a buffer in little-endian format. +-static void Write8byteIntegerToBuffer(raw_fd_ostream &OS, uint64_t Val) { ++static void Write8byteIntegerToBuffer(raw_ostream &OS, uint64_t Val) { + llvm::support::endian::write(OS, Val, llvm::support::little); + } + +@@ -378,8 +390,7 @@ public: + return Error::success(); + + // Check if no magic was found. +- StringRef Magic(FC.data(), sizeof(OFFLOAD_BUNDLER_MAGIC_STR) - 1); +- if (!Magic.equals(OFFLOAD_BUNDLER_MAGIC_STR)) ++ if (llvm::identify_magic(FC) != llvm::file_magic::offload_bundle) + return Error::success(); + + // Read number of bundles. +@@ -454,7 +465,7 @@ public: + return Error::success(); + } + +- Error WriteHeader(raw_fd_ostream &OS, ++ Error WriteHeader(raw_ostream &OS, + ArrayRef> Inputs) final { + + // Compute size of the header. +@@ -491,19 +502,27 @@ public: + return Error::success(); + } + +- Error WriteBundleStart(raw_fd_ostream &OS, StringRef TargetTriple) final { ++ Error WriteBundleStart(raw_ostream &OS, StringRef TargetTriple) final { + CurWriteBundleTarget = TargetTriple.str(); + return Error::success(); + } + +- Error WriteBundleEnd(raw_fd_ostream &OS, StringRef TargetTriple) final { ++ Error WriteBundleEnd(raw_ostream &OS, StringRef TargetTriple) final { + return Error::success(); + } + +- Error WriteBundle(raw_fd_ostream &OS, MemoryBuffer &Input) final { ++ Error WriteBundle(raw_ostream &OS, MemoryBuffer &Input) final { + auto BI = BundlesInfo[CurWriteBundleTarget]; +- OS.seek(BI.Offset); ++ ++ // Pad with 0 to reach specified offset. ++ size_t CurrentPos = OS.tell(); ++ size_t PaddingSize = BI.Offset > CurrentPos ? BI.Offset - CurrentPos : 0; ++ for (size_t I = 0; I < PaddingSize; ++I) ++ OS.write('\0'); ++ assert(OS.tell() == BI.Offset); ++ + OS.write(Input.getBufferStart(), Input.getBufferSize()); ++ + return Error::success(); + } + }; +@@ -560,7 +579,7 @@ class ObjectFileHandler final : public FileHandler { + return NameOrErr.takeError(); + + // If it does not start with the reserved suffix, just skip this section. +- if (!NameOrErr->startswith(OFFLOAD_BUNDLER_MAGIC_STR)) ++ if (llvm::identify_magic(*NameOrErr) != llvm::file_magic::offload_bundle) + return std::nullopt; + + // Return the triple that is right after the reserved prefix. +@@ -625,7 +644,7 @@ public: + return Error::success(); + } + +- Error WriteHeader(raw_fd_ostream &OS, ++ Error WriteHeader(raw_ostream &OS, + ArrayRef> Inputs) final { + assert(BundlerConfig.HostInputIndex != ~0u && + "Host input index not defined."); +@@ -635,12 +654,16 @@ public: + return Error::success(); + } + +- Error WriteBundleStart(raw_fd_ostream &OS, StringRef TargetTriple) final { ++ Error WriteBundleStart(raw_ostream &OS, StringRef TargetTriple) final { + ++NumberOfProcessedInputs; + return Error::success(); + } + +- Error WriteBundleEnd(raw_fd_ostream &OS, StringRef TargetTriple) final { ++ Error WriteBundleEnd(raw_ostream &OS, StringRef TargetTriple) final { ++ return Error::success(); ++ } ++ ++ Error finalizeOutputFile() final { + assert(NumberOfProcessedInputs <= NumberOfInputs && + "Processing more inputs that actually exist!"); + assert(BundlerConfig.HostInputIndex != ~0u && +@@ -658,10 +681,6 @@ public: + assert(BundlerConfig.ObjcopyPath != "" && + "llvm-objcopy path not specified"); + +- // We write to the output file directly. So, we close it and use the name +- // to pass down to llvm-objcopy. +- OS.close(); +- + // Temporary files that need to be removed. + TempFileHandlerRAII TempFiles; + +@@ -702,7 +721,7 @@ public: + return Error::success(); + } + +- Error WriteBundle(raw_fd_ostream &OS, MemoryBuffer &Input) final { ++ Error WriteBundle(raw_ostream &OS, MemoryBuffer &Input) final { + return Error::success(); + } + +@@ -799,22 +818,22 @@ protected: + return Error::success(); + } + +- Error WriteHeader(raw_fd_ostream &OS, ++ Error WriteHeader(raw_ostream &OS, + ArrayRef> Inputs) final { + return Error::success(); + } + +- Error WriteBundleStart(raw_fd_ostream &OS, StringRef TargetTriple) final { ++ Error WriteBundleStart(raw_ostream &OS, StringRef TargetTriple) final { + OS << BundleStartString << TargetTriple << "\n"; + return Error::success(); + } + +- Error WriteBundleEnd(raw_fd_ostream &OS, StringRef TargetTriple) final { ++ Error WriteBundleEnd(raw_ostream &OS, StringRef TargetTriple) final { + OS << BundleEndString << TargetTriple << "\n"; + return Error::success(); + } + +- Error WriteBundle(raw_fd_ostream &OS, MemoryBuffer &Input) final { ++ Error WriteBundle(raw_ostream &OS, MemoryBuffer &Input) final { + OS << Input.getBuffer(); + return Error::success(); + } +@@ -899,6 +918,187 @@ CreateFileHandler(MemoryBuffer &FirstInput, + "'" + FilesType + "': invalid file type specified"); + } + ++OffloadBundlerConfig::OffloadBundlerConfig() { ++ auto IgnoreEnvVarOpt = ++ llvm::sys::Process::GetEnv("OFFLOAD_BUNDLER_IGNORE_ENV_VAR"); ++ if (IgnoreEnvVarOpt.has_value() && IgnoreEnvVarOpt.value() == "1") ++ return; ++ ++ auto VerboseEnvVarOpt = llvm::sys::Process::GetEnv("OFFLOAD_BUNDLER_VERBOSE"); ++ if (VerboseEnvVarOpt.has_value()) ++ Verbose = VerboseEnvVarOpt.value() == "1"; ++ ++ auto CompressEnvVarOpt = ++ llvm::sys::Process::GetEnv("OFFLOAD_BUNDLER_COMPRESS"); ++ if (CompressEnvVarOpt.has_value()) ++ Compress = CompressEnvVarOpt.value() == "1"; ++} ++ ++llvm::Expected> ++CompressedOffloadBundle::compress(const llvm::MemoryBuffer &Input, ++ bool Verbose) { ++ llvm::Timer HashTimer("Hash Calculation Timer", "Hash calculation time", ++ ClangOffloadBundlerTimerGroup); ++ if (Verbose) ++ HashTimer.startTimer(); ++ llvm::MD5 Hash; ++ llvm::MD5::MD5Result Result; ++ Hash.update(Input.getBuffer()); ++ Hash.final(Result); ++ uint64_t TruncatedHash = Result.low(); ++ if (Verbose) ++ HashTimer.stopTimer(); ++ ++ SmallVector CompressedBuffer; ++ auto BufferUint8 = llvm::ArrayRef( ++ reinterpret_cast(Input.getBuffer().data()), ++ Input.getBuffer().size()); ++ ++ llvm::compression::Format CompressionFormat; ++ ++ if (llvm::compression::zstd::isAvailable()) ++ CompressionFormat = llvm::compression::Format::Zstd; ++ else if (llvm::compression::zlib::isAvailable()) ++ CompressionFormat = llvm::compression::Format::Zlib; ++ else ++ return createStringError(llvm::inconvertibleErrorCode(), ++ "Compression not supported"); ++ ++ llvm::Timer CompressTimer("Compression Timer", "Compression time", ++ ClangOffloadBundlerTimerGroup); ++ if (Verbose) ++ CompressTimer.startTimer(); ++ llvm::compression::compress(CompressionFormat, BufferUint8, CompressedBuffer); ++ if (Verbose) ++ CompressTimer.stopTimer(); ++ ++ uint16_t CompressionMethod = static_cast(CompressionFormat); ++ uint32_t UncompressedSize = Input.getBuffer().size(); ++ ++ SmallVector FinalBuffer; ++ llvm::raw_svector_ostream OS(FinalBuffer); ++ OS << MagicNumber; ++ OS.write(reinterpret_cast(&Version), sizeof(Version)); ++ OS.write(reinterpret_cast(&CompressionMethod), ++ sizeof(CompressionMethod)); ++ OS.write(reinterpret_cast(&UncompressedSize), ++ sizeof(UncompressedSize)); ++ OS.write(reinterpret_cast(&TruncatedHash), ++ sizeof(TruncatedHash)); ++ OS.write(reinterpret_cast(CompressedBuffer.data()), ++ CompressedBuffer.size()); ++ ++ if (Verbose) { ++ auto MethodUsed = ++ CompressionFormat == llvm::compression::Format::Zstd ? "zstd" : "zlib"; ++ llvm::errs() << "Compressed bundle format version: " << Version << "\n" ++ << "Compression method used: " << MethodUsed << "\n" ++ << "Binary size before compression: " << UncompressedSize ++ << " bytes\n" ++ << "Binary size after compression: " << CompressedBuffer.size() ++ << " bytes\n" ++ << "Truncated MD5 hash: " ++ << llvm::format_hex(TruncatedHash, 16) << "\n"; ++ } ++ ++ return llvm::MemoryBuffer::getMemBufferCopy( ++ llvm::StringRef(FinalBuffer.data(), FinalBuffer.size())); ++} ++ ++llvm::Expected> ++CompressedOffloadBundle::decompress(const llvm::MemoryBuffer &Input, ++ bool Verbose) { ++ ++ StringRef Blob = Input.getBuffer(); ++ ++ if (Blob.size() < HeaderSize) { ++ return llvm::MemoryBuffer::getMemBufferCopy(Blob); ++ } ++ if (llvm::identify_magic(Blob) != ++ llvm::file_magic::offload_bundle_compressed) { ++ if (Verbose) ++ llvm::errs() << "Uncompressed bundle.\n"; ++ return llvm::MemoryBuffer::getMemBufferCopy(Blob); ++ } ++ ++ uint16_t ThisVersion; ++ uint16_t CompressionMethod; ++ uint32_t UncompressedSize; ++ uint64_t StoredHash; ++ memcpy(&ThisVersion, Input.getBuffer().data() + MagicNumber.size(), ++ sizeof(uint16_t)); ++ memcpy(&CompressionMethod, Blob.data() + MagicSize + VersionFieldSize, ++ sizeof(uint16_t)); ++ memcpy(&UncompressedSize, ++ Blob.data() + MagicSize + VersionFieldSize + MethodFieldSize, ++ sizeof(uint32_t)); ++ memcpy(&StoredHash, ++ Blob.data() + MagicSize + VersionFieldSize + MethodFieldSize + ++ SizeFieldSize, ++ sizeof(uint64_t)); ++ ++ llvm::compression::Format CompressionFormat; ++ if (CompressionMethod == ++ static_cast(llvm::compression::Format::Zlib)) ++ CompressionFormat = llvm::compression::Format::Zlib; ++ else if (CompressionMethod == ++ static_cast(llvm::compression::Format::Zstd)) ++ CompressionFormat = llvm::compression::Format::Zstd; ++ else ++ return createStringError(inconvertibleErrorCode(), ++ "Unknown compressing method"); ++ ++ llvm::Timer DecompressTimer("Decompression Timer", "Decompression time", ++ ClangOffloadBundlerTimerGroup); ++ if (Verbose) ++ DecompressTimer.startTimer(); ++ ++ SmallVector DecompressedData; ++ StringRef CompressedData = Blob.substr(HeaderSize); ++ if (llvm::Error DecompressionError = llvm::compression::decompress( ++ CompressionFormat, llvm::arrayRefFromStringRef(CompressedData), ++ DecompressedData, UncompressedSize)) ++ return createStringError(inconvertibleErrorCode(), ++ "Could not decompress embedded file contents: " + ++ llvm::toString(std::move(DecompressionError))); ++ ++ if (Verbose) { ++ DecompressTimer.stopTimer(); ++ ++ // Recalculate MD5 hash ++ llvm::Timer HashRecalcTimer("Hash Recalculation Timer", ++ "Hash recalculation time", ++ ClangOffloadBundlerTimerGroup); ++ HashRecalcTimer.startTimer(); ++ llvm::MD5 Hash; ++ llvm::MD5::MD5Result Result; ++ Hash.update(llvm::ArrayRef(DecompressedData.data(), ++ DecompressedData.size())); ++ Hash.final(Result); ++ uint64_t RecalculatedHash = Result.low(); ++ HashRecalcTimer.stopTimer(); ++ bool HashMatch = (StoredHash == RecalculatedHash); ++ ++ llvm::errs() << "Compressed bundle format version: " << ThisVersion << "\n" ++ << "Decompression method: " ++ << (CompressionFormat == llvm::compression::Format::Zlib ++ ? "zlib" ++ : "zstd") ++ << "\n" ++ << "Size before decompression: " << CompressedData.size() ++ << " bytes\n" ++ << "Size after decompression: " << UncompressedSize ++ << " bytes\n" ++ << "Stored hash: " << llvm::format_hex(StoredHash, 16) << "\n" ++ << "Recalculated hash: " ++ << llvm::format_hex(RecalculatedHash, 16) << "\n" ++ << "Hashes match: " << (HashMatch ? "Yes" : "No") << "\n"; ++ } ++ ++ return llvm::MemoryBuffer::getMemBufferCopy( ++ llvm::toStringRef(DecompressedData)); ++} ++ + // List bundle IDs. Return true if an error was found. + Error OffloadBundler::ListBundleIDsInFile( + StringRef InputFileName, const OffloadBundlerConfig &BundlerConfig) { +@@ -908,28 +1108,35 @@ Error OffloadBundler::ListBundleIDsInFile( + if (std::error_code EC = CodeOrErr.getError()) + return createFileError(InputFileName, EC); + +- MemoryBuffer &Input = **CodeOrErr; ++ // Decompress the input if necessary. ++ Expected> DecompressedBufferOrErr = ++ CompressedOffloadBundle::decompress(**CodeOrErr, BundlerConfig.Verbose); ++ if (!DecompressedBufferOrErr) ++ return createStringError( ++ inconvertibleErrorCode(), ++ "Failed to decompress input: " + ++ llvm::toString(DecompressedBufferOrErr.takeError())); ++ ++ MemoryBuffer &DecompressedInput = **DecompressedBufferOrErr; + + // Select the right files handler. + Expected> FileHandlerOrErr = +- CreateFileHandler(Input, BundlerConfig); ++ CreateFileHandler(DecompressedInput, BundlerConfig); + if (!FileHandlerOrErr) + return FileHandlerOrErr.takeError(); + + std::unique_ptr &FH = *FileHandlerOrErr; + assert(FH); +- return FH->listBundleIDs(Input); ++ return FH->listBundleIDs(DecompressedInput); + } + + /// Bundle the files. Return true if an error was found. + Error OffloadBundler::BundleFiles() { + std::error_code EC; + +- // Create output file. +- raw_fd_ostream OutputFile(BundlerConfig.OutputFileNames.front(), EC, +- sys::fs::OF_None); +- if (EC) +- return createFileError(BundlerConfig.OutputFileNames.front(), EC); ++ // Create a buffer to hold the content before compressing. ++ SmallVector Buffer; ++ llvm::raw_svector_ostream BufferStream(Buffer); + + // Open input files. + SmallVector, 8u> InputBuffers; +@@ -956,22 +1163,46 @@ Error OffloadBundler::BundleFiles() { + assert(FH); + + // Write header. +- if (Error Err = FH->WriteHeader(OutputFile, InputBuffers)) ++ if (Error Err = FH->WriteHeader(BufferStream, InputBuffers)) + return Err; + + // Write all bundles along with the start/end markers. If an error was found + // writing the end of the bundle component, abort the bundle writing. + auto Input = InputBuffers.begin(); + for (auto &Triple : BundlerConfig.TargetNames) { +- if (Error Err = FH->WriteBundleStart(OutputFile, Triple)) ++ if (Error Err = FH->WriteBundleStart(BufferStream, Triple)) + return Err; +- if (Error Err = FH->WriteBundle(OutputFile, **Input)) ++ if (Error Err = FH->WriteBundle(BufferStream, **Input)) + return Err; +- if (Error Err = FH->WriteBundleEnd(OutputFile, Triple)) ++ if (Error Err = FH->WriteBundleEnd(BufferStream, Triple)) + return Err; + ++Input; + } +- return Error::success(); ++ ++ raw_fd_ostream OutputFile(BundlerConfig.OutputFileNames.front(), EC, ++ sys::fs::OF_None); ++ if (EC) ++ return createFileError(BundlerConfig.OutputFileNames.front(), EC); ++ ++ SmallVector CompressedBuffer; ++ if (BundlerConfig.Compress) { ++ std::unique_ptr BufferMemory = ++ llvm::MemoryBuffer::getMemBufferCopy( ++ llvm::StringRef(Buffer.data(), Buffer.size())); ++ auto CompressionResult = ++ CompressedOffloadBundle::compress(*BufferMemory, BundlerConfig.Verbose); ++ if (auto Error = CompressionResult.takeError()) ++ return Error; ++ ++ auto CompressedMemBuffer = std::move(CompressionResult.get()); ++ CompressedBuffer.assign(CompressedMemBuffer->getBufferStart(), ++ CompressedMemBuffer->getBufferEnd()); ++ } else ++ CompressedBuffer = Buffer; ++ ++ OutputFile.write(CompressedBuffer.data(), CompressedBuffer.size()); ++ ++ return FH->finalizeOutputFile(); + } + + // Unbundle the files. Return true if an error was found. +@@ -982,7 +1213,16 @@ Error OffloadBundler::UnbundleFiles() { + if (std::error_code EC = CodeOrErr.getError()) + return createFileError(BundlerConfig.InputFileNames.front(), EC); + +- MemoryBuffer &Input = **CodeOrErr; ++ // Decompress the input if necessary. ++ Expected> DecompressedBufferOrErr = ++ CompressedOffloadBundle::decompress(**CodeOrErr, BundlerConfig.Verbose); ++ if (!DecompressedBufferOrErr) ++ return createStringError( ++ inconvertibleErrorCode(), ++ "Failed to decompress input: " + ++ llvm::toString(DecompressedBufferOrErr.takeError())); ++ ++ MemoryBuffer &Input = **DecompressedBufferOrErr; + + // Select the right files handler. + Expected> FileHandlerOrErr = +@@ -1357,22 +1597,34 @@ Error OffloadBundler::UnbundleArchive() { + if (!CodeObjectBufferRefOrErr) + return CodeObjectBufferRefOrErr.takeError(); + +- auto CodeObjectBuffer = ++ auto TempCodeObjectBuffer = + MemoryBuffer::getMemBuffer(*CodeObjectBufferRefOrErr, false); + ++ // Decompress the buffer if necessary. ++ Expected> DecompressedBufferOrErr = ++ CompressedOffloadBundle::decompress(*TempCodeObjectBuffer, ++ BundlerConfig.Verbose); ++ if (!DecompressedBufferOrErr) ++ return createStringError( ++ inconvertibleErrorCode(), ++ "Failed to decompress code object: " + ++ llvm::toString(DecompressedBufferOrErr.takeError())); ++ ++ MemoryBuffer &CodeObjectBuffer = **DecompressedBufferOrErr; ++ + Expected> FileHandlerOrErr = +- CreateFileHandler(*CodeObjectBuffer, BundlerConfig); ++ CreateFileHandler(CodeObjectBuffer, BundlerConfig); + if (!FileHandlerOrErr) + return FileHandlerOrErr.takeError(); + + std::unique_ptr &FileHandler = *FileHandlerOrErr; + assert(FileHandler); + +- if (Error ReadErr = FileHandler->ReadHeader(*CodeObjectBuffer)) ++ if (Error ReadErr = FileHandler->ReadHeader(CodeObjectBuffer)) + return ReadErr; + + Expected> CurBundleIDOrErr = +- FileHandler->ReadBundleStart(*CodeObjectBuffer); ++ FileHandler->ReadBundleStart(CodeObjectBuffer); + if (!CurBundleIDOrErr) + return CurBundleIDOrErr.takeError(); + +@@ -1393,7 +1645,7 @@ Error OffloadBundler::UnbundleArchive() { + BundlerConfig)) { + std::string BundleData; + raw_string_ostream DataStream(BundleData); +- if (Error Err = FileHandler->ReadBundle(DataStream, *CodeObjectBuffer)) ++ if (Error Err = FileHandler->ReadBundle(DataStream, CodeObjectBuffer)) + return Err; + + for (auto &CompatibleTarget : CompatibleTargets) { +@@ -1431,11 +1683,11 @@ Error OffloadBundler::UnbundleArchive() { + } + } + +- if (Error Err = FileHandler->ReadBundleEnd(*CodeObjectBuffer)) ++ if (Error Err = FileHandler->ReadBundleEnd(CodeObjectBuffer)) + return Err; + + Expected> NextTripleOrErr = +- FileHandler->ReadBundleStart(*CodeObjectBuffer); ++ FileHandler->ReadBundleStart(CodeObjectBuffer); + if (!NextTripleOrErr) + return NextTripleOrErr.takeError(); + +diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp +index 9e1f07d78bf1..274875c631c5 100644 +--- a/clang/lib/Driver/ToolChains/Clang.cpp ++++ b/clang/lib/Driver/ToolChains/Clang.cpp +@@ -8400,6 +8400,11 @@ void OffloadBundler::ConstructJob(Compilation &C, const JobAction &JA, + } + CmdArgs.push_back(TCArgs.MakeArgString(UB)); + } ++ if (TCArgs.hasFlag(options::OPT_offload_compress, ++ options::OPT_no_offload_compress, false)) ++ CmdArgs.push_back("-compress"); ++ if (TCArgs.hasArg(options::OPT_v)) ++ CmdArgs.push_back("-verbose"); + // All the inputs are encoded as commands. + C.addCommand(std::make_unique( + JA, *this, ResponseFileSupport::None(), +@@ -8494,6 +8499,8 @@ void OffloadBundler::ConstructJobMultipleOutputs( + } + CmdArgs.push_back("-unbundle"); + CmdArgs.push_back("-allow-missing-bundles"); ++ if (TCArgs.hasArg(options::OPT_v)) ++ CmdArgs.push_back("-verbose"); + + // All the inputs are encoded as commands. + C.addCommand(std::make_unique( +diff --git a/clang/lib/Driver/ToolChains/HIPUtility.cpp b/clang/lib/Driver/ToolChains/HIPUtility.cpp +index 8b9d8db90ffa..04efdcba20ea 100644 +--- a/clang/lib/Driver/ToolChains/HIPUtility.cpp ++++ b/clang/lib/Driver/ToolChains/HIPUtility.cpp +@@ -84,6 +84,12 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA, + Args.MakeArgString(std::string("-output=").append(Output)); + BundlerArgs.push_back(BundlerOutputArg); + ++ if (Args.hasFlag(options::OPT_offload_compress, ++ options::OPT_no_offload_compress, false)) ++ BundlerArgs.push_back("-compress"); ++ if (Args.hasArg(options::OPT_v)) ++ BundlerArgs.push_back("-verbose"); ++ + const char *Bundler = Args.MakeArgString( + T.getToolChain().GetProgramPath("clang-offload-bundler")); + C.addCommand(std::make_unique( +diff --git a/clang/test/Driver/clang-offload-bundler-zlib.c b/clang/test/Driver/clang-offload-bundler-zlib.c +new file mode 100644 +index 000000000000..c46c32a4a053 +--- /dev/null ++++ b/clang/test/Driver/clang-offload-bundler-zlib.c +@@ -0,0 +1,75 @@ ++// REQUIRES: zlib ++// REQUIRES: x86-registered-target ++// UNSUPPORTED: target={{.*}}-darwin{{.*}}, target={{.*}}-aix{{.*}} ++ ++// ++// Generate the host binary to be bundled. ++// ++// RUN: %clang -O0 -target %itanium_abi_triple %s -c -emit-llvm -o %t.bc ++ ++// ++// Generate an empty file to help with the checks of empty files. ++// ++// RUN: touch %t.empty ++ ++// ++// Generate device binaries to be bundled. ++// ++// RUN: echo 'Content of device file 1' > %t.tgt1 ++// RUN: echo 'Content of device file 2' > %t.tgt2 ++ ++// ++// Check compression/decompression of offload bundle. ++// ++// RUN: env OFFLOAD_BUNDLER_COMPRESS=1 OFFLOAD_BUNDLER_VERBOSE=1 \ ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%t.hip.bundle.bc 2>&1 | \ ++// RUN: FileCheck -check-prefix=COMPRESS %s ++// RUN: clang-offload-bundler -type=bc -list -input=%t.hip.bundle.bc | FileCheck -check-prefix=NOHOST %s ++// RUN: env OFFLOAD_BUNDLER_VERBOSE=1 \ ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -output=%t.res.tgt1 -output=%t.res.tgt2 -input=%t.hip.bundle.bc -unbundle 2>&1 | \ ++// RUN: FileCheck -check-prefix=DECOMPRESS %s ++// RUN: diff %t.tgt1 %t.res.tgt1 ++// RUN: diff %t.tgt2 %t.res.tgt2 ++ ++// ++// COMPRESS: Compression method used: ++// DECOMPRESS: Decompression method: ++// NOHOST-NOT: host- ++// NOHOST-DAG: hip-amdgcn-amd-amdhsa--gfx900 ++// NOHOST-DAG: hip-amdgcn-amd-amdhsa--gfx906 ++// ++ ++// ++// Check -bundle-align option. ++// ++ ++// RUN: clang-offload-bundler -bundle-align=4096 -type=bc -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -input=%t.bc -input=%t.tgt1 -input=%t.tgt2 -output=%t.bundle3.bc -compress ++// RUN: clang-offload-bundler -type=bc -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -output=%t.res.bc -output=%t.res.tgt1 -output=%t.res.tgt2 -input=%t.bundle3.bc -unbundle ++// RUN: diff %t.bc %t.res.bc ++// RUN: diff %t.tgt1 %t.res.tgt1 ++// RUN: diff %t.tgt2 %t.res.tgt2 ++ ++// ++// Check unbundling archive. ++// ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%T/hip_bundle1.bc -compress ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%T/hip_bundle2.bc -compress ++// RUN: llvm-ar cr %T/hip_archive.a %T/hip_bundle1.bc %T/hip_bundle2.bc ++// RUN: clang-offload-bundler -unbundle -type=a -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -output=%T/hip_900.a -output=%T/hip_906.a -input=%T/hip_archive.a ++// RUN: llvm-ar t %T/hip_900.a | FileCheck -check-prefix=HIP-AR-900 %s ++// RUN: llvm-ar t %T/hip_906.a | FileCheck -check-prefix=HIP-AR-906 %s ++// HIP-AR-900-DAG: hip_bundle1-hip-amdgcn-amd-amdhsa--gfx900 ++// HIP-AR-900-DAG: hip_bundle2-hip-amdgcn-amd-amdhsa--gfx900 ++// HIP-AR-906-DAG: hip_bundle1-hip-amdgcn-amd-amdhsa--gfx906 ++// HIP-AR-906-DAG: hip_bundle2-hip-amdgcn-amd-amdhsa--gfx906 ++ ++// Some code so that we can create a binary out of this file. ++int A = 0; ++void test_func(void) { ++ ++A; ++} +diff --git a/clang/test/Driver/clang-offload-bundler-zstd.c b/clang/test/Driver/clang-offload-bundler-zstd.c +new file mode 100644 +index 000000000000..b2b588b72d4d +--- /dev/null ++++ b/clang/test/Driver/clang-offload-bundler-zstd.c +@@ -0,0 +1,72 @@ ++// REQUIRES: zstd ++// REQUIRES: x86-registered-target ++// UNSUPPORTED: target={{.*}}-darwin{{.*}}, target={{.*}}-aix{{.*}} ++ ++// ++// Generate the host binary to be bundled. ++// ++// RUN: %clang -O0 -target %itanium_abi_triple %s -c -emit-llvm -o %t.bc ++ ++// ++// Generate an empty file to help with the checks of empty files. ++// ++// RUN: touch %t.empty ++ ++// ++// Generate device binaries to be bundled. ++// ++// RUN: echo 'Content of device file 1' > %t.tgt1 ++// RUN: echo 'Content of device file 2' > %t.tgt2 ++ ++// ++// Check compression/decompression of offload bundle. ++// ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%t.hip.bundle.bc -compress -verbose 2>&1 | \ ++// RUN: FileCheck -check-prefix=COMPRESS %s ++// RUN: clang-offload-bundler -type=bc -list -input=%t.hip.bundle.bc | FileCheck -check-prefix=NOHOST %s ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -output=%t.res.tgt1 -output=%t.res.tgt2 -input=%t.hip.bundle.bc -unbundle -verbose 2>&1 | \ ++// RUN: FileCheck -check-prefix=DECOMPRESS %s ++// RUN: diff %t.tgt1 %t.res.tgt1 ++// RUN: diff %t.tgt2 %t.res.tgt2 ++// ++// COMPRESS: Compression method used ++// DECOMPRESS: Decompression method ++// NOHOST-NOT: host- ++// NOHOST-DAG: hip-amdgcn-amd-amdhsa--gfx900 ++// NOHOST-DAG: hip-amdgcn-amd-amdhsa--gfx906 ++// ++ ++// ++// Check -bundle-align option. ++// ++ ++// RUN: clang-offload-bundler -bundle-align=4096 -type=bc -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -input=%t.bc -input=%t.tgt1 -input=%t.tgt2 -output=%t.bundle3.bc -compress ++// RUN: clang-offload-bundler -type=bc -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -output=%t.res.bc -output=%t.res.tgt1 -output=%t.res.tgt2 -input=%t.bundle3.bc -unbundle ++// RUN: diff %t.bc %t.res.bc ++// RUN: diff %t.tgt1 %t.res.tgt1 ++// RUN: diff %t.tgt2 %t.res.tgt2 ++ ++// ++// Check unbundling archive. ++// ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%T/hip_bundle1.bc -compress ++// RUN: clang-offload-bundler -type=bc -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -input=%t.tgt1 -input=%t.tgt2 -output=%T/hip_bundle2.bc -compress ++// RUN: llvm-ar cr %T/hip_archive.a %T/hip_bundle1.bc %T/hip_bundle2.bc ++// RUN: clang-offload-bundler -unbundle -type=a -targets=hip-amdgcn-amd-amdhsa--gfx900,hip-amdgcn-amd-amdhsa--gfx906 \ ++// RUN: -output=%T/hip_900.a -output=%T/hip_906.a -input=%T/hip_archive.a ++// RUN: llvm-ar t %T/hip_900.a | FileCheck -check-prefix=HIP-AR-900 %s ++// RUN: llvm-ar t %T/hip_906.a | FileCheck -check-prefix=HIP-AR-906 %s ++// HIP-AR-900-DAG: hip_bundle1-hip-amdgcn-amd-amdhsa--gfx900 ++// HIP-AR-900-DAG: hip_bundle2-hip-amdgcn-amd-amdhsa--gfx900 ++// HIP-AR-906-DAG: hip_bundle1-hip-amdgcn-amd-amdhsa--gfx906 ++// HIP-AR-906-DAG: hip_bundle2-hip-amdgcn-amd-amdhsa--gfx906 ++ ++// Some code so that we can create a binary out of this file. ++int A = 0; ++void test_func(void) { ++ ++A; ++} +diff --git a/clang/test/Driver/hip-offload-compress-zlib.hip b/clang/test/Driver/hip-offload-compress-zlib.hip +new file mode 100644 +index 000000000000..a29b6d037350 +--- /dev/null ++++ b/clang/test/Driver/hip-offload-compress-zlib.hip +@@ -0,0 +1,45 @@ ++// REQUIRES: zlib ++// REQUIRES: x86-registered-target ++// REQUIRES: amdgpu-registered-target ++ ++// Test compress bundled bitcode. ++ ++// RUN: rm -rf %T/a.bc ++// RUN: %clang -c -v --target=x86_64-linux-gnu \ ++// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \ ++// RUN: -fgpu-rdc -nogpuinc -nogpulib \ ++// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ ++// RUN: --offload-compress --offload-device-only --gpu-bundle-output \ ++// RUN: -o %T/a.bc \ ++// RUN: 2>&1 | FileCheck %s ++ ++// CHECK: clang-offload-bundler{{.*}} -type=bc ++// CHECK-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-gfx1100,hip-amdgcn-amd-amdhsa-gfx1101 ++// CHECK-SAME: -compress -verbose ++// CHECK: Compressed bundle format ++ ++// Test uncompress of bundled bitcode. ++ ++// RUN: %clang --hip-link -### -v --target=x86_64-linux-gnu \ ++// RUN: --offload-arch=gfx1100 --offload-arch=gfx1101 \ ++// RUN: -fgpu-rdc -nogpulib \ ++// RUN: %T/a.bc --offload-device-only \ ++// RUN: 2>&1 | FileCheck -check-prefix=UNBUNDLE %s ++ ++// UNBUNDLE: clang-offload-bundler{{.*}} "-type=bc" ++// UNBUNDLE-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-gfx1100,hip-amdgcn-amd-amdhsa-gfx1101 ++// UNBUNDLE-SAME: -unbundle ++// UNBUNDLE-SAME: -verbose ++ ++// Test compress bundled code objects. ++ ++// RUN: %clang -c -### -v --target=x86_64-linux-gnu \ ++// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \ ++// RUN: -nogpuinc -nogpulib \ ++// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ ++// RUN: --offload-compress \ ++// RUN: 2>&1 | FileCheck -check-prefix=CO %s ++ ++// CO: clang-offload-bundler{{.*}} "-type=o" ++// CO-SAME: -targets={{.*}}hipv4-amdgcn-amd-amdhsa--gfx1100,hipv4-amdgcn-amd-amdhsa--gfx1101 ++// CO-SAME: "-compress" "-verbose" +diff --git a/clang/test/Driver/hip-offload-compress-zstd.hip b/clang/test/Driver/hip-offload-compress-zstd.hip +new file mode 100644 +index 000000000000..688c2c85329c +--- /dev/null ++++ b/clang/test/Driver/hip-offload-compress-zstd.hip +@@ -0,0 +1,45 @@ ++// REQUIRES: zstd ++// REQUIRES: x86-registered-target ++// REQUIRES: amdgpu-registered-target ++ ++// Test compress bundled bitcode. ++ ++// RUN: rm -rf %T/a.bc ++// RUN: %clang -c -v --target=x86_64-linux-gnu \ ++// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \ ++// RUN: -fgpu-rdc -nogpuinc -nogpulib \ ++// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ ++// RUN: --offload-compress --offload-device-only --gpu-bundle-output \ ++// RUN: -o %T/a.bc \ ++// RUN: 2>&1 | FileCheck %s ++ ++// CHECK: clang-offload-bundler{{.*}} -type=bc ++// CHECK-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-gfx1100,hip-amdgcn-amd-amdhsa-gfx1101 ++// CHECK-SAME: -compress -verbose ++// CHECK: Compressed bundle format ++ ++// Test uncompress of bundled bitcode. ++ ++// RUN: %clang --hip-link -### -v --target=x86_64-linux-gnu \ ++// RUN: --offload-arch=gfx1100 --offload-arch=gfx1101 \ ++// RUN: -fgpu-rdc -nogpulib \ ++// RUN: %T/a.bc --offload-device-only \ ++// RUN: 2>&1 | FileCheck -check-prefix=UNBUNDLE %s ++ ++// UNBUNDLE: clang-offload-bundler{{.*}} "-type=bc" ++// UNBUNDLE-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-gfx1100,hip-amdgcn-amd-amdhsa-gfx1101 ++// UNBUNDLE-SAME: -unbundle ++// UNBUNDLE-SAME: -verbose ++ ++// Test compress bundled code objects. ++ ++// RUN: %clang -c -### -v --target=x86_64-linux-gnu \ ++// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \ ++// RUN: -nogpuinc -nogpulib \ ++// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ ++// RUN: --offload-compress \ ++// RUN: 2>&1 | FileCheck -check-prefix=CO %s ++ ++// CO: clang-offload-bundler{{.*}} "-type=o" ++// CO-SAME: -targets={{.*}}hipv4-amdgcn-amd-amdhsa--gfx1100,hipv4-amdgcn-amd-amdhsa--gfx1101 ++// CO-SAME: "-compress" "-verbose" +diff --git a/clang/tools/clang-offload-bundler/CMakeLists.txt b/clang/tools/clang-offload-bundler/CMakeLists.txt +index dabd82382cdf..dec2881589a5 100644 +--- a/clang/tools/clang-offload-bundler/CMakeLists.txt ++++ b/clang/tools/clang-offload-bundler/CMakeLists.txt +@@ -1,4 +1,5 @@ + set(LLVM_LINK_COMPONENTS ++ BinaryFormat + Object + Support + TargetParser +diff --git a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp +index c02b5854bded..68f29807b219 100644 +--- a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp ++++ b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp +@@ -141,6 +141,11 @@ int main(int argc, const char **argv) { + cl::desc("Treat hip and hipv4 offload kinds as " + "compatible with openmp kind, and vice versa.\n"), + cl::init(false), cl::cat(ClangOffloadBundlerCategory)); ++ cl::opt Compress("compress", ++ cl::desc("Compress output file when bundling.\n"), ++ cl::init(false), cl::cat(ClangOffloadBundlerCategory)); ++ cl::opt Verbose("verbose", cl::desc("Print debug information.\n"), ++ cl::init(false), cl::cat(ClangOffloadBundlerCategory)); + + // Process commandline options and report errors + sys::PrintStackTraceOnErrorSignal(argv[0]); +@@ -169,6 +174,11 @@ int main(int argc, const char **argv) { + BundlerConfig.BundleAlignment = BundleAlignment; + BundlerConfig.FilesType = FilesType; + BundlerConfig.ObjcopyPath = ""; ++ // Do not override the default value Compress and Verbose in BundlerConfig. ++ if (Compress.getNumOccurrences() > 0) ++ BundlerConfig.Compress = Compress; ++ if (Verbose.getNumOccurrences() > 0) ++ BundlerConfig.Verbose = Verbose; + + BundlerConfig.TargetNames = TargetNames; + BundlerConfig.InputFileNames = InputFileNames; +diff --git a/llvm/include/llvm/BinaryFormat/Magic.h b/llvm/include/llvm/BinaryFormat/Magic.h +index 329c96f5c14c..a28710dcdfaf 100644 +--- a/llvm/include/llvm/BinaryFormat/Magic.h ++++ b/llvm/include/llvm/BinaryFormat/Magic.h +@@ -42,19 +42,21 @@ struct file_magic { + macho_universal_binary, ///< Mach-O universal binary + macho_file_set, ///< Mach-O file set binary + minidump, ///< Windows minidump file +- coff_cl_gl_object, ///< Microsoft cl.exe's intermediate code file +- coff_object, ///< COFF object file +- coff_import_library, ///< COFF import library +- pecoff_executable, ///< PECOFF executable file +- windows_resource, ///< Windows compiled resource file (.res) +- xcoff_object_32, ///< 32-bit XCOFF object file +- xcoff_object_64, ///< 64-bit XCOFF object file +- wasm_object, ///< WebAssembly Object file +- pdb, ///< Windows PDB debug info file +- tapi_file, ///< Text-based Dynamic Library Stub file +- cuda_fatbinary, ///< CUDA Fatbinary object file +- offload_binary, ///< LLVM offload object file +- dxcontainer_object, ///< DirectX container file ++ coff_cl_gl_object, ///< Microsoft cl.exe's intermediate code file ++ coff_object, ///< COFF object file ++ coff_import_library, ///< COFF import library ++ pecoff_executable, ///< PECOFF executable file ++ windows_resource, ///< Windows compiled resource file (.res) ++ xcoff_object_32, ///< 32-bit XCOFF object file ++ xcoff_object_64, ///< 64-bit XCOFF object file ++ wasm_object, ///< WebAssembly Object file ++ pdb, ///< Windows PDB debug info file ++ tapi_file, ///< Text-based Dynamic Library Stub file ++ cuda_fatbinary, ///< CUDA Fatbinary object file ++ offload_binary, ///< LLVM offload object file ++ dxcontainer_object, ///< DirectX container file ++ offload_bundle, ///< Clang offload bundle file ++ offload_bundle_compressed, ///< Compressed clang offload bundle file + }; + + bool is_object() const { return V != unknown; } +diff --git a/llvm/lib/BinaryFormat/Magic.cpp b/llvm/lib/BinaryFormat/Magic.cpp +index aa84bc36bfde..76aa1a602aa8 100644 +--- a/llvm/lib/BinaryFormat/Magic.cpp ++++ b/llvm/lib/BinaryFormat/Magic.cpp +@@ -87,6 +87,10 @@ file_magic llvm::identify_magic(StringRef Magic) { + if (startswith(Magic, "BC\xC0\xDE")) + return file_magic::bitcode; + break; ++ case 'C': ++ if (startswith(Magic, "CCOB")) ++ return file_magic::offload_bundle_compressed; ++ break; + case '!': + if (startswith(Magic, "!\n") || startswith(Magic, "!\n")) + return file_magic::archive; +@@ -246,6 +250,13 @@ file_magic llvm::identify_magic(StringRef Magic) { + return file_magic::coff_object; + break; + ++ case '_': { ++ const char OBMagic[] = "__CLANG_OFFLOAD_BUNDLE__"; ++ if (Magic.size() >= sizeof(OBMagic) && startswith(Magic, OBMagic)) ++ return file_magic::offload_bundle; ++ break; ++ } ++ + default: + break; + } +diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp +index d18aed8b3b8c..0ee9f7fac448 100644 +--- a/llvm/lib/Object/Binary.cpp ++++ b/llvm/lib/Object/Binary.cpp +@@ -87,6 +87,8 @@ Expected> object::createBinary(MemoryBufferRef Buffer, + case file_magic::cuda_fatbinary: + case file_magic::coff_cl_gl_object: + case file_magic::dxcontainer_object: ++ case file_magic::offload_bundle: ++ case file_magic::offload_bundle_compressed: + // Unrecognized object file format. + return errorCodeToError(object_error::invalid_file_type); + case file_magic::offload_binary: +diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp +index 56a1d09097d4..4cc95ea32f60 100644 +--- a/llvm/lib/Object/ObjectFile.cpp ++++ b/llvm/lib/Object/ObjectFile.cpp +@@ -154,6 +154,8 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type, + case file_magic::cuda_fatbinary: + case file_magic::offload_binary: + case file_magic::dxcontainer_object: ++ case file_magic::offload_bundle: ++ case file_magic::offload_bundle_compressed: + return errorCodeToError(object_error::invalid_file_type); + case file_magic::tapi_file: + return errorCodeToError(object_error::invalid_file_type); +-- +2.43.0 + diff --git a/pkgs/development/rocm-modules/6/llvm/base.nix b/pkgs/development/rocm-modules/6/llvm/base.nix index 95f57b052045..88b384b43d8e 100644 --- a/pkgs/development/rocm-modules/6/llvm/base.nix +++ b/pkgs/development/rocm-modules/6/llvm/base.nix @@ -72,7 +72,9 @@ in stdenv.mkDerivation (finalAttrs: { "info" # Avoid `attribute 'info' missing` when using with wrapCC ]; - patches = extraPatches; + patches = [ + ./add-compression-to-clang-offload-bundler.patch + ] ++ extraPatches; src = fetchFromGitHub { owner = "ROCm"; @@ -133,7 +135,14 @@ in stdenv.mkDerivation (finalAttrs: { "-DLLVM_EXTERNAL_LIT=${lit}/bin/.lit-wrapped" ] ++ extraCMakeFlags; - postPatch = lib.optionalString finalAttrs.passthru.isLLVM '' + prePatch = '' + cd ../ + chmod -R u+w . + ''; + + postPatch = '' + cd ${targetDir} + '' + lib.optionalString finalAttrs.passthru.isLLVM '' patchShebangs lib/OffloadArch/make_generated_offload_arch_h.sh '' + lib.optionalString (buildTests && finalAttrs.passthru.isLLVM) '' # FileSystem permissions tests fail with various special bits @@ -141,7 +150,7 @@ in stdenv.mkDerivation (finalAttrs: { rm unittests/Support/Path.cpp substituteInPlace unittests/Support/CMakeLists.txt \ - --replace "Path.cpp" "" + --replace-fail "Path.cpp" "" '' + extraPostPatch; doCheck = buildTests; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix b/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix index 5a61732ffd2d..0d982299ec6e 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix @@ -2,13 +2,14 @@ , callPackage , rocmUpdateScript , llvm +, makeWrapper }: callPackage ../base.nix rec { inherit stdenv rocmUpdateScript; targetName = "clang-unwrapped"; targetDir = "clang"; - extraBuildInputs = [ llvm ]; + extraBuildInputs = [ llvm makeWrapper ]; extraCMakeFlags = [ "-DCLANG_INCLUDE_DOCS=ON" @@ -20,7 +21,7 @@ callPackage ../base.nix rec { ln -s ../cmake/Modules/FindLibEdit.cmake cmake/modules substituteInPlace CMakeLists.txt \ - --replace "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)" + --replace-fail "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)" # `No such file or directory: '/build/source/clang/tools/scan-build/bin/scan-build'` rm test/Analysis/scan-build/*.test @@ -41,6 +42,12 @@ callPackage ../base.nix rec { extraPostInstall = '' mv bin/clang-tblgen $out/bin + # add wrapper to compress embedded accelerator-specific code + # this makes the output of composable_kernel significantly smaller right now + # TODO: remove this once ROCm does it out of the box + mv $out/bin/clang-offload-bundler $out/bin/clang-offload-bundler-unwrapped + makeWrapper $out/bin/clang-offload-bundler-unwrapped $out/bin/clang-offload-bundler \ + --add-flags '-compress' ''; requiredSystemFeatures = [ "big-parallel" ]; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix b/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix index 7e7cf9c2a608..2446723ef5fe 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix @@ -14,11 +14,11 @@ callPackage ../base.nix rec { # `Failed to match ... against ...` `Match value not within tolerance value of MPFR result:` # We need a better way, but I don't know enough sed magic and patching `CMakeLists.txt` isn't working... substituteInPlace ../libc/test/src/math/log10_test.cpp \ - --replace "i < N" "i < 0" \ - --replace "test(mpfr::RoundingMode::Nearest);" "" \ - --replace "test(mpfr::RoundingMode::Downward);" "" \ - --replace "test(mpfr::RoundingMode::Upward);" "" \ - --replace "test(mpfr::RoundingMode::TowardZero);" "" + --replace-fail "i < N" "i < 0" \ + --replace-fail "test(mpfr::RoundingMode::Nearest);" "" \ + --replace-fail "test(mpfr::RoundingMode::Downward);" "" \ + --replace-fail "test(mpfr::RoundingMode::Upward);" "" \ + --replace-fail "test(mpfr::RoundingMode::TowardZero);" "" ''; checkTargets = [ "check-${targetName}" ]; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/0000-mlir-fix-debugtranslation.patch b/pkgs/development/rocm-modules/6/llvm/stage-3/0000-mlir-fix-debugtranslation.patch deleted file mode 100644 index f4221a088136..000000000000 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/0000-mlir-fix-debugtranslation.patch +++ /dev/null @@ -1,36 +0,0 @@ -From f1d1e10ec7e1061bf0b90abbc1e298d9438a5e74 Mon Sep 17 00:00:00 2001 -From: Scott Linder -Date: Mon, 11 Sep 2023 18:37:37 +0000 -Subject: [PATCH] [HeterogeneousDWARF] Update MLIR DI Metadata handling - -Pass a default DW_MSPACE_LLVM_none to satisfy new API - -Change-Id: I50df461f00b5510a715f55f61107122318102d22 ---- - lib/Target/LLVMIR/DebugTranslation.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/lib/Target/LLVMIR/DebugTranslation.cpp b/lib/Target/LLVMIR/DebugTranslation.cpp -index 2053f5bcef06aa6..635ee5d7e5fefdc 100644 ---- a/lib/Target/LLVMIR/DebugTranslation.cpp -+++ b/lib/Target/LLVMIR/DebugTranslation.cpp -@@ -148,7 +148,8 @@ llvm::DIDerivedType *DebugTranslation::translateImpl(DIDerivedTypeAttr attr) { - /*File=*/nullptr, /*Line=*/0, - /*Scope=*/nullptr, translate(attr.getBaseType()), attr.getSizeInBits(), - attr.getAlignInBits(), attr.getOffsetInBits(), -- /*DWARFAddressSpace=*/std::nullopt, /*Flags=*/llvm::DINode::FlagZero); -+ /*DWARFAddressSpace=*/std::nullopt, llvm::dwarf::DW_MSPACE_LLVM_none, -+ /*Flags=*/llvm::DINode::FlagZero); - } - - llvm::DIFile *DebugTranslation::translateImpl(DIFileAttr attr) { -@@ -185,7 +186,8 @@ DebugTranslation::translateImpl(DILocalVariableAttr attr) { - llvmCtx, translate(attr.getScope()), getMDStringOrNull(attr.getName()), - translate(attr.getFile()), attr.getLine(), translate(attr.getType()), - attr.getArg(), -- /*Flags=*/llvm::DINode::FlagZero, attr.getAlignInBits(), -+ /*Flags=*/llvm::DINode::FlagZero, llvm::dwarf::DW_MSPACE_LLVM_none, -+ attr.getAlignInBits(), - /*Annotations=*/nullptr); - } - diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix index 91f34265f85f..a0e1935d3c5f 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix @@ -68,6 +68,6 @@ wrapCCWith rec { # GPU compilation uses builtin `lld` substituteInPlace $out/bin/{clang,clang++} \ - --replace "-MM) dontLink=1 ;;" "-MM | --cuda-device-only) dontLink=1 ;;''\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;" + --replace-fail "-MM) dontLink=1 ;;" "-MM | --cuda-device-only) dontLink=1 ;;''\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;" ''; } diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix index 1fd72ee67188..c395dd792db0 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix @@ -21,13 +21,13 @@ in callPackage ../base.nix rec { # `clspv` tests fail, unresolved calls extraPostPatch = '' substituteInPlace CMakeLists.txt \ - --replace "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ + --replace-fail "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ "find_program( LLVM_CLANG clang PATHS \"${clang}/bin\" NO_DEFAULT_PATH )" \ - --replace "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ + --replace-fail "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ "find_program( LLVM_SPIRV llvm-spirv PATHS \"${spirv}/bin\" NO_DEFAULT_PATH )" \ - --replace " spirv-mesa3d-" "" \ - --replace " spirv64-mesa3d-" "" \ - --replace "NOT \''${t} MATCHES" \ + --replace-fail " spirv-mesa3d-" "" \ + --replace-fail " spirv64-mesa3d-" "" \ + --replace-fail "NOT \''${t} MATCHES" \ "NOT \''${ARCH} STREQUAL \"clspv\" AND NOT \''${ARCH} STREQUAL \"clspv64\" AND NOT \''${t} MATCHES" ''; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix index 6de685ea2771..8b71b3fb2977 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix @@ -7,6 +7,7 @@ , glslang , shaderc , lit +, fetchpatch }: callPackage ../base.nix rec { @@ -17,9 +18,12 @@ callPackage ../base.nix rec { targetDir = targetName; # Fix `DebugTranslation.cpp:139:10: error: no matching function for call to 'get'` - # We patch at a different source root, so we modify the patch and include it locally - # https://github.com/ROCm/llvm-project/commit/f1d1e10ec7e1061bf0b90abbc1e298d9438a5e74.patch - extraPatches = [ ./0000-mlir-fix-debugtranslation.patch ]; + extraPatches = [ + (fetchpatch { + url = "https://github.com/ROCm/llvm-project/commit/f1d1e10ec7e1061bf0b90abbc1e298d9438a5e74.patch"; + hash = "sha256-3c91A9InMKxm+JcnWxoUeOU68y5I6w1AAXx6T9UByqI="; + }) + ]; extraNativeBuildInputs = [ clr ]; extraBuildInputs = [ @@ -41,7 +45,7 @@ callPackage ../base.nix rec { extraPostPatch = '' # `add_library cannot create target "llvm_gtest" because an imported target with the same name already exists` substituteInPlace CMakeLists.txt \ - --replace "EXISTS \''${UNITTEST_DIR}/googletest/include/gtest/gtest.h" "FALSE" + --replace-fail "EXISTS \''${UNITTEST_DIR}/googletest/include/gtest/gtest.h" "FALSE" # Mainly `No such file or directory` cat ${./1001-mlir-failing-tests.list} | xargs -d \\n rm diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix index e001f33dfd43..da5c2e16f5d3 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix @@ -11,7 +11,7 @@ callPackage ../base.nix rec { extraPostPatch = '' # `add_library cannot create target "llvm_gtest" because an imported target with the same name already exists` substituteInPlace CMakeLists.txt \ - --replace "NOT TARGET gtest" "FALSE" + --replace-fail "NOT TARGET gtest" "FALSE" ''; checkTargets = [ "check-${targetName}" ]; diff --git a/pkgs/development/tools/benthos/default.nix b/pkgs/development/tools/benthos/default.nix index 59e475fba209..850adc445bad 100644 --- a/pkgs/development/tools/benthos/default.nix +++ b/pkgs/development/tools/benthos/default.nix @@ -16,7 +16,7 @@ buildGoModule rec { proxyVendor = true; - vendorHash = "sha256-bnQn6gdHhbUJUPWU3CKrw1sq5CL0Tkss4DINPwlsiPU="; + vendorHash = "sha256-Ce2vXPKbyj517N3uJEGc00hCVZhcRrPvXUSuK+jjK3U="; doCheck = false; diff --git a/pkgs/development/tools/dapr/cli/default.nix b/pkgs/development/tools/dapr/cli/default.nix index c1d06b45982d..a672b9637e33 100644 --- a/pkgs/development/tools/dapr/cli/default.nix +++ b/pkgs/development/tools/dapr/cli/default.nix @@ -11,7 +11,7 @@ buildGoModule rec { sha256 = "sha256-nR9+6glX0oUJZq32XxyV4aVjfjVlNycZvMNaVHy+Q1s="; }; - vendorHash = "sha256-iqoxlqSdHDfLlb1bcHLPAO2/wiwRpqFBIuoVi7lecKs="; + vendorHash = "sha256-kFmoNd40YxUXVXk0F1Bf77KS5AM0jjOTwTjM5pYKkv4="; proxyVendor = true; diff --git a/pkgs/development/tools/database/sqlcmd/default.nix b/pkgs/development/tools/database/sqlcmd/default.nix index c11475a3caa4..7e23d5e624bd 100644 --- a/pkgs/development/tools/database/sqlcmd/default.nix +++ b/pkgs/development/tools/database/sqlcmd/default.nix @@ -17,7 +17,7 @@ buildGoModule rec { sha256 = "sha256-LLRNaY6ArUNoKSWSauCh2RKEGO5+G1OnoCAqMaAfOkY="; }; - vendorHash = "sha256-G6Patjrafg9VXXbisBDs/JVvy0SA6moTquKj66z9lzw="; + vendorHash = "sha256-NVmgAlNQvRj/7poIEWjMyKw2qWMd/HwbdSFHpumnRlo="; proxyVendor = true; ldflags = [ "-s" "-w" "-X main.version=${version}" ]; diff --git a/pkgs/development/tools/fq/default.nix b/pkgs/development/tools/fq/default.nix index 661757d1513d..f36d2a213b0f 100644 --- a/pkgs/development/tools/fq/default.nix +++ b/pkgs/development/tools/fq/default.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "fq"; - version = "0.10.0"; + version = "0.11.0"; src = fetchFromGitHub { owner = "wader"; repo = "fq"; rev = "v${version}"; - hash = "sha256-7Zprw1UgKEE8pEbmvR6LcT6Ng9oMRVDCy4HkgDNNYcU="; + hash = "sha256-C9YvAHzpNwOVbFWxmdT5BUwsLug7k6ZLYboYJTgp82I="; }; - vendorHash = "sha256-DodVm3Ga7+PD5ZORjVJcPruP8brT/aCGxCRlw3gVsJo="; + vendorHash = "sha256-liNRrmcTbN9mLWvgcEFZbgBPAHFGCF/KMV6KwRBWgoU="; ldflags = [ "-s" diff --git a/pkgs/development/tools/go-migrate/default.nix b/pkgs/development/tools/go-migrate/default.nix index da20ec45c20b..7044262373de 100644 --- a/pkgs/development/tools/go-migrate/default.nix +++ b/pkgs/development/tools/go-migrate/default.nix @@ -12,7 +12,7 @@ buildGoModule rec { }; proxyVendor = true; # darwin/linux hash mismatch - vendorHash = "sha256-3otiRbswhENs/YvKKr+ZeodLWtK7fhCjEtlMDlkLOlY="; + vendorHash = "sha256-q8wShIcVHZtpnhvZfsxiI5FLq0xneA8IBMDWd/vpz/0="; subPackages = [ "cmd/migrate" ]; diff --git a/pkgs/development/tools/kustomize/default.nix b/pkgs/development/tools/kustomize/default.nix index 153b211d95ab..ad1ea3f61ab4 100644 --- a/pkgs/development/tools/kustomize/default.nix +++ b/pkgs/development/tools/kustomize/default.nix @@ -21,7 +21,7 @@ buildGoModule rec { # avoid finding test and development commands modRoot = "kustomize"; proxyVendor = true; - vendorHash = "sha256-6+8cwRH37lkQvnHBUlSqyNrZMfDpKbeUNJS4YMflBq0="; + vendorHash = "sha256-inCBDIVdvkEdDJEwX7vdoWANk+f01VxhBGPKxrjR6Ao="; nativeBuildInputs = [ installShellFiles ]; diff --git a/pkgs/development/tools/opcr-policy/default.nix b/pkgs/development/tools/opcr-policy/default.nix index e1900a1f84f3..e8d4e9a599ab 100644 --- a/pkgs/development/tools/opcr-policy/default.nix +++ b/pkgs/development/tools/opcr-policy/default.nix @@ -19,7 +19,7 @@ buildGoModule rec { subPackages = [ "cmd/policy" ]; # disable go workspaces - GOWORK = "off"; + env.GOWORK = "off"; doCheck = false; diff --git a/pkgs/development/tools/protolint/default.nix b/pkgs/development/tools/protolint/default.nix index ab1290def195..36338a665851 100644 --- a/pkgs/development/tools/protolint/default.nix +++ b/pkgs/development/tools/protolint/default.nix @@ -1,16 +1,16 @@ { lib, buildGoModule, fetchFromGitHub }: buildGoModule rec { pname = "protolint"; - version = "0.49.4"; + version = "0.49.6"; src = fetchFromGitHub { owner = "yoheimuta"; repo = pname; rev = "v${version}"; - hash = "sha256-5z9R2LHwwb7aFMvJDYmMRny7lHG4JUSNhU1Hfm0Z1Mc="; + hash = "sha256-wGAHc0I2ewXJeHPH2qO6V3ScixUAMIX5U7zCBi4fqew="; }; - vendorHash = "sha256-8yV/YyNSn6O2UjAQlzM90fOoi3TdxO+v4YPtmSQMFC0="; + vendorHash = "sha256-0+GaTE/qKfPfZpkzUBglIXQoZD6fYkX6Z3QabkZ+IcE="; # Something about the way we run tests causes issues. It doesn't happen # when using "go test" directly: diff --git a/pkgs/development/tools/rust/cargo-tally/default.nix b/pkgs/development/tools/rust/cargo-tally/default.nix index 955e03247b76..d9db7c536990 100644 --- a/pkgs/development/tools/rust/cargo-tally/default.nix +++ b/pkgs/development/tools/rust/cargo-tally/default.nix @@ -2,14 +2,14 @@ rustPlatform.buildRustPackage rec { pname = "cargo-tally"; - version = "1.0.42"; + version = "1.0.43"; src = fetchCrate { inherit pname version; - hash = "sha256-xtnWk5+08fc/NR0kGIhdpvMLAjXKUwH0tCtUIMMRb5s="; + hash = "sha256-LPqoq9iry8nNXphFdmjwepNB1bK8/myOEoT4UM0xF70="; }; - cargoHash = "sha256-fsKGd8W0Kdbjij8+44oxE6QiixUkwk0Mx3CefXMLSwg="; + cargoHash = "sha256-FU4NYa2S9x0IXhPtWM0PyOBCGCGHj80QR7DRuDgDYJY="; buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ DiskArbitration diff --git a/pkgs/development/tools/rust/cargo-temp/default.nix b/pkgs/development/tools/rust/cargo-temp/default.nix index d5a0e2bba146..7c4a84401095 100644 --- a/pkgs/development/tools/rust/cargo-temp/default.nix +++ b/pkgs/development/tools/rust/cargo-temp/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "cargo-temp"; - version = "0.2.19"; + version = "0.2.20"; src = fetchFromGitHub { owner = "yozhgoor"; repo = "cargo-temp"; rev = "v${version}"; - hash = "sha256-vLD7M+Pg0BHJq9zDPeJLY+v/Vri/XtV3pQu0+ZE84Ew="; + hash = "sha256-zyzzYftoMNPHvCtGYsxEiiWXd3vjWTfmiIpEJ86ac9c="; }; - cargoHash = "sha256-NKT5AijwNm/BVhHGVAXq6sWBJYjSpq90TXHjlrihldo="; + cargoHash = "sha256-qkYvgKTT4wdYBRTwtDiHYCEBtbNjr6CWQB2y/kL0f8Y="; meta = with lib; { description = "A CLI tool that allow you to create a temporary new Rust project using cargo with already installed dependencies"; diff --git a/pkgs/development/tools/wails/default.nix b/pkgs/development/tools/wails/default.nix index 660944b5bde2..174f165fea81 100644 --- a/pkgs/development/tools/wails/default.nix +++ b/pkgs/development/tools/wails/default.nix @@ -23,7 +23,7 @@ buildGoModule rec { hash = "sha256-MHwIRanmgpjTKM+ILSQheCd9+XUwVTCVrREqntxpv7Q="; } + "/v2"; - vendorHash = "sha256-0cGmJEi7OfMZS7ObPBLHOVqKfvnlpHBiGRjSdV6wxE4="; + vendorHash = "sha256-6QFnLuRnSzIqkQkK1qg7VBYxwjK8fSQWz5RxpuyutoY="; proxyVendor = true; diff --git a/pkgs/games/prismlauncher/wrapper.nix b/pkgs/games/prismlauncher/wrapper.nix index 32c00c63bda5..d91b2731135e 100644 --- a/pkgs/games/prismlauncher/wrapper.nix +++ b/pkgs/games/prismlauncher/wrapper.nix @@ -24,6 +24,7 @@ , mesa-demos , pciutils , udev +, vulkan-loader , libusb1 , msaClientID ? null @@ -100,6 +101,7 @@ symlinkJoin { glfw openal stdenv.cc.cc.lib + vulkan-loader # VulkanMod's lwjgl # oshi udev diff --git a/pkgs/misc/ananicy-rules-cachyos/default.nix b/pkgs/misc/ananicy-rules-cachyos/default.nix index c73f9e3b3fb9..d987d40f3cb5 100644 --- a/pkgs/misc/ananicy-rules-cachyos/default.nix +++ b/pkgs/misc/ananicy-rules-cachyos/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub }: -stdenv.mkDerivation rec { - pname = "ananicy"; +stdenv.mkDerivation { + pname = "ananicy-rules-cachyos"; version = "unstable-2024-04-10"; src = fetchFromGitHub { @@ -15,11 +15,11 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' - runHook preBuild + runHook preInstall mkdir -p $out cp -r * $out rm $out/README.md - runHook postBuild + runHook postInstall ''; meta = with lib; { @@ -27,6 +27,6 @@ stdenv.mkDerivation rec { description = "ananicy-cpp-rules for CachyOS "; license = licenses.gpl3Only; platforms = platforms.linux; - maintainers = with maintainers; [ artturin johnrtitor ]; + maintainers = with maintainers; [ artturin johnrtitor diniamo ]; }; } diff --git a/pkgs/os-specific/darwin/raycast/default.nix b/pkgs/os-specific/darwin/raycast/default.nix index e28a8c347eac..9671b5885c82 100644 --- a/pkgs/os-specific/darwin/raycast/default.nix +++ b/pkgs/os-specific/darwin/raycast/default.nix @@ -36,25 +36,23 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru = { - updateScript = writeShellApplication { - name = "raycast-update-script"; - runtimeInputs = [ curl jq common-updater-scripts ]; - text = '' - set -eo pipefail - url=$(curl --silent "https://releases.raycast.com/releases/latest?build=universal") - version=$(echo "$url" | jq -r '.version') - update-source-version raycast "$version" --file=./pkgs/os-specific/darwin/raycast/default.nix - ''; - }; - }; + passthru.updateScript = lib.getExe (writeShellApplication { + name = "raycast-update-script"; + runtimeInputs = [ curl jq common-updater-scripts ]; + text = '' + set -eo pipefail + url=$(curl --silent "https://releases.raycast.com/releases/latest?build=universal") + version=$(echo "$url" | jq -r '.version') + update-source-version raycast "$version" --file=./pkgs/os-specific/darwin/raycast/default.nix + ''; + }); meta = with lib; { description = "Control your tools with a few keystrokes"; homepage = "https://raycast.app/"; license = with licenses; [ unfree ]; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - maintainers = with maintainers; [ lovesegfault stepbrobd ]; + maintainers = with maintainers; [ lovesegfault stepbrobd donteatoreo ]; platforms = [ "aarch64-darwin" "x86_64-darwin" ]; }; }) diff --git a/pkgs/os-specific/linux/fw-ectool/default.nix b/pkgs/os-specific/linux/fw-ectool/default.nix index a73cc1896ecd..1d23411f3eef 100644 --- a/pkgs/os-specific/linux/fw-ectool/default.nix +++ b/pkgs/os-specific/linux/fw-ectool/default.nix @@ -1,38 +1,43 @@ { stdenv , lib -, fetchFromGitHub +, fetchFromGitLab +, cmake , pkg-config -, hostname +, libusb1 +, libftdi1 }: stdenv.mkDerivation { pname = "fw-ectool"; - version = "unstable-2022-12-03"; + version = "0-unstable-2023-12-15"; - src = fetchFromGitHub { + src = fetchFromGitLab { + domain = "gitlab.howett.net"; owner = "DHowett"; - repo = "fw-ectool"; - rev = "54c140399bbc3e6a3dce6c9f842727c4128367be"; - hash = "sha256-2teJFz4zcA+USpbVPXMEIHLdmMLem8ik7YrmrSxr/n0="; + repo = "ectool"; + rev = "3ebe7b8b713b2ebfe2ce92d48fd8d044276b2879"; + hash = "sha256-s6PrFPAL+XJAENqLw5oJqFmAf11tHOJ8h3F5l3pOlZ4="; }; nativeBuildInputs = [ + cmake pkg-config - hostname ]; - buildPhase = '' - patchShebangs util - make out=out utils - ''; + buildInputs = [ + libusb1 + libftdi1 + ]; installPhase = '' - install -D out/util/ectool $out/bin/ectool + runHook preInstall + install -Dm555 src/ectool "$out/bin/ectool" + runHook postInstall ''; meta = with lib; { description = "EC-Tool adjusted for usage with framework embedded controller"; - homepage = "https://github.com/DHowett/framework-ec"; + homepage = "https://gitlab.howett.net/DHowett/ectool"; license = licenses.bsd3; maintainers = [ maintainers.mkg20001 ]; platforms = platforms.linux; diff --git a/pkgs/servers/alps/default.nix b/pkgs/servers/alps/default.nix index 70659f0c3c5e..03bd62e4618b 100644 --- a/pkgs/servers/alps/default.nix +++ b/pkgs/servers/alps/default.nix @@ -11,7 +11,7 @@ buildGoModule rec { hash = "sha256-RSug3YSiqYLGs05Bee4NoaoCyPvUZ7IqlKWI1hmxbiA="; }; - vendorHash = "sha256-XDm6LU9D/rVQHiko7EFpocv+IktGe6tQhJYRrOJxeSs="; + vendorHash = "sha256-QsGfINktk+rBj4b5h+NBVS6XV1SVz+9fDL1vtUqcKEU="; ldflags = [ "-s" diff --git a/pkgs/servers/caddy/xcaddy/default.nix b/pkgs/servers/caddy/xcaddy/default.nix index 930b3db4327b..c90ef853b065 100644 --- a/pkgs/servers/caddy/xcaddy/default.nix +++ b/pkgs/servers/caddy/xcaddy/default.nix @@ -2,7 +2,7 @@ buildGoModule rec { pname = "xcaddy"; - version = "0.3.5"; + version = "0.4.0"; subPackages = [ "cmd/xcaddy" ]; @@ -10,7 +10,7 @@ buildGoModule rec { owner = "caddyserver"; repo = pname; rev = "v${version}"; - hash = "sha256-XxklyOaKFPyWFabodNCcV1NnaPWS0AQ2Sj89ZZ5hJbk="; + hash = "sha256-wzX6+O7hN8x3DDkTdNMBuWTCY8dp1gGrF2TW1d07PEc="; }; patches = [ @@ -24,7 +24,7 @@ buildGoModule rec { "-X github.com/caddyserver/xcaddy/cmd.customVersion=v${version}" ]; - vendorHash = "sha256-RpbnoXyTrqGOI7DpgkO+J47P17T4QCVvM1CfS6kRO9Y="; + vendorHash = "sha256-7yd/6h1DKw7X/1NbHtr2vbpyapF81HPmDm7O4oV5nlc="; meta = with lib; { homepage = "https://github.com/caddyserver/xcaddy"; diff --git a/pkgs/servers/dendrite/default.nix b/pkgs/servers/dendrite/default.nix index 0eed749f3890..1e40ab671511 100644 --- a/pkgs/servers/dendrite/default.nix +++ b/pkgs/servers/dendrite/default.nix @@ -10,16 +10,16 @@ buildGoModule rec { pname = "matrix-dendrite"; - version = "0.13.6"; + version = "0.13.7"; src = fetchFromGitHub { owner = "matrix-org"; repo = "dendrite"; rev = "v${version}"; - hash = "sha256-R/67y7ZiqH2Yg7JFsNYOuGocvR161srlWjRgjyZsqaE="; + hash = "sha256-A6rQ8zqpV6SBpiALIPMF1nZtGvUtzoiTE2Rioh3T1WA="; }; - vendorHash = "sha256-/+JSL54y7u7mGeDwAJV17Ibjb/LffitUOgonUd9EzDA="; + vendorHash = "sha256-ByRCI4MuU8/ilbeNNOXSsTlBVHL5MkxLHItEGeGC9MQ="; subPackages = [ # The server diff --git a/pkgs/servers/hydron/default.nix b/pkgs/servers/hydron/default.nix index 9a3381843b55..912d0971f01a 100644 --- a/pkgs/servers/hydron/default.nix +++ b/pkgs/servers/hydron/default.nix @@ -17,7 +17,7 @@ buildGoModule rec { hash = "sha256-Q1pZf5FPQw+pHItcZyOGx0N+iHmz9rW0+ANFsketh6E="; }; - vendorHash = "sha256-fyGC6k9/xER5GwVelBhy5C5tiq6NMhwSmYjSpvenrfA="; + vendorHash = "sha256-hKF2RCGnk/5hNS65vGoDdF1OUPSLe4PDegYlKTeqJDM="; proxyVendor = true; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/servers/icebreaker/default.nix b/pkgs/servers/icebreaker/default.nix index ac01d659f175..0624a97be5e0 100644 --- a/pkgs/servers/icebreaker/default.nix +++ b/pkgs/servers/icebreaker/default.nix @@ -16,7 +16,7 @@ buildGoModule { }; proxyVendor = true; - vendorHash = "sha256-i648w+BOUX5IfEEZ11gJAjX1ZUdoYRzDPz6GDe7i2S8="; + vendorHash = "sha256-A0jNy8cUKpfAqocgjdYU7LB4EgIr9tiOCyEaXGQl8TM="; nativeBuildInputs = [ makeBinaryWrapper diff --git a/pkgs/servers/monitoring/phlare/default.nix b/pkgs/servers/monitoring/phlare/default.nix index bc2c7cee63e5..294a85ab06fa 100644 --- a/pkgs/servers/monitoring/phlare/default.nix +++ b/pkgs/servers/monitoring/phlare/default.nix @@ -12,7 +12,7 @@ buildGoModule rec { }; proxyVendor = true; - vendorHash = "sha256-y8IWS5OQkDYRTt5xOzzbjb1ya6AiFtvAc0YNH99KZBA="; + vendorHash = "sha256-l7+iDT9GAP9BX+xKvnx57iVF8wCM1YyHwq6dD9PbTDI="; ldflags = let prefix = "github.com/grafana/phlare/pkg/util/build"; diff --git a/pkgs/servers/monitoring/prometheus/zfs-exporter.nix b/pkgs/servers/monitoring/prometheus/zfs-exporter.nix index 4488b85dd10b..3ba1402dc7a9 100644 --- a/pkgs/servers/monitoring/prometheus/zfs-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/zfs-exporter.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "zfs_exporter"; - version = "2.3.2"; + version = "2.3.4"; src = fetchFromGitHub { owner = "pdf"; repo = pname; rev = "v" + version; - hash = "sha256-JpLrCkPg0vVR0bKKHY5qf1/OD+O7yvWxS7kb7Yg3+c4="; + hash = "sha256-wPahjWTZLt5GapkOmGdGSicAmSGte2BHf6zZBHd7D3g="; }; - vendorHash = "sha256-uIilESEmAxANxFOy7qvYxlF/bId/Kqh4jUspNknlhlc="; + vendorHash = "sha256-EUeP7ysMnFeQO8Gaxhhonxk40cUv04MSiEDsaEcjTuM="; ldflags = [ "-s" diff --git a/pkgs/servers/pufferpanel/default.nix b/pkgs/servers/pufferpanel/default.nix index eb5558bf1d47..122e594f25ba 100644 --- a/pkgs/servers/pufferpanel/default.nix +++ b/pkgs/servers/pufferpanel/default.nix @@ -58,7 +58,7 @@ buildGoModule rec { nativeBuildInputs = [ makeWrapper go-swag ]; - vendorHash = "sha256-itiWROoIhnMbG9evH6X7kjClC4VdpX983d/SCwr4HbY="; + vendorHash = "sha256-1U7l7YW1fu5M0/pPHTLamLsTQdEltesRODUn21SuP8w="; proxyVendor = true; # Generate code for Swagger documentation endpoints (see web/swagger/docs.go). diff --git a/pkgs/servers/teleport/12/default.nix b/pkgs/servers/teleport/12/default.nix index ce91acb763f4..7d1e28afb4c7 100644 --- a/pkgs/servers/teleport/12/default.nix +++ b/pkgs/servers/teleport/12/default.nix @@ -2,7 +2,7 @@ callPackage ../generic.nix ({ version = "12.4.32"; hash = "sha256-dYriqQwrc3tfLv+/G/W8n+4cLbPUq7lq1/kGH/GIsHs="; - vendorHash = "sha256-1z1Aocxi34/6Kuwj30LWjEq+LrZThG6ZzrMb0Qtok8w="; + vendorHash = "sha256-R7gWdUIrc7VLe+9/En47FI3G9x2V1VGUVTrT/kmA9c4="; yarnHash = "sha256-Sr9T2TmrysMQs6A00rHU1IZjslu8jyYkVnYE6AmBmLA="; cargoLock = { lockFile = ./Cargo.lock; diff --git a/pkgs/servers/teleport/13/default.nix b/pkgs/servers/teleport/13/default.nix index 02957376d9f2..06905183b5ab 100644 --- a/pkgs/servers/teleport/13/default.nix +++ b/pkgs/servers/teleport/13/default.nix @@ -2,7 +2,7 @@ callPackage ../generic.nix ({ version = "13.4.14"; hash = "sha256-g11D5lekI3pUpKf5CLUuNjejs0gN/bEemHkCj3akha0="; - vendorHash = "sha256-wQywm41qnv/ryZwwyIg+La1Z7qAw2I/fUI3kLgHlq9Q="; + vendorHash = "sha256-kiDhlR/P81u/yNq72JuskES/UzMrTFzJT0H3xldGk8I="; yarnHash = "sha256-E9T+7aXVoERdUnVEL4va2fcMnv1jsL9Js/R2LZo4hu4="; cargoLock = { lockFile = ./Cargo.lock; diff --git a/pkgs/servers/teleport/14/default.nix b/pkgs/servers/teleport/14/default.nix index df97732bed58..6044975e62f2 100644 --- a/pkgs/servers/teleport/14/default.nix +++ b/pkgs/servers/teleport/14/default.nix @@ -2,7 +2,7 @@ callPackage ../generic.nix ({ version = "14.3.0"; hash = "sha256-yTbJeHCmPlelq7BrZQRY3XyNQiovV7NQ1tNh2NfYGbk="; - vendorHash = "sha256-ySe5YkBMt+1tF/8PWctfAkK/e03cqp5P1aJ2ANz7pLo="; + vendorHash = "sha256-lHsgSbY1nqQminU67QgV6FbHXNlv5tCMv2oVq48S33M="; yarnHash = "sha256-m934P+KygGiCzr5fDsNTlmZ1T9JxA6P8zTimocQyVi0="; cargoLock = { lockFile = ./Cargo.lock; diff --git a/pkgs/tools/misc/ckb-next/default.nix b/pkgs/tools/misc/ckb-next/default.nix index 549cb543af19..959493d3e4bd 100644 --- a/pkgs/tools/misc/ckb-next/default.nix +++ b/pkgs/tools/misc/ckb-next/default.nix @@ -1,5 +1,5 @@ { lib, wrapQtAppsHook, fetchFromGitHub, substituteAll, udev, stdenv -, pkg-config, qtbase, cmake, zlib, kmod, libXdmcp, qttools, qtx11extras, libdbusmenu +, pkg-config, qtbase, cmake, zlib, kmod, libXdmcp, qttools, qtx11extras, libdbusmenu, gnused , withPulseaudio ? stdenv.isLinux, libpulseaudio, quazip }: @@ -47,6 +47,11 @@ stdenv.mkDerivation rec { }) ]; + postInstall = '' + substituteInPlace "$out/lib/udev/rules.d/99-ckb-next-daemon.rules" \ + --replace-fail "/usr/bin/env sed" "${lib.getExe gnused}" + ''; + meta = with lib; { description = "Driver and configuration tool for Corsair keyboards and mice"; homepage = "https://github.com/ckb-next/ckb-next"; diff --git a/pkgs/tools/misc/phrase-cli/default.nix b/pkgs/tools/misc/phrase-cli/default.nix index 6395412e412c..e780f451040b 100644 --- a/pkgs/tools/misc/phrase-cli/default.nix +++ b/pkgs/tools/misc/phrase-cli/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "phrase-cli"; - version = "2.23.1"; + version = "2.23.2"; src = fetchFromGitHub { owner = "phrase"; repo = "phrase-cli"; rev = version; - sha256 = "sha256-5VoRl7pA37QJkgQ6ClyTC6Ya4ZLuVs6aqiAwk1kBFMY="; + sha256 = "sha256-CzDkIFlStfCJpF82pqD8hTxbjH9Nu+0/uygTR0xxxV4="; }; - vendorHash = "sha256-31QMyqJcyWYIq12EA/B0tip70yixFAi7EqIeeo11ZS8="; + vendorHash = "sha256-r07nHJqFWHAMTkmQmy0/jK7N/lDzpnHqmuGTG1FTUiI="; ldflags = [ "-X=github.com/phrase/phrase-cli/cmd.PHRASE_CLIENT_VERSION=${version}" ]; diff --git a/pkgs/tools/networking/dae/default.nix b/pkgs/tools/networking/dae/default.nix index 18856ca5f0e3..0c95db7e3af1 100644 --- a/pkgs/tools/networking/dae/default.nix +++ b/pkgs/tools/networking/dae/default.nix @@ -15,7 +15,7 @@ buildGoModule rec { fetchSubmodules = true; }; - vendorHash = "sha256-qK+x6ciAebwIWHRjRpNXCAqsfnmEx37evS4+7kwcFIs="; + vendorHash = "sha256-4U6zIxK8K+MGxRboTtsKntDMp8/cQWPqXQ3l03AEtBs="; proxyVendor = true; diff --git a/pkgs/tools/networking/juicity/default.nix b/pkgs/tools/networking/juicity/default.nix index 8b655e7eb3de..4581b4f4a7b7 100644 --- a/pkgs/tools/networking/juicity/default.nix +++ b/pkgs/tools/networking/juicity/default.nix @@ -13,7 +13,7 @@ buildGoModule rec { hash = "sha256-SUZ5E2GRLyUI/Z5ekJPNypVJXfJFzIz3qr9kCeXN7Gk="; }; - vendorHash = "sha256-Gj4uM9EL6QjlrCFGq3u1+TkIxzIU2mthFRK00pOAaJg="; + vendorHash = "sha256-13U3B9VKspSlpD1hYPtyCuPAZvAYc/d/UKcjXMURxyo="; proxyVendor = true; diff --git a/pkgs/tools/networking/oneshot/default.nix b/pkgs/tools/networking/oneshot/default.nix index 3ecca675e18c..fe3948041d1a 100644 --- a/pkgs/tools/networking/oneshot/default.nix +++ b/pkgs/tools/networking/oneshot/default.nix @@ -15,7 +15,7 @@ buildGoModule rec { subPackages = [ "cmd" ]; - GOWORK = "off"; + env.GOWORK = "off"; modRoot = "v2"; diff --git a/pkgs/tools/security/age-plugin-tpm/default.nix b/pkgs/tools/security/age-plugin-tpm/default.nix index 3eef366f8ea8..f95f761c580b 100644 --- a/pkgs/tools/security/age-plugin-tpm/default.nix +++ b/pkgs/tools/security/age-plugin-tpm/default.nix @@ -18,7 +18,7 @@ buildGoModule rec { proxyVendor = true; - vendorHash = "sha256-BSb+8p5+RJMfcYc2+BuT4YbhCWCbcYOt9upesD11Ytw="; + vendorHash = "sha256-veduD0K3Onkqvyg9E5v854a6/8UIRQZEH098lUepRNU="; nativeCheckInputs = [ swtpm diff --git a/pkgs/tools/security/cariddi/default.nix b/pkgs/tools/security/cariddi/default.nix index 7773e66a8e6b..b4e07a622c24 100644 --- a/pkgs/tools/security/cariddi/default.nix +++ b/pkgs/tools/security/cariddi/default.nix @@ -5,13 +5,13 @@ buildGoModule rec { pname = "cariddi"; - version = "1.3.3"; + version = "1.3.4"; src = fetchFromGitHub { owner = "edoardottt"; repo = "cariddi"; rev = "refs/tags/v${version}"; - hash = "sha256-nApgsvHSMWmgJWyvdtBdrGt9v8YSwWiGnmrDS8vVvDw="; + hash = "sha256-Hgz+/DEoCo4lxcFkawQgIc3ct7cc2NwpAnfBtZQruf0="; }; vendorHash = "sha256-GgJyYDnlaFybf3Gu1gVcA12HkA0yUIjYEFj0G83GVGQ="; diff --git a/pkgs/tools/security/exploitdb/default.nix b/pkgs/tools/security/exploitdb/default.nix index 99a2f3bd52e7..31c2d4825942 100644 --- a/pkgs/tools/security/exploitdb/default.nix +++ b/pkgs/tools/security/exploitdb/default.nix @@ -7,13 +7,13 @@ stdenv.mkDerivation rec { pname = "exploitdb"; - version = "2024-04-13"; + version = "2024-04-14"; src = fetchFromGitLab { owner = "exploit-database"; repo = "exploitdb"; rev = "refs/tags/${version}"; - hash = "sha256-AgZ2TAeZDVhjNuCCdeXjtGgMOVl7fBkAK8USHAU/h1M="; + hash = "sha256-KMvcK9uvXJ474SF+8tLLYyj5jHoqbWOkhRnlAfuKsMU="; }; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/tools/security/threatest/default.nix b/pkgs/tools/security/threatest/default.nix index a53804f1d1fc..88427627938b 100644 --- a/pkgs/tools/security/threatest/default.nix +++ b/pkgs/tools/security/threatest/default.nix @@ -16,7 +16,7 @@ buildGoModule rec { }; proxyVendor = true; - vendorHash = "sha256-zwHcGy7wjy2yx7nMi88R+z+Is+YcqGRMK0czeBNlcdA="; + vendorHash = "sha256-EvVazz51sW8z+8XfZB0Xo42KuUT6Q9n2Y/0HvlF1bV4="; nativeBuildInputs = [ installShellFiles diff --git a/pkgs/tools/text/ugrep/default.nix b/pkgs/tools/text/ugrep/default.nix index 33173396f267..7587f0a4adbc 100644 --- a/pkgs/tools/text/ugrep/default.nix +++ b/pkgs/tools/text/ugrep/default.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "ugrep"; - version = "5.1.3"; + version = "5.1.4"; src = fetchFromGitHub { owner = "Genivia"; repo = "ugrep"; rev = "v${finalAttrs.version}"; - hash = "sha256-ap0akp787pr1gRGFTGQ6ZPwkABgloqQ05XnmM7filGs="; + hash = "sha256-9hxMxcqrq9uHCe3Ggyv3SdjWe+uTZ4ZuicDf9196Szo="; }; buildInputs = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 21f5497f7bcb..020b84d1e435 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2860,9 +2860,6 @@ with pkgs; dolphin-emu = qt6Packages.callPackage ../applications/emulators/dolphin-emu { inherit (darwin.apple_sdk_11_0.frameworks) CoreBluetooth ForceFeedback IOBluetooth IOKit OpenGL VideoToolbox; inherit (darwin) moltenvk; - stdenv = - if stdenv.isDarwin then overrideLibcxx darwin.apple_sdk_11_0.llvmPackages_16.stdenv - else stdenv; }; dolphin-emu-primehack = qt5.callPackage ../applications/emulators/dolphin-emu/primehack.nix { @@ -23682,9 +23679,9 @@ with pkgs; nghttp2 = callPackage ../development/libraries/nghttp2 { }; libnghttp2 = nghttp2.lib; - nghttp3 = callPackage ../development/libraries/nghttp3 { }; + nghttp3 = callPackage ../development/libraries/nghttp3 { inherit (darwin.apple_sdk.frameworks) CoreServices; }; - ngtcp2 = callPackage ../development/libraries/ngtcp2 { }; + ngtcp2 = callPackage ../development/libraries/ngtcp2 { inherit (darwin.apple_sdk.frameworks) CoreServices; }; ngtcp2-gnutls = callPackage ../development/libraries/ngtcp2/gnutls.nix { }; nix-plugins = callPackage ../development/libraries/nix-plugins { }; @@ -32424,7 +32421,7 @@ with pkgs; CoreMediaIO QuartzCore AppKit CoreWLAN WebKit IOKit GSS MediaPlayer IOSurface Metal MetalKit; stdenv = if stdenv.isDarwin - then overrideLibcxx darwin.apple_sdk_11_0.llvmPackages_12.stdenv + then overrideSDK llvmPackages_14.stdenv "11.0" else stdenv; # telegram-desktop has random crashes when jemalloc is built with gcc. @@ -32628,8 +32625,8 @@ with pkgs; ladspa-sdk = callPackage ../applications/audio/ladspa-sdk { }; - ladybird = darwin.apple_sdk_11_0.callPackage ../applications/networking/browsers/ladybird { - stdenv = if stdenv.isDarwin then overrideLibcxx darwin.apple_sdk_11_0.llvmPackages_16.stdenv else stdenv; + ladybird = callPackage ../applications/networking/browsers/ladybird { + stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; inherit (darwin.apple_sdk_11_0.frameworks) AppKit Cocoa Foundation OpenGL; }; diff --git a/pkgs/top-level/cuda-packages.nix b/pkgs/top-level/cuda-packages.nix index f573d2358147..92960422af44 100644 --- a/pkgs/top-level/cuda-packages.nix +++ b/pkgs/top-level/cuda-packages.nix @@ -69,7 +69,11 @@ let backendStdenv = final.callPackage ../development/cuda-modules/backend-stdenv.nix { }; # Loose packages - cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit { }; + + # TODO: Move to aliases.nix once all Nixpkgs has migrated to the splayed CUDA packages + cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit/redist-wrapper.nix { }; + cudatoolkit-legacy-runfile = final.callPackage ../development/cuda-modules/cudatoolkit { }; + saxpy = final.callPackage ../development/cuda-modules/saxpy { }; nccl = final.callPackage ../development/cuda-modules/nccl { }; nccl-tests = final.callPackage ../development/cuda-modules/nccl-tests { };