Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plain Dart Quickstart compiles the wrong program when project root directory isn't exactly helloworld #21

Closed
PEZ opened this issue Apr 16, 2022 · 6 comments

Comments

@PEZ
Copy link

PEZ commented Apr 16, 2022

Hello, thanks for your work with ClojureDart!

This is a follow-up from Clojurians Slack.

When following the instructions for the Plain Dart Quickstart, almost to the letter, I ended up with the wrong program being compiled. It prints Hello World!, and not the expected hello, world. The only part I didn't follow was that I did not name the project directory helloworld.

When I follow the instructions, including naming the project directory helloworld, it prints the expected message.

I published a repository containing both variants here: https://github.com/PEZ/clojuredart-quickstart-root-problem

I removed the .gitignore files, in case some otherwise ignored file contains some clue.

@dupuchba
Copy link
Contributor

I can't reproduce what you are describing.
When you look at both generated dart under lib/cljd-out/quickstart/helloworld.dart the code looks great.
Maybe I am missing something

@PEZ
Copy link
Author

PEZ commented Apr 19, 2022

Indeed, that looks fine. But when I run the program I get these results:

~/Projects/tests/clojuredart/repro/helloworld % dart run
Building package executable... (1.0s)
Built helloworld:helloworld.
hello, world
~/Projects/tests/clojuredart/repro/hello-clojurdart % dart run
Building package executable...
Built hello_clojurdart:hello_clojurdart.
Hello world!

You don't? Is there some info from my system I should provide that could point at what is making the difference?

@dupuchba
Copy link
Contributor

and if you do
dart run -t /lib/cljd-out/quickstart/helloword.dart ?

@PEZ
Copy link
Author

PEZ commented Apr 19, 2022

That gives me an error that -t is not an known option. But if I skip the -t:

~/Projects/tests/clojuredart/repro/hello-clojurdart % dart run lib/cljd-out/quickstart/helloworld.dart
lib/cljd-out/quickstart/helloworld.dart: Warning: Interpreting this as package URI, 'package:hello_clojurdart/cljd-out/quickstart/helloworld.dart'.
hello, world

I don't know what I am doing here, totally new to Dart. 😄

@PEZ
Copy link
Author

PEZ commented Apr 19, 2022

The contents of the bin directory is quite different between the two:

  1. https://github.com/PEZ/clojuredart-quickstart-root-problem/tree/master/hello-clojurdart/bin2.
    • There's a bin/hello_clojurdart.dart here with the code that matches what is executed with dart run
    • And also a bin/hello-clojurdart.dart which just imports the stuff in lib
  2. https://github.com/PEZ/clojuredart-quickstart-root-problem/tree/master/helloworld/bin
    • Here only a bin/helloworld.dart with the imports.

@cgrand
Copy link
Contributor

cgrand commented Apr 19, 2022

ah ah it's some dash-munging on the Dart side!

@cgrand cgrand closed this as completed in d7e574a Apr 20, 2022
PEZ added a commit to PEZ/ClojureDart that referenced this issue Apr 20, 2022
The instructions still didn't work. But with this change they do. 😄 

Fixes Tensegritics#21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants