unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Cargo build system: Lock file cannot be updated
@ 2016-12-24  0:43 Francisco Gómez García
  2016-12-24 13:51 ` David Craven
  0 siblings, 1 reply; 2+ messages in thread
From: Francisco Gómez García @ 2016-12-24  0:43 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]

I’m relatively new to Guix – been casually trying it out from time to time this last 2 years, but never used it beyond installing Emacs and a few extra packages. I decided, for some reason, to learn to create packages by using the new Cargo build system for crates. I ended up going for `ansi-term` (https://crates.io/crates/ansi_term). After managing to get a working script (not hard at all, if you know how!), I attempt to build the package, and after a few seconds the following log appears and the process aborts:

  starting phase `build'
  error: the lock file needs to be updated but --locked was passed to prevent this
  phase `build' failed after 0.0 seconds

I can assume it’s attempting to modify the current crate's Cargo.lock, but obviously is unable to do so. Is this some sort of bug on the build system, or is there any parameter which the script is missing?

My .scm has been attached to the mail, for those who want to take a look. Thank you in advance!


[-- Attachment #2: rust-ansi-term.scm --]
[-- Type: application/octet-stream, Size: 835 bytes --]

(define-module (rust-ansi-term)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system cargo)
  #:use-module (guix licenses))

(define-public rust-ansi-term
  (package
    (name "rust-ansi-term")
    (version "0.9.0")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "ansi_term" version))
        (file-name
          (string-append name "-" version ".tar.gz"))
        (sha256
          (base32
            "1xif1bh938qpfc3d0f9xgidibpm65xix11w9gszwqnia00q7rb13"))))
    (build-system cargo-build-system)
    (home-page
      "https://github.com/ogham/rust-ansi-term")
    (synopsis
      "Library for ANSI terminal colours and styles (bold, underline)")
    (description
      "Library for ANSI terminal colours and styles (bold, underline)")
    (license expat)))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Cargo build system: Lock file cannot be updated
  2016-12-24  0:43 Cargo build system: Lock file cannot be updated Francisco Gómez García
@ 2016-12-24 13:51 ` David Craven
  0 siblings, 0 replies; 2+ messages in thread
From: David Craven @ 2016-12-24 13:51 UTC (permalink / raw)
  To: Francisco Gómez García; +Cc: help-guix

> I can assume it’s attempting to modify the current crate's Cargo.lock,
> but obviously is unable to do so. Is this some sort of bug on the build
> system, or is there any parameter which the script is missing?

Ansi term is a rust library. Because of that it does not have a
Cargo.lock file. This means that cargo needs to perform it's
dependency resolution algorithm to determine which dependencies are
needed and which versions. This doesn't work because cargo requires
network connectivity to download the crates.io registry. To prevent
this we pass the --frozen flag to cargo build. This is a bit annoying
in this particular case because there are no dependencies. What you
are experiencing is a known deficiency in the cargo-build-system [0],
the relevant excerpt copied below for reference.

* Cargo build system should not do anything if there isn't a
Cargo.lock file except copy the source to out.

Contributions are welcome!

[0] http://lists.gnu.org/archive/html/guix-devel/2016-12/msg00454.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-24 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-24  0:43 Cargo build system: Lock file cannot be updated Francisco Gómez García
2016-12-24 13:51 ` David Craven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).