-
Notifications
You must be signed in to change notification settings - Fork 97
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
Stdlib: Reorganize build, test and nix setup #1131
Conversation
Noteworthy changes: * Stdlib sources are in `stdlib/src` tests are in `stdlib/test` docs are in `stdlib/doc` (no more `rm $out/*Test.mo`) * Individual Makefiles in these directories, as well as the three examples in `stdlib/examples/*` * In `stdlib/tests`, auto-generate a test that simply imports all stdlib files. This makes sure the stdlib actually compiles (was not the case before) * Tests and examples use package imports `"mo:stdlib/…"` to import the stdlib, instead of relative paths. The `Makefile`s are set up to point to `./stdlib/src` by default. But when building via nix, we are building against the stdlib as installed by nix * More fine-grained nix setup, so when you just change the examples, or the tests, the `stdlib` derivation does not have to be rebuild. * Runs the tests for `Rx` and `ActorSpec` using `wasmtimes`
(if someone is worried about possible merge conflicts of their PRs against stdlib, I volunteer to merge |
This is great; thanks, Joachim! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me try these.
5fa202e
to
7d1c926
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the .md
, .html
files are garbled?
import Prim "mo:prim";
import Iter "iter.mo";
module {
Hash values
Try
head ~/motoko/stdlib/doc/_out/hash.md
Similarly
tail ~/motoko/stdlib/doc/_out/hash.md
@matthewhammer maybe you can adapt the doc extractor to deal with the new-fangled imports and module { ... }
wrapping? (Could be in a follow-up PR!)
Co-Authored-By: Gabor Greif <[email protected]>
Is that a regression with the docs? I am tempted to work on a simple doc system that is good enough to get the stdlib docs into the current manual soon (even if it's not anything we can hand out to people to use on their own libraries yet). So I'd rather not hold this up by the (currently unused) docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, polished docs can wait. LGTM!
…ko into joachim/stdlib/makefile
Closed in favor of #1135 |
I like the idea of fixing this (it should be fixed), but I don't like the idea of investing more energy in my python script. It was never meant to live this long, honestly. What did we decide this morning, in the team meeting? |
We didn't decide anything really. I am inclined to have a closer look at what we have, maybe refine the hack we have, and produce asciidoc that can be included as a chapter in the manual maybe. |
Noteworthy changes:
Stdlib sources are in
stdlib/src
tests are in
stdlib/test
docs are in
stdlib/doc
(no more
rm $out/*Test.mo
)Individual Makefiles in these directories,
as well as the three examples in
stdlib/examples/*
In
stdlib/tests
, auto-generate a test that simply importsall stdlib files. This makes sure the stdlib actually compiles
(was not the case before)
Tests and examples use package imports
"mo:stdlib/…"
to importthe stdlib, instead of relative paths.
The
Makefile
s are set up to point to./stdlib/src
by default. Butwhen building via nix, we are building against the stdlib as
installed by nix
More fine-grained nix setup, so when you just change the examples,
or the tests, the
stdlib
derivation does not have to be rebuild.Runs the tests for
Rx
andActorSpec
usingwasmtimes