Building rust as a part fails with: submodules cannot be used without a working tree.

Bug #1629006 reported by Leo Arias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Won't Fix
Undecided
Unassigned

Bug Description

I'm trying to snap cargo, that part is easy but in order to run it, it requires rust. So the only current solution is to bundle rust in the same snap.

When I try that, snapcraft fails during configure with:

fatal: /usr/lib/git-core/git-submodule cannot be used without a working tree.
Stopping at 'src/rust-installer'; script returned non-zero status.
configure: error: git failed
Command '['/bin/sh', '/tmp/tmpr39gfk45', './configure', '--prefix=']' returned non-zero exit status 1

To reproduce, try to snap this yaml:

name: cargo
version: master
summary: The Rust package manager
description: |
  Cargo downloads your Rust project’s dependencies and compiles your project.

grade: devel
confinement: strict

apps:
  cargo:
    command: cargo
    plugs: [home, network]

parts:
  cargo:
    source: .
    plugin: rust after: [rust]
  rust:
    source: https://github.com/rust-lang/rust.git
    source-tag: '1.11.0'
    plugin: autotools
    build-packages: [g++, git, curl, python]

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: [Bug 1629006] [NEW] Building rust as a part fails with: submodules cannot be used without a working tree.

El 29/09/16 a las 13:37, Leo Arias escribió:
> Public bug reported:
>
> I'm trying to snap cargo, that part is easy but in order to run it, it
> requires rust. So the only current solution is to bundle rust in the
> same snap.

Why would you want to snap cargo and not provide it as a snapcraft
plugin (or extend the rust one) instead?

Revision history for this message
Leo Arias (elopio) wrote :

We have a cargo plugin, but I want cargo itself to be published often, and upgrade automatically. I want cargo and rust to be separate snaps, so they have their own independent release schedule, probably with rust being a part in the wiki, but that is not possible for various reasons. I can try now the other way around as you suggest, cargo as a part of the rust snap.

However, the issue still remains: we can't build a part that has submodules. That's not specific to my example.

Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

I have just updated the pasted snapcraft.yaml to 1.16.0 (latest stable) and it's built Rust with no trouble. It had an issue with cargo because cargo has some additional build requirements

Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

This snapcraft.yaml could also be used to make a cargo snap:

name: cargo
version: master
summary: The Rust package manager
description: |
  Cargo downloads your Rust project’s dependencies and compiles your project.
grade: devel
confinement: strict
apps:
  cargo:
    command: cargo
    plugs: [home, network]
parts:
  cargo:
    source: .
    plugin: rust
    build-packages: [cmake, curl, pkg-config, libssl-dev]

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This seems to be sorted per Chris' comment

Changed in snapcraft:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.