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

mdbook-admonish not found in Dev Container #3336

Closed
2 tasks done
richb-hanover opened this issue Aug 14, 2023 · 17 comments
Closed
2 tasks done

mdbook-admonish not found in Dev Container #3336

richb-hanover opened this issue Aug 14, 2023 · 17 comments
Labels

Comments

@richb-hanover
Copy link
Contributor

richb-hanover commented Aug 14, 2023

What happened?

Solution: Install mdbook-admonish (see steps below.)

Since around the 0.9.0 timeframe, I have noticed that the md-admonish notes are not being displayed properly in the documentation under development.

Things look OK in the production documentation: for example, the Literals page (https://prql-lang.org/book/reference/syntax/literals.html) shows the blue heading for an adminish note as expected.

But the same page rendered by task run-book in the Dev Container shows the same text rendered in monospace font, with no special header.

What other information can I provide to troubleshoot this? Thanks.

PRQL input

N/A

SQL output

N/A

Expected SQL output

No response

MVCE confirmation

  • Minimal example
  • New issue

Anything else?

No response

@richb-hanover richb-hanover added the bug Invalid compiler output or panic label Aug 14, 2023
@aljazerzen
Copy link
Member

You don't have mdbook-amdonish installed. This is a problem with the taskfile / our dev env installation docs.

@aljazerzen aljazerzen removed the bug Invalid compiler output or panic label Aug 14, 2023
@richb-hanover
Copy link
Contributor Author

You don't have mdbook-amdonish installed.

I concur. In the Dev Container, I typed these commands and the "admonish" blocks appeared as expected.

cargo install mdbook-admonish
task run-book

How shall we remember to update the Dev Container to add mdbook-admonish? Thanks.

@richb-hanover richb-hanover changed the title md-admonish notes broken in documentation mdbook-admonish not installed by default in Dev Container Aug 14, 2023
@max-sixty
Copy link
Member

It is there though!

mdbook-admonish mdbook-footnote mdbook-toc wasm-bindgen-cli wasm-opt

And I just tried myself, and it does seem to work on mine.

But it's been there for a while, so I don't think it's likely to be an old devcontainer.

Unless anyone has other ideas — suggest we wait for other repros...

@eitsupi eitsupi added the devops label Aug 15, 2023
@richb-hanover
Copy link
Contributor Author

I can reproduce this. I'm using Docker Desktop 4.22.0 on macOS 12.6.8.

I used Docker Desktop to remove all containers, images, and volumes on the machine. I then opened VS Code, and started the Dev Container. I saw a bunch of messages fly by as it downloaded the images, etc. and built the container.

I then typed task build-all and let it build all the products. Then task run-book to create the book. On the Literals page, all the "admonish notes" show up as monospace font with none of the expected styling (colors/fonts).

In the Dev Container, I then typed cargo install mdbook-admonish and let it complete. Running task run-book again gave the expected "admonish" styling.

@max-sixty
Copy link
Member

Thanks a lot for reproducing @richb-hanover .

What do you get under docker images ps?

I get:

docker images
REPOSITORY                                                                           TAG       IMAGE ID       CREATED        SIZE
ghcr.io/prql/prql-devcontainer-base                                                  latest    05eb74c187d6   2 months ago   2.93GB
python                                                                               latest    46362cb2d76c   2 months ago   1.01GB
rust                                                                                 latest    26f9b1c64317   2 months ago   1.62GB
vsc-prql-45a8f2e1ed21d2bc30bc9d3e826c62cfe4815bc5d94d1f9e44d273a1e9373e33-features   latest    a65c8eef2f1b   2 months ago   3.45GB
ghcr.io/prql/prql-devcontainer-base                                                  <none>    b5f674eb40b0   2 months ago   2.93GB

And if I run docker run -it ghcr.io/prql/prql-devcontainer-base:latest, mdbook-admonish is there...

@richb-hanover
Copy link
Contributor Author

After rebuilding the dev container, I had to use cargo install mdbook-admonish to get the colors/styling.

# after cargo install mdbook-admonish
vscode ➜ /workspaces/prql (main) $ which mdbook
/usr/local/cargo/bin/mdbook
vscode ➜ /workspaces/prql (main) $ which mdbook-admonish
/usr/local/cargo/bin/mdbook-admonish
vscode ➜ /workspaces/prql (main) $ mdbook --version
mdbook v0.4.32
vscode ➜ /workspaces/prql (main) $ mdbook-admonish --version
mdbook-admonish 1.10.2

My Macbook says:

√ prql % docker --version
Docker version 24.0.5, build ced0996
√ prql % docker ps
CONTAINER ID   IMAGE                                                                                COMMAND                  CREATED       STATUS       PORTS     NAMES
ec1f268a1908   vsc-prql-9f40321c918454ef5606d0b253dbf67515a9f27786c98684dc77956402624bf4-features   "/bin/sh -c 'echo Co…"   2 hours ago   Up 2 hours             sad_banzai
√ prql % docker images
REPOSITORY                                                                           TAG       IMAGE ID       CREATED        SIZE
<none>                                                                               <none>    6e2440379926   12 hours ago   3.1GB
vsc-prql-9f40321c918454ef5606d0b253dbf67515a9f27786c98684dc77956402624bf4-features   latest    33884ff7ba59   12 hours ago   3.1GB
ghcr.io/prql/prql-devcontainer-base                                                  latest    5e857bd39e47   2 weeks ago    2.48GB
√

Also - I get the same error messages all the time when I use task run-book:

prql % docker run -it ghcr.io/prql/prql-devcontainer-base:latest  mdbook-admonish
mdbook-admonish: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by mdbook-admonish)
mdbook-admonish: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by mdbook-admonish)
mdbook-admonish: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by mdbook-admonish)

What other info could I provide? Thanks.

@max-sixty
Copy link
Member

max-sixty commented Aug 16, 2023

Is it an ARM vs Intel thing?

On the latest image on ARM, it's there:

$ docker run -it ghcr.io/prql/prql-devcontainer-base@sha256:c025e31765a3b3b8c2ecb7d0839250ef522fea323aea03a579c4abdf27c04596 bash -c "which mdbook-admonish"

/usr/local/cargo/bin/mdbook-admonish

And that is indeed the latest image:

$ docker pull ghcr.io/prql/prql-devcontainer-base:latest

latest: Pulling from prql/prql-devcontainer-base
Digest: sha256:c025e31765a3b3b8c2ecb7d0839250ef522fea323aea03a579c4abdf27c04596
Status: Image is up to date for ghcr.io/prql/prql-devcontainer-base:latest
ghcr.io/prql/prql-devcontainer-base:latest

I see x86_64 in the log above — is that possibly the issue?

@max-sixty max-sixty changed the title mdbook-admonish not installed by default in Dev Container mdbook-admonish not found in Dev Container Aug 16, 2023
@max-sixty
Copy link
Member

Let's run these two commands:

$ docker run -it --pull=always --platform=linux/amd64 ghcr.io/prql/prql-devcontainer-base bash -c "which mdbook-admonish"

latest: Pulling from prql/prql-devcontainer-base
Digest: sha256:c025e31765a3b3b8c2ecb7d0839250ef522fea323aea03a579c4abdf27c04596
Status: Image is up to date for ghcr.io/prql/prql-devcontainer-base:latest
/usr/local/cargo/bin/mdbook-admonish

$ docker run -it --pull=always --platform=linux/arm64 ghcr.io/prql/prql-devcontainer-base bash -c "which mdbook-admonish"

latest: Pulling from prql/prql-devcontainer-base
Digest: sha256:c025e31765a3b3b8c2ecb7d0839250ef522fea323aea03a579c4abdf27c04596
Status: Downloaded newer image for ghcr.io/prql/prql-devcontainer-base:latest
/usr/local/cargo/bin/mdbook-admonish

@richb-hanover
Copy link
Contributor Author

richb-hanover commented Aug 16, 2023

More info:

  1. Yes, this report comes from my Intel Macbook.

  2. It looks as if the two docker run... commands above are identical. Was that intended?

  3. Here is the output of the command from my Intel Macbook (I added mdbook-admonish --version):

    prql % docker run -it --pull=always --platform=linux/amd64 ghcr.io/prql/prql-devcontainer-base bash -c "which mdbook-admonish; mdbook-admonish --version"
    latest: Pulling from prql/prql-devcontainer-base
    Digest: sha256:c025e31765a3b3b8c2ecb7d0839250ef522fea323aea03a579c4abdf27c04596
    Status: Image is up to date for ghcr.io/prql/prql-devcontainer-base:latest
    /usr/local/cargo/bin/mdbook-admonish
    mdbook-admonish: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by mdbook-admonish)
    mdbook-admonish: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by mdbook-admonish)
    mdbook-admonish: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by mdbook-admonish)
    
  4. Here is the output of the command from my M2 Mac mini (also with mdbook-admonish --version):

    Mac-mini2 ~ %  docker run -it --pull=always --platform=linux/arm64 ghcr.io/prql/prql-devcontainer-base bash -c "which mdbook-admonish; mdbook-admonish --version"
    latest: Pulling from prql/prql-devcontainer-base
    Digest: sha256:c025e31765a3b3b8c2ecb7d0839250ef522fea323aea03a579c4abdf27c04596
    Status: Image is up to date for ghcr.io/prql/prql-devcontainer-base:latest
    /usr/local/cargo/bin/mdbook-admonish
    mdbook-admonish 1.10.1
    

@eitsupi
Copy link
Member

eitsupi commented Aug 16, 2023

Perhaps installed gnu instead of musl?
https://github.com/tommilligan/mdbook-admonish/releases/tag/v1.10.1

The release page does not have a binary for linux arm64, so I assume it was built from source on the arm64 platform and is working correctly.
In short, I think this is a bug of the cargo-binstall.

@max-sixty
Copy link
Member

max-sixty commented Aug 19, 2023

The release page does not have a binary for linux arm64, so I assume it was built from source on the arm64 platform and is working correctly.
In short, I think this is a bug of the cargo-binstall.

Very good analysis!

So the parent container doesn't have an up-to-date libc, and cargo-binstall doesn't install the musl version, which is probably should prefer — is that correct?


2. It looks as if the two docker run... commands above are identical. Was that intended?

They're slightly different in the --platform!


So I could imagine a couple of options here:

  • Use standard cargo installs for the amd64 arch, where perf doesn't matter so much
  • Run cargo install mdbook-admonish after the build, assuming it's the only one that's broken
  • Put in an issue upstream

@eitsupi
Copy link
Member

eitsupi commented Aug 21, 2023

So the parent container doesn't have an up-to-date libc, and cargo-binstall doesn't install the musl version, which is probably should prefer — is that correct?

I think so, but I'm just guessing from the log, so I don't know if it's correct.

@richb-hanover
Copy link
Contributor Author

What other information could I provide? Thanks.

@eitsupi
Copy link
Member

eitsupi commented Aug 27, 2023

cargo-bins/cargo-binstall#19 (comment)

You could use --tarfers to specifically use the musl target instead, that will definitely work.
We can modify crates/detect-targets to disable gnu if the interpreter does not exist or is not executable.

eitsupi added a commit to eitsupi/prql that referenced this issue Aug 27, 2023
eitsupi added a commit to eitsupi/prql that referenced this issue Aug 27, 2023
This reverts commit 9ede849.
@eitsupi
Copy link
Member

eitsupi commented Aug 27, 2023

I found the issue about this rust-lang/mdBook#1954

This is why the mdBook binaries are built on Ubuntu 20.04 and not Ubuntu 22.04.
https://github.com/rust-lang/mdBook/blob/02f3823e4caae28cc0b1ceac284f81743f8fd29b/.github/workflows/deploy.yml#L25-L35

In contrast, mdbook-admonish is built on Ubuntu 22.04.
https://github.com/tommilligan/mdbook-admonish/blob/7e774f46553377352dda5e7b0e55fd1873f9acc2/.github/workflows/deploy.yml#L24-L36

Also, the Docker build log shows that it took 2 hours to build mdbook-admonish.

Perhaps by fixing up the mdbook-admonish repository and adding builds for arm64 we can benefit....

@richb-hanover
Copy link
Contributor Author

@eitsupi - What an incredibly complex problem. Good sleuthing! Thanks for investigating

@eitsupi
Copy link
Member

eitsupi commented Oct 11, 2023

This has been resolved via upstream.

@eitsupi eitsupi closed this as completed Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants