crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.38k stars 1.62k forks source link

Heroku build fails but continues and succeeds anyways. #14035

Open sol-vin opened 10 months ago

sol-vin commented 10 months ago

Heroku build fails but continues and succeeds anyways. (Bug Report)

crystal -v = 1.10.1

Building on Heroku gracefully fails but still succeeds at compilation. Happens between shards install and shards build.

-----> Building on the Heroku-22 stack
-----> Using buildpack: https://github.com/sol-vin/heroku-buildpack-crystal
-----> Crystal app detected
-----> Installing Crystal (1.10.1 due to latest release at https://github.com/crystal-lang/crystal) from https://github.com/crystal-lang/crystal/releases/download/1.10.1/crystal-1.10.1-1-linux-x86_64.tar.gz... done
-----> Installing Dependencies... Resolving dependencies
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/sija/backtracer.cr.git
Installing radix (0.4.1)
Installing backtracer (1.2.2)
Installing exception_page (0.3.1)
Installing kemal (1.4.0)
done
Error writing file: Broken pipe (IO::Error)
  from /crystal/src/gc/boehm.cr:134:5 in 'unbuffered_write'
  from /crystal/src/io/buffered.cr:243:5 in 'write_byte'
  from /crystal/src/string.cr:5387:15 in 'puts'
  from /crystal/src/compiler/crystal/command.cr:456:9 in '->'
  from /crystal/src/option_parser.cr:447:25 in 'parse'
  from /crystal/src/compiler/crystal/command.cr:555:5 in 'create_compiler'
  from /crystal/src/compiler/crystal/command.cr:363:11 in 'run'
  from /crystal/src/compiler/crystal.cr:11:1 in '__crystal_main'
  from /crystal/src/crystal/main.cr:129:5 in 'main'
  from src/env/__libc_start_main.c:95:2 in 'libc_start_main_stage2'
Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues
-----> Compiling src/**************.cr (auto-detected from shard.yml)... Dependencies are satisfied
Building: **************
done
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 33.4M
-----> Launching...
       Released v15
       https://******************.herokuapp.com/ deployed to Heroku

Source code was the Kemal "Hello world app".

Sija commented 10 months ago

Looks like a duplicate of #9065

noraj commented 5 months ago

https://github.com/noraj/quartz-utils/actions/runs/8776231717/job/24079448382

 No such file or directory (Exception)
  from /crystal/src/array.cr:114:31 in 'codegen'
  from /crystal/src/compiler/crystal/compiler.cr:202:16 in 'compile:combine_rpath'
  from /crystal/src/compiler/crystal/command.cr:358:5 in 'run'
  from /crystal/src/compiler/crystal.cr:11:1 in '__crystal_main'
  from /crystal/src/crystal/main.cr:129:5 in 'main'
  from src/env/__libc_start_main.c:95:2 in 'libc_start_main_stage2'

https://github.com/noraj/quartz-utils/blob/master/compile_x86_64-linux.cr

Blacksmoke16 commented 5 months ago

@noraj FWIW, you don't need to cross compile at all. Given the only arch you support is x86_64, you can just run shards build --release --no-debug --static in the alpine image and the resulting binary can be used with both musl and glibc.