Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker icons #908

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Update docker icons #908

wants to merge 2 commits into from

Conversation

jpaju
Copy link
Contributor

@jpaju jpaju commented Jul 20, 2024

Follow up for #906. Icons for Dockerfile and a.Dockerfile don't show up correctly

@jpaju
Copy link
Contributor Author

jpaju commented Jul 20, 2024

I'm unable to build broot locally so investigating the issue with docker icons is impossible right now. I'm on apple silicon mac and when running cargo build or cargo install I get an error:

error: linking with `cc` failed: exit status: 1
  |
  = note: env [...]
  = note: ld: library not found for -liconv
          clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `libz-sys` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Instructions for building broot from source only list required dependencies from Linux distros so it could be that I'm missing some dependency 🤷 @FrancescElies any ideas how to resolve this?

@FrancescElies
Copy link
Contributor

@jpaju I am not aware of having installed that lib explicitely on mac, does running xcode-select --install which installs apples commandlinetools help?.
Otherwise maybe try to install it with brew install libiconv

@jpaju
Copy link
Contributor Author

jpaju commented Jul 25, 2024

I'm using nix dev shell and issue was configuring that for mac.

If someone is interested, this flake.nix did it for me
{
  inputs.nixpkgs.url = "github:nixos/nixpkgs";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { inherit system; };
        darwinDeps = if pkgs.stdenv.isDarwin then with pkgs; [ libiconv darwin.apple_sdk.frameworks.Security ] else [ ];
      in {
        devShells.default = pkgs.mkShell {
          name = "broot";
          buildInputs = with pkgs; [ rustc rust-analyzer cargo openssl pkg-config ] ++ darwinDeps;
        };
      });
}

Now that I'm able to build locally, I was able to debug that the issue is in font.rs get_icon function. Before passing name, double_ext and ext to handle_file function, they are lower cased by calling .to_ascii_lowercase(). Because Dockerfile is capitalized, it fails to find icon.

I'm wondering whether it would be okay to remove .to_ascii_lowercase() from all three parameters when calling handle_file function? Quickly testing this out, it seems to be okay though 🤔

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

Successfully merging this pull request may close these issues.

2 participants