Code Monkey home page Code Monkey logo

Comments (10)

XenGi avatar XenGi commented on September 26, 2024

I also get a segfault just running nix run github:a-h/templ. When I run nix develop github:a-h/templ, I get a dev shell but theres no templ in it's PATH. It seems like the templ flake itself has some issues.

from templ.

a-h avatar a-h commented on September 26, 2024

It works OK for me. Can't really help without knowing what the logs say.

0 0 /Users/adrian % nix run github:a-h/templ
usage: templ <command> [<args>...]

templ - build HTML UIs with Go

See docs at https://templ.guide

commands:
  generate   Generates Go code from templ files
  fmt        Formats templ files
  lsp        Starts a language server for templ files
  migrate    Migrates v1 templ files to v2 format
  version    Prints the version

nix develop won't have templ in the path, it's a development shell containing all the things you need to develop templ, not to use it. Re-reading the docs at templ.guide, I can see that's the docs are a bit wrong there. The dev shell used to contain a Neovim config, but not any more, because it was downloading way too much stuff.

from templ.

XenGi avatar XenGi commented on September 26, 2024

This is what I get:

$ nix run github:a-h/templ
munmap_chunk(): invalid pointer
fish: Job 1, 'nix run github:a-h/templ' terminated by signal SIGABRT (Abort)

Earlier I got:

$ nix run github:a-h/templ
copying '/nix/store/7mhipfj7kvxyfj9zwkyf78ha1yfl07hp-source' to the store
fish: Job 1, 'nix run github:a-h/templ' terminated by signal SIGSEGV (Address boundary error)

In Bash it looks like this:

$ nix run github:a-h/templ
free(): invalid size
Aborted (core dumped)

Same SIGSEGV error when I use it in my flake.

from templ.

a-h avatar a-h commented on September 26, 2024

Architecture, version of Nix, operating system...?

from templ.

XenGi avatar XenGi commented on September 26, 2024

Ah yeah, sorry.

x86_64, nix 2.21.0, Arch Linux.

I tried in a fresh archlinux container (so no modifications by me), installed nix from the official packages and ran it. Got the same segmentation fault.

podman run -it --rm docker.io/archlinux:latest bash -c "pacman -Syq --noconfirm nix && nix --version && nix --extra-experimental-features 'nix-command flakes' run github:a-h/templ"

But this (increased verbosity) worked at least once but is now also failing:

podman run -it --rm docker.io/archlinux:latest bash -c "pacman -Syq --noconfirm nix && nix --version && nix -vv --extra-experimental-features 'nix-command flakes' run github:a-h/templ"

Is there a race condition in the build process of templ?

The errors I'm getting are completely random. I'm not sure if templ is the problem or nix itself. Weirdly I'm only getting this when I try to use templ.

from templ.

XenGi avatar XenGi commented on September 26, 2024

Just tried it on native NixOS and that worked. I'm too tired, I'll reboot my Arch system and continue testing tomorrow.

from templ.

joerdav avatar joerdav commented on September 26, 2024

@XenGi are you happy for this to be closed? It seems you said it worked?

from templ.

a-h avatar a-h commented on September 26, 2024

Just as an extra data point, it's working OK for me on x86-64 Ubuntu with Nix installed. My previous example was running the flake on aarch-64 Darwin (M1 Mac).

0 0 /home/adrian-hesketh % nix run github:a-h/templ                               
warning: Ignoring setting 'auto-allocate-uids' because experimental feature 'auto-allocate-uids' is not enabled
warning: Ignoring setting 'impure-env' because experimental feature 'configurable-impure-env' is not enabled
usage: templ <command> [<args>...]

templ - build HTML UIs with Go

See docs at https://templ.guide

commands:
  generate   Generates Go code from templ files
  fmt        Formats templ files
  lsp        Starts a language server for templ files
  migrate    Migrates v1 templ files to v2 format
  version    Prints the version

(Nix 2.20.1)

from templ.

joerdav avatar joerdav commented on September 26, 2024

Same here!

[0][~]$ nix run github:a-h/templ
[1/0/1 copied (148.4/148.4 MiB), 25.5 MiB DL] fetching source from https://cache.nixos.org
usage: templ <command> [<args>...]

templ - build HTML UIs with Go

See docs at https://templ.guide

commands:
  generate   Generates Go code from templ files
  fmt        Formats templ files
  lsp        Starts a language server for templ files
  migrate    Migrates v1 templ files to v2 format
  version    Prints the version
[0][~]$ nix --version
nix (Nix) 2.18.1
[0][~]$ uname
Darwin
[0][~]$ uname -p
i386
[0][~]$ uname -m
x86_64

from templ.

a-h avatar a-h commented on September 26, 2024

Closed, since no further information was provided, and we've been unable to reproduce the issue on Linux machines, and both ARM64 and x64 Macs.

from templ.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.