Giter Club home page Giter Club logo

Comments (3)

Val avatar Val commented on May 29, 2024

Like crystal-lang/crystal#8340

from crun.

bew avatar bew commented on May 29, 2024

Yes @Val but iirc the lock file is generated by crun in this case, no?

from crun.

Val avatar Val commented on May 29, 2024

This issue is very interesting and reveal some race conditions

  1. File.delete(lockfile.path)
    with a possible workarround
  2. crun/src/shards.cr

    Lines 22 to 31 in 94c7c85

    File.open(shards_config_path, "w") do |file|
    file.puts <<-EOYAML
    ---
    name: #{SOURCE_FILENAME}
    version: 0.1.0
    dependencies:
    #{shards_yaml}
    ...
    EOYAML
    end
    with another possible workarround

But I added some pipe samples specifications and it still fail, see lock_deletion_race_condition_fix branch. And some times you get an error like for crystal-lang/crystal#8075 or crystal-lang/crystal#7810

> make tests
crystal tool format -i src -i spec
crun format passed
rm -f crun crun.sha256
crun clean passed
crystal build src/main.cr -o crun --warnings all --error-on-warnings --error-trace
crun build passed
crystal spec --debug --warnings all --error-on-warnings --error-trace
.....error:
Failed to raise an exception: END_OF_STACK
[0x56511fbb0e76] *CallStack::print_backtrace:Int32 +118
[0x56511fb93006] __crystal_raise +86
[0x56511fb9352e] ???
[0x56511fbe0966] *Crystal::System::File::open<String, String, File::Permissions>:Int32 +214
[0x56511fbd9c83] *File::new<String, String, File::Permissions, Nil, Nil>:File +67
[0x56511fba7b1d] *CallStack::read_dwarf_sections:(Array(Tuple(UInt64, UInt64, String)) | Nil) +109
[0x56511fba78ad] *CallStack::decode_line_number<UInt64>:Tuple(String, Int32, Int32) +45
[0x56511fba7038] *CallStack#decode_backtrace:Array(String) +296
[0x56511fba6ef2] *CallStack#printable_backtrace:Array(String) +50
[0x56511fc1560d] *Exception+ +77
[0x56511fc15458] *Exception+ +120
[0x56511fc115da] *AtExitHandlers::run<Int32>:Int32 +490
[0x56511fc514ab] *Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32 +139
[0x56511fb9da16] main +6
[0x7f988572d09b] __libc_start_main +235
[0x56511fb9188a] _start +42
[0x0] ???
Crun::BuildError: Build failed: crystal build --debug --error-on-warnings --error-trace -o /tmp/.lgmAAIcrun_spec_local_cache/foo__path_to_crystal_crun_spec_samples_pipe_echo_cr/echo.cr.crystal /path/to/crun/spec/samples/pipe/echo.cr

STDOUT:


STDERR:
In /path/to/crun/spec/samples/pipe/echo.cr:1:1

 1 | while line = gets
     ^
Error: can't find file 'prelude'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?

from crun.

Related Issues (7)

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.