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

[bug] tauri info does not correctly identify @tauri-apps/api version #4106

Closed
damien opened this issue May 11, 2022 · 4 comments
Closed

[bug] tauri info does not correctly identify @tauri-apps/api version #4106

damien opened this issue May 11, 2022 · 4 comments

Comments

@damien
Copy link
Contributor

damien commented May 11, 2022

Describe the bug

When using Yarn Berry (3.2, PnP mode), the Tauri CLI does not correctly identify the installed version of @tauri-apps/api.

Reproduction

  1. yarn init -2
  2. yarn add -D @tauri-apps/cli
  3. yarn add @tauri-apps/api
  4. yarn install
  5. yarn tauri info

Expected behavior

yarn tauri info currently returns @tauri-apps/api [NPM]: Not installed! when listing packages.

yarn tauri info should return the correct version of the installed package (e.g. @tauri-apps/api [NPM]: 1.0.0-rc.5) when listing packages.

Platform and versions

vscode ➜ /workspaces/manager-desktop (master ✗) $ yarn tauri info

Environment
  › OS: Debian 10 X64
  › Node.js: 16.15.0
  › npm: 8.10.0
  › pnpm: Not installed!
  › yarn: 3.2.0
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: 1.60.0-x86_64-unknown-linux-gnu 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.10
  › @tauri-apps/api [NPM]: Not installed!
  › tauri [RUST]: 1.0.0-rc.9 (no lockfile),
  › tauri-build [RUST]: no manifest (no lockfile),
  › tao [RUST]: no manifest (no lockfile),
  › wry [RUST]: no manifest (no lockfile),

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../src-ts
  › devPath: localhost:9009

App directory structure
  ├─ .devcontainer
  ├─ .git
  ├─ .vscode
  ├─ .yarn
  └─ src-tauri

Stack trace

No response

Additional context

Likely not required, but for exact reproduction you can use the following VSCode devcontainer.

Dockerfile

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/rust/.devcontainer/base.Dockerfile

# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT}

# Tauri system dependencies
# See: https://tauri.studio/v1/guides/getting-started/setup/linux
ARG TAURI_SYSTEM_DEPENDENCIES="libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev"

# [Optional] Uncomment this section to install additional packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends $TAURI_SYSTEM_DEPENDENCIES

devcontainer.json

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/rust
{
	"name": "Rust",
	"build": {
		"dockerfile": "Dockerfile",
		"args": {
			// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
			// Use bullseye when on local on arm64/Apple Silicon.
			"VARIANT": "buster"
		}
	},
	"runArgs": [
		"--cap-add=SYS_PTRACE",
		"--security-opt",
		"seccomp=unconfined"
	],

	// Set *default* container specific settings.json values on container create.
	"settings": {
		"lldb.executable": "/usr/bin/lldb",
		// VS Code don't watch files under ./target
		"files.watcherExclude": {
			"**/target/**": true
		},
		"rust-analyzer.checkOnSave.command": "clippy"
	},

	// Add the IDs of extensions you want installed when the container is created.
	"extensions": [
		"vadimcn.vscode-lldb",
		"mutantdino.resourcemonitor",
		"matklad.rust-analyzer",
		"tamasfe.even-better-toml",
		"serayuzgur.crates"
	],

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],

	// Use 'postCreateCommand' to run commands after the container is created.
	// "postCreateCommand": "rustc --version",

	// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
	"remoteUser": "vscode",
	"features": {
		"node": "lts"
	}
}
@FabianLars
Copy link
Member

FabianLars commented May 11, 2022

Ayyy, another yarn berry specific issue 🥳
We're invoking yarn list to read the packages and that command doesn't exist in yarn2+. In yarn2+ it's yarn info afaik

thx for the report, you're not the first one mentioning this issue, but at least we know now that it's a yarn berry thing, thx!

@damien
Copy link
Contributor Author

damien commented May 14, 2022

Hey @FabianLars! Happy to contribute--if you have a central tracking ticket for this I can take a stab at this (seemingly small) bug fix.

Cheers!

@damien
Copy link
Contributor Author

damien commented May 14, 2022

I suspect the fix may involve some simple detection of the Yarn version, so hopefully not a huge deal.

@FabianLars
Copy link
Member

We always appreciate PRs!

if you have a central tracking ticket for this

Yeah, it's this gh issue here :P (Unless i misunderstood your question? But yeah, we're not tracking it elsewhere.)

For a start, this is the function that reads the version: https://github.com/tauri-apps/tauri/blob/dev/tooling/cli/src/info.rs#L193-L230

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

No branches or pull requests

2 participants