Giter Club home page Giter Club logo

Comments (20)

gvwilson avatar gvwilson commented on May 28, 2024

This is cool, but is it one chapter or two? I.e., is the actual positioning of visible assets simple enough that the focus would be on the paging/download/etc.? The JS and Py versions each devote a chapter to row-and-column box layout, but maybe the layout itself here is simpler?

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

Just one chapter and I'll only do one chapter myself. The related items could be for other chapters.

I just wanted to get a few ideas down just in case the first one wasn't enough.

from book-of-examples.

gvwilson avatar gvwilson commented on May 28, 2024

@ashleydavis I've assigned this one to you - can you please create a subdirectory under the project root called gallery and put your work there as a standalone Roc project for now? Cheers - Greg

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

Will do, first thing for me is to figure out how to get Roc to work. It doesn't work under Windows yet and it seems to hang on Ubuntu under WSL2.

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

@rtfeldman @gvwilson I'm keen to get started but Roc doesn't run on Windows and there's a problem running it under WSL2.

I found an issue already logged and added my details to it:
roc-lang/roc#5887

from book-of-examples.

rtfeldman avatar rtfeldman commented on May 28, 2024

@ashleydavis Does the workaround Anton posted in that issue get it running? (That is, adding --linker=legacy to roc dev)

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

Thanks @rtfeldman, but doesn't seem to have helped.

Getting this error now:

$ roc build --linker legacy main.roc
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` failing to spawn.', crates/compiler/build/src/program.rs:1053:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I get a similar error for roc dev --linker legacy.

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

I tried setting RUST_BACKTRACE=full for extra details, but not sure it helps:

$ roc build --linker legacy main.roc
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` failing to spawn.', crates/compiler/build/src/program.rs:1053:30
stack backtrace:
   0:     0x562da85053b6 - <unknown>
   1:     0x562da784e2cf - <unknown>
   2:     0x562da8500b77 - <unknown>
   3:     0x562da85051c5 - <unknown>
   4:     0x562da8506963 - <unknown>
   5:     0x562da8506724 - <unknown>
   6:     0x562da8506e66 - <unknown>
   7:     0x562da8506d44 - <unknown>
   8:     0x562da85057b6 - <unknown>
   9:     0x562da8506af2 - <unknown>
  10:     0x562da774ae03 - <unknown>
  11:     0x562da7a52f9e - <unknown>
  12:     0x562da7a501dc - <unknown>
  13:     0x562da7b40b97 - <unknown>
  14:     0x562da7a1d0bb - <unknown>
  15:     0x562da7a12cf3 - <unknown>
  16:     0x562da7a12d13 - <unknown>
  17:     0x562da84f7f25 - <unknown>
  18:     0x562da7a1f7d5 - <unknown>
  19:     0x7f52ba741083 - __libc_start_main
  20:     0x562da77e21fe - <unknown>
  21:                0x0 - <unknown>

from book-of-examples.

Anton-4 avatar Anton-4 commented on May 28, 2024

I suspect installing Ubuntu 22.04 (still under WSL) will be the easiest fix. The installation through the microsoft store works great.

from book-of-examples.

rtfeldman avatar rtfeldman commented on May 28, 2024

@ashleydavis Was the gracefully handle 'ld' failing to spawn error on normal Windows or WSL? That would be a strange error to see on Windows, because the legacy linker shouldn't be trying to spawn ld on Windows! 🤔

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

I'm running under Ubuntu WSL2 under Windows.

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

I've tried running it on my quite old MacBook Air.

image

But it seems like I'm missing something:

% roc dev
dyld[49262]: Library not loaded: '/usr/local/opt/z3/lib/libz3.4.12.dylib'
  Referenced from: '/Users/ashleydavis/Roc/roc_nightly-macos_x86_64-2024-03-18-14ba398/roc'
  Reason: tried: '/usr/local/opt/z3/lib/libz3.4.12.dylib' (no such file), '/usr/local/lib/libz3.4.12.dylib' (no such file), '/usr/lib/libz3.4.12.dylib' (no such file)
zsh: abort      roc dev

from book-of-examples.

Anton-4 avatar Anton-4 commented on May 28, 2024

I think brew install z3 zstd should fix that (macos x64 getting started).

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

Thanks @Anton-4 I did that and got a bit further.

But I seem to be getting the same kind of error now on my Mac as on Ubuntu (under WSL2 / Windows).

% roc build main.roc                
ld: library not found for -lSystem
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1064:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I also tried running roc dev and roc build --linker legacy main.roc.

Bear in mind that my Mac is quite old now and possibly @rtfeldman you don't want to support it anymore.

from book-of-examples.

Anton-4 avatar Anton-4 commented on May 28, 2024

Can you try running:

$ export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
$ export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
$ roc build main.roc

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

@Anton-4 I did that. I still get an error, but it looks a bit different now:

% roc build main.roc
ld: library not found for -lSystem
thread 'main' panicked at 'not yet implemented: gracefully handle ld (or zig in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1064:17
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

from book-of-examples.

Anton-4 avatar Anton-4 commented on May 28, 2024

Brian Carroll has experienced this issue before, I've now asked if he was able to solve it.
Is using Ubuntu 22.04 on WSL not an (attractive) option for you?

from book-of-examples.

Anton-4 avatar Anton-4 commented on May 28, 2024

Brian just confirmed he was not able to solve the issue on MacOS.

from book-of-examples.

ashleydavis avatar ashleydavis commented on May 28, 2024

@Anton-4 Success! (at least with the legacy linker)

I can move forward now, so thanks @Anton-4 and @rtfeldman for your help.

I'll document here what works and what doesn't work.

I've upgraded to Ubuntu 22.04 under WSL2:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy

This works for me now:

roc build --linker legacy main.roc

Also this:

roc dev --linker legacy

Running the code produced by the legacy link works as expected.

Building normally is ok:

$ roc build main.roc
0 errors and 0 warnings found in 10334 ms
 while successfully building:

    main

But running the output of the normal build produces a seg fault:

$ ./main
Segmentation fault

Roc dev by itself hangs indefinitely:

$ roc dev

This is the code I'm running:

$ cat main.roc
app "hello"
    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.8.1/x8URkvfyi9I0QhmVG98roKBUs_AZRkLFwFJVJ3942YA.tar.br" }
    imports [pf.Stdout]
    provides [main] to pf

main =
    Stdout.line "I'm a Roc application!"

from book-of-examples.

Anton-4 avatar Anton-4 commented on May 28, 2024

Thanks for sticking with us @ashleydavis :)
I was unable to reproduce the hanging or the segmentation fault on WSL2, Ubuntu 22.04.4 LTS on Windows 11.
Can you share the output of:

  1. roc version
  2. uname -a
  3. lscpu

from book-of-examples.

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.