all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#43821: Vlang REPL broken
@ 2020-10-05 23:30 Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-10-06  5:03 ` bug#43821: [PATCH 0/1] Progress improving vlang package Ryan Prior via Bug reports for GNU Guix
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-10-05 23:30 UTC (permalink / raw)
  To: 43821, rprior


[-- Attachment #1.1: Type: text/plain, Size: 148 bytes --]

Guix,

Commit 84fa2ced47e16de66674ca169845a6f08cb5ef6c broke the vlang 
REPL (‘v repl’ or simply ‘v’ without arguments) in a new way:


[-- Attachment #1.2: Type: text/plain, Size: 278 bytes --]

~ λ v
For usage information, quit V REPL and run `v help`
cannot compile 
`/gnu/store/zf80y1bfdvpc6s3lrs33vlc6d1d745la-vlang-0.1.29/bin/cmd/tools/vrepl.v`: 
builder error: folder 
`/gnu/store/zf80y1bfdvpc6s3lrs33vlc6d1d745la-vlang-0.1.29/bin/cmd/tools` 
is not writable

[-- Attachment #1.3: Type: text/plain, Size: 124 bytes --]


The compiler works fine.

The REPL didn't work before so this isn't a regression per se, but 
it still needs to be fixed.


[-- Attachment #1.4: Type: text/plain, Size: 1997 bytes --]

λ guix install vlang
The following package will be downgraded:
   vlang 0.1.29 → 0.1.27
[...]
~ λ v
For usage information, quit V REPL using `exit` and use `v help`
cannot compile 
‘/gnu/store/1f5nzwf1jhn5iikhfpxjdxcbmj24zdf5-vlang-0.1.27/bin/cmd/tools/vrepl.v: 
/gnu/store/1f5nzwf1jhn5iikhfpxjdxcbmj24zdf5-vlang-0.1.27/bin/cmd/tools/vrepl.v:64:1: 
warning: function `repl_help` in module main cannot be declared 
public 
   62 | }
   63 | 
   64 | pub fn repl_help() {
      | ~~~~~~~~~~~~~~~~~~
   65 |     println(util.full_v_version())
   66 |     println('
/gnu/store/1f5nzwf1jhn5iikhfpxjdxcbmj24zdf5-vlang-0.1.27/bin/cmd/tools/vrepl.v:73:1: 
warning: function `run_repl` in module main cannot be declared 
public 
   71 | }
   72 | 
   73 | pub fn run_repl(workdir string, vrepl_prefix string) 
   []string {
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   74 |     println(util.full_v_version())
   75 |     println('Use Ctrl-C or `exit` to exit')
/gnu/store/1f5nzwf1jhn5iikhfpxjdxcbmj24zdf5-vlang-0.1.27/bin/cmd/tools/vrepl.v:240:1: 
warning: function `rerror` in module main cannot be declared 
public 
  238 | }
  239 | 
  240 | pub fn rerror(s string) {
      | ~~~~~~~~~~~~~~~~~~~~~~~
  241 |     println('V repl error: $s')
  242 |     os.flush()
builder error: C compiler error, while attempting to run: 
-----------------------------------------------------------
cc  -std=gnu11 -Wall -Wextra -Wno-unused-variable 
-Wno-unused-parameter -Wno-unused-result -Wno-unused-function 
-Wno-missing-braces -Wno-unused-label 
-Werror=implicit-function-declaration -o 
"/gnu/store/1f5nzwf1jhn5iikhfpxjdxcbmj24zdf5-vlang-0.1.27/bin/cmd/tools/vrepl" 
"/home/nckx/.cache/v/vrepl.tmp.c"   -lm -lpthread -ldl
-----------------------------------------------------------
Probably your C compiler is missing. 
Please reinstall it, or make it available in your PATH.

On Debian/Ubuntu, run `sudo apt install build-essential`‘

[-- Attachment #1.5: Type: text/plain, Size: 22 bytes --]


Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

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

* bug#43821: [PATCH 0/1] Progress improving vlang package
  2020-10-05 23:30 bug#43821: Vlang REPL broken Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-10-06  5:03 ` Ryan Prior via Bug reports for GNU Guix
  2020-10-06  5:03   ` bug#43821: [PATCH 1/1] gnu: vlang: Build included tools at package time Ryan Prior via Bug reports for GNU Guix
  0 siblings, 1 reply; 3+ messages in thread
From: Ryan Prior via Bug reports for GNU Guix @ 2020-10-06  5:03 UTC (permalink / raw)
  To: 43821

One of the challenges of packaging v is that its install script assumes that you'll install it in a mutable folder, and uses that assumption to lazily build the included tools as they're needed instead of eagerly building everything up-front.

There's an included command for eagerly building these tools, which we should invoke in order to make sure that the repl &c are available at package installation time and the user won't need write access to the v directory.

This patch presents progress in that direction, but it has a ways to go. Like golang, the v build system resolves dependencies on git repos as it goes, so once I run `v build-tools` it wants to go and fetch the vlang/markdown repo. So we'll probably need to package that ahead of time.

That, however, raises the chicken-and-egg problem. Do we create a vlang-bootstrap package that we use to compile the deps (like vlang/markdown) and then in turn use those as inputs to the "real" v package which also builds all the tools? Do we include those deps as explicit source-only native-inputs of the v package? I don't know which strategy I prefer yet, I'd be interested to hear any input from others.

So in the spirit of progress here's my work-in-progress patch!

Cheers,
Ryan

Ryan Prior (1):
  gnu: vlang: Build included tools at package time.

 gnu/packages/vlang.scm | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

-- 
2.17.1






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

* bug#43821: [PATCH 1/1] gnu: vlang: Build included tools at package time.
  2020-10-06  5:03 ` bug#43821: [PATCH 0/1] Progress improving vlang package Ryan Prior via Bug reports for GNU Guix
@ 2020-10-06  5:03   ` Ryan Prior via Bug reports for GNU Guix
  0 siblings, 0 replies; 3+ messages in thread
From: Ryan Prior via Bug reports for GNU Guix @ 2020-10-06  5:03 UTC (permalink / raw)
  To: 43821

* gnu/packages/vlang.scm (vlang): Updates build stages.
  - Moves the cc-patching logic out of check into an explicit "patch-cc" stage
  - Adds "build-tools" stage to pre-build the included tools
---
 gnu/packages/vlang.scm | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm
index 6f6aa79ce5..47060934d4 100644
--- a/gnu/packages/vlang.scm
+++ b/gnu/packages/vlang.scm
@@ -22,6 +22,7 @@
   #:use-module (gnu packages node)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages xorg)
   #:use-module (guix build-system gnu)
   #:use-module (guix git-download)
@@ -61,6 +62,18 @@
               (("rm -rf") "true")
               (("v self") "v -cc gcc cmd/v"))
             #t))
+        (add-after 'build 'patch-cc
+          (lambda _
+            (let* ((bin "tmp/bin")
+                   (gcc (which "gcc")))
+              (mkdir-p bin)
+              (symlink gcc (string-append bin "/cc"))
+              (setenv "PATH" (string-append bin ":" (getenv "PATH")))
+              #t)))
+        (add-after 'patch-cc 'build-tools
+          (lambda _
+            (invoke "./v" "build-tools" "-v")
+            #t))
         (add-before 'check 'delete-failing-tests
           ;; XXX As always, these should eventually be fixed and run.
           (lambda _
@@ -74,13 +87,8 @@
             #t))
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
-            (let* ((bin "tmp/bin")
-                   (gcc (which "gcc")))
-              (when tests?
-                (mkdir-p bin)
-                (symlink gcc (string-append bin "/cc"))
-                (setenv "PATH" (string-append bin ":" (getenv "PATH")))
-                (invoke "./v" "test-fixed")))
+            (when tests?
+              (invoke "./v" "test-fixed"))
             #t))
         (replace 'install
           (lambda _
@@ -121,6 +129,9 @@
             (sha256
              (base32 "052gp5q2k31r3lci3rx4k0vy0vjdjva64xvrbbihn8lgmw63lc9f")))))
 
+      ;; For build-tools
+      ("git" ,git)
+
       ;; For the tests.
       ("libx11" ,libx11)
       ("node" ,node)
-- 
2.17.1






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

end of thread, other threads:[~2020-10-06  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-05 23:30 bug#43821: Vlang REPL broken Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-10-06  5:03 ` bug#43821: [PATCH 0/1] Progress improving vlang package Ryan Prior via Bug reports for GNU Guix
2020-10-06  5:03   ` bug#43821: [PATCH 1/1] gnu: vlang: Build included tools at package time Ryan Prior via Bug reports for GNU Guix

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.