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

Rust plugin always installs the rustup snap, even when trying to use local cargo/rustc #890

Open
lengau opened this issue Oct 30, 2024 · 0 comments
Labels
Bug Something isn't working

Comments

@lengau
Copy link
Contributor

lengau commented Oct 30, 2024

Bug Description

Rustup always gets installed, even if we're trying to use local cargo and rustc installed from another part.

To Reproduce

Build with the following part

part yaml

parts:
  rust-deps:
    plugin: nil
    build-packages:
      - librust-indexmap-dev
      - librust-itoa-dev
      - librust-memchr-dev
      - librust-ryu-dev
      - librust-serde-dev
      - cargo
      - cargo-1.80
    override-pull: |
      ln -s /bin/cargo-1.80 /usr/local/bin/cargo
      ln -s /bin/rustc-1.80 /usr/local/bin/rustc
  librust-serde-json:
    plugin: rust
    after: [rust-deps]
    source: .

Relevant log output

2024-10-30 11:05:38.942 :: 2024-10-30 11:05:00.918 Initialising lifecycle
2024-10-30 11:05:38.942 :: 2024-10-30 11:05:00.918 part build packages: ['librust-indexmap-dev', 'librust-itoa-dev', 'librust-memchr-dev', 'librust-ryu-dev', 'librust-serde-dev', 'cargo', 'cargo-1.80']
2024-10-30 11:05:38.942 :: 2024-10-30 11:05:00.918 ignore patterns: []
2024-10-30 11:05:38.942 :: 2024-10-30 11:05:00.918 plugin build packages: {'gcc', 'pkg-config', 'curl', 'git', 'findutils'}
2024-10-30 11:05:38.942 :: 2024-10-30 11:05:00.919 plugin build snaps: {'rustup'}
2024-10-30 11:05:38.942 :: 2024-10-30 11:05:00.919 Installing build-packages
2024-10-30 11:05:38.942 :: 2024-10-30 11:05:00.919 Requested build-packages: ['cargo', 'cargo-1.80', 'curl', 'findutils', 'gcc', 'git', 'librust-indexmap-dev', 'librust-itoa-dev', 'librust-memchr-dev', 'librust-ryu-dev', 'librust-serde-dev', 'pkg-config']

<snip>

2024-10-30 11:05:38.945 :: 2024-10-30 11:05:29.870 Installing build-snaps
2024-10-30 11:05:38.945 :: 2024-10-30 11:05:30.141 Installing snap: rustup
2024-10-30 11:05:38.945 :: 2024-10-30 11:05:32.887 verify plugin environment for part 'rust-deps'
2024-10-30 11:05:38.945 :: 2024-10-30 11:05:32.890 verify plugin environment for part 'librust-serde-json'
2024-10-30 11:05:38.945 :: 2024-10-30 11:05:32.890 plugin validation environment: # Environment
2024-10-30 11:05:38.945 :: ## Application environment
2024-10-30 11:05:38.945 :: ## Part environment
2024-10-30 11:05:38.945 :: export CRAFT_ARCH_TRIPLET="x86_64-linux-gnu"
2024-10-30 11:05:38.945 :: export CRAFT_TARGET_ARCH="amd64"
2024-10-30 11:05:38.945 :: export CRAFT_ARCH_BUILD_ON="amd64"
2024-10-30 11:05:38.945 :: export CRAFT_ARCH_BUILD_FOR="amd64"
2024-10-30 11:05:38.945 :: export CRAFT_ARCH_TRIPLET_BUILD_ON="x86_64-linux-gnu"
2024-10-30 11:05:38.945 :: export CRAFT_ARCH_TRIPLET_BUILD_FOR="x86_64-linux-gnu"
2024-10-30 11:05:38.945 :: export CRAFT_PARALLEL_BUILD_COUNT="16"
2024-10-30 11:05:38.945 :: export CRAFT_PROJECT_DIR="/root/project"
2024-10-30 11:05:38.945 :: export CRAFT_STAGE="/root/stage"
2024-10-30 11:05:38.945 :: export CRAFT_PRIME="/root/prime"
2024-10-30 11:05:38.945 :: export CRAFT_PART_NAME="librust-serde-json"
2024-10-30 11:05:38.945 :: export CRAFT_STEP_NAME="BUILD"
2024-10-30 11:05:38.945 :: export CRAFT_PART_SRC="/root/parts/librust-serde-json/src"
2024-10-30 11:05:38.945 :: export CRAFT_PART_SRC_WORK="/root/parts/librust-serde-json/src"
2024-10-30 11:05:38.945 :: export CRAFT_PART_BUILD="/root/parts/librust-serde-json/build"
2024-10-30 11:05:38.945 :: export CRAFT_PART_BUILD_WORK="/root/parts/librust-serde-json/build"
2024-10-30 11:05:38.945 :: export CRAFT_PART_INSTALL="/root/parts/librust-serde-json/install"
2024-10-30 11:05:38.945 :: ## Plugin environment
2024-10-30 11:05:38.945 :: export PATH="${HOME}/.cargo/bin:${PATH}"
2024-10-30 11:05:38.945 :: ## User environment
2024-10-30 11:05:38.945 :: 2024-10-30 11:05:32.890 plugin validation command: 'cargo --version'
2024-10-30 11:05:38.945 :: 2024-10-30 11:05:33.068 Environment validation failed for part 'librust-serde-json': 'cargo' failed with error code 1.
@lengau lengau added the Bug Something isn't working label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant