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
Add contributing quickstart guide #3496
Add contributing quickstart guide #3496
Conversation
|
||
- ``testsJVM3/test`` - run ``tests3/test`` on JVM | ||
- ``testsExtJVM3/test`` - run ``testsExt3/test`` on JVM | ||
- ``test-all`` - run all tests, ideally after ``reload`` and ``clean`` |
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.
One thing I have noticed is that reloading will reset the version of Scala you might have configured when you started sbt.
% sbt "++3.3.0; shell"
...
sbt:scala-native> scalaVersion
[info] 3.3.0
sbt:scala-native> clean; reload
...
sbt:scala-native> scalaVersion
[info] 2.12.18
I might be doing something wrong but that definitely was a surprise for me. Maybe it deserves a mention in this guide.
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.
I think it's more like sbt usage?
- You don't need to decide the Scala version to use when you launch sbt shell
- You can just run
$ sbt
to launch sbt shell, no need for++x.y.z
andshell
- You can just run
- You can change the scala version in sbt shell whenever you want
$ sbt
...
sbt:scala-native> scalaVersion
[info] 2.12.18
sbt:scala-native> ++3.3.0
...
sbt:scala-native> scalaVersion
[info] 3.3.0
I'm not sure we should add explanation for that here.
And do we want to document test-all
, since it takes so long and I personally never used in my local development.
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.
I think it's more like sbt usage?
OK, I understand.
I think I would still add something like "remember that reload
will cause the session to be restarted fresh, meaning that your configurations (e.g., ++3.3.0
) will be reset as well."
And thanks for the explanations, by the way ;)
And do we want to document test-all, since it takes so long and I personally never used in my local development.
I think we should. FWIW, the first thing I always try to do when I get started with an open source project is to try running the most comprehensive test suite possible.
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.
I think it is better to point to something a little less comprehensive to start like tests3/test
or the tools test. The testsJVM
will run tests against the VM so the is good to mention for javalib
. You might want to mention the 2_13 and 2_12 versions as well. We can't assume we have sbt experts.
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.
I hear you but my two cents is that I still believe that there should be a way for someone cloning SN for the first time to make sure everything works as expected, even if test-all
is a command that's almost never run in the "standard development workflow".
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.
You are correct but this is very much a WIP and we may have failures especially with new versions of software or different platforms - what we are trying to do is hard and 0.5.0 has not really settled down 100%.
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.
OK, I understand.
If we can agree that the goal is to eventually be able to run test-all
on supported platforms, why not keep a brief record of this discussion in the docs for the next me? I would suggest something like this:
Once you've installed all dependencies, run the `test-all` command in `sbt` to confirm that your environment is properly configured. It will run every test defined in this project, which might take a while.
> Note: it is possible that some tests ran by `test-all` might not pass or compile on your system. We are currently working on stabilizing this test suite for our supported platforms. As of this writing (<insert date>), we expect all tests to pass on Linux <insert distribution> X1.Y1 with LLVM X2.Y2, `sbt` X3.Y3, <insert other known dependencies>.
>
> Should `test-all` fail on your machine, you may try to run smaller test suites one after the other, specifically `test-runtime`, `test-tools`, <insert other test commands>.
> Known issues are <insert known issues>.
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.
I just added a disclaimer that test-all
may fail 1e57fea
I hope someone who know more about test-all can update the sentence later.
docs/contrib/quickstart.rst
Outdated
|
||
It's convenient to run the ``sandbox`` project to verify the build works as expected. | ||
|
||
Publish Locally |
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.
Publishing is a foreign concept to me as an outsider coming with a C++ background. Would it make sense to add a sentence describing what that means or a link to an already existing definition?
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.
As you may noticed "publish" means releasing, and publish locally means release ScalaNative only for local use.
I use this phrase because sbt does https://www.scala-sbt.org/1.x/docs/Publishing.html
Do you think "Release Locally" makes more sense? Or do you think pasting a link to https://www.scala-sbt.org/1.x/docs/Publishing.html helps?
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.
Thanks for these explanations.
"Release locally" might make more sense for a C++ developer but if the vocabulary is already well established in the sbt world then a link to the existing definitions is probably more appropriate.
This is a good guide to use as a reference - https://github.com/scala-js/scala-js/blob/main/DEVELOPING.md |
If it is not in the guide, this may be helpful to run individual scripted. The first to get more verbose output. sbt:scala-native> set ThisBuild / scriptedBufferLog := false
sbt:scala-native> sbtScalaNative/scripted run/build-library-static |
Unless I'm missing something it seems like @LeeTibbert suggested that we make |
It is in there so I think just adding the setting to get the output is good - https://scala-native.org/en/latest/contrib/build.html Developers need to know everything but I think that to get started |
I am flatout trying to fix the underlying bugs, so what we document makes sense. The absolute top of the document should have at least a date, immediately It might be too much effort to carry along & update a document version. The first thing a potential Contributor should see/experience is a welcome, with I support the "tiered" approach. Give the first time reader success early on. Then there should probably be series of higher or more difficult levels, working up A next step would be to run Later step should probably be An entirely separate and more difficult step would be solo Then, there should be a series of 7 or 70 Seals, quite similar to those encountered by Howard Carter a That is, advanced details (which by nature are subject to change/churn) should be in separate sections
Sorry to brain-dump & run. More when I can. |
When I first went to University, there was an "Index of Prohibited Books" (well, the title was in Latin). I am reminded of that experience when I think of |
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.
Thank you for updating the guides, I have only few additional comments, otherwise looks good to me
docs/contrib/quickstart.rst
Outdated
|
||
- Java 8 or newer | ||
- sbt 1.5.8 or newer | ||
- LLVM/Clang 6.0 or newer |
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.
We can mention recomended version which I belive would be 15+ (becouse it's using opaque points so it's easier to inspect LLVM IR files when contribution.
When it comes to sbt version doesn't really matter becouse version pinned in project/build.properties would be downloaded and used anyway.
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.
I propose we adopt wording such as:
"
Java 8 is the design center, some newer but not all, or even most, newer methods may be implemented.
For sbt and LLVM/Clang, this is what is used in Scala Native Continuous Integration and is known to work. Other
versions may work, but are not guaranteed. The further an alternate version is from the
known working version, either older or newer, the less likely they are to work".
If we change the LLVM/Clang version here, which I heartily support, we should probably change
the "minimum clang check" hidden somewhere in the codebase, perhaps to a less strict "llvm-13" or
"llvm-11".
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.
When I am not getting kicked by the other legs of the 16 legged donkey, I am chasing one or more
JDK > 17 bugs where the initial variant of sbt may matter, and need to be greater than '1.6.0' or '1.6.2'.
I am also chasing some other cases where I suspect the initial sbt version is important. I need to repeat
and capture what I think I saw. More as I have proof.
docs/contrib/quickstart.rst
Outdated
- ``nir3/test`` - run the unit tests for NIR | ||
- ``tools3/test`` - run the unit tests of the tools: ScalaNative backend |
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.
In case of nir running tests in native backend it's fine, but in case of tools the tests would now be skipped. It think it would be better to use nirJVM3
and toolsJVM3
here as this are the dominant targets
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.
Right, moved to JVM
targets b17677f
|
||
3. Navigate to ``docs/_build/html`` directory and open ``index.html`` file in your browser. | ||
|
||
Further Information |
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.
We should add parapgrah about modifing default nativeConfig
used within the Scala Native project. The contributors should modify project/MyScalaNativePlugin
instead of Build.scala. This way they would be able to quickly switch some tested options like usage of lto, release mode, etc.
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.
added fcb9df6
- Remove specific version for LLVM and sbt - Move up sandbox section - Test on JVM for nir and tools
@LeeTibbert Thank you for the feedback!
I agree, let's do this in another PR 👍
That sounds good! However, I don't know where's the place to ask question other than Github issues 🤔
I'm not sure running scripted tests are advanced feature. |
Given that PRs #3498 & #3512 have merged, I believe that the "test-all might not work" of this |
docs/contrib/quickstart.rst
Outdated
- ``testsJVM3/test`` - run ``tests3/test`` on JVM | ||
- ``testsExtJVM3/test`` - run ``testsExt3/test`` on JVM | ||
- ``test-all`` - run all tests, ideally after ``reload`` and ``clean`` | ||
- Note: it is possible that some tests ran by `test-all` might not pass or compile on your system. We are currently working on stabilizing this test suite for our supported platforms |
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.
I recommend deleting this section. Two recently merged PR have made test-all
more robust.
re: Date Merged PR #3513 is a welcome advance. Given that we are in the discussion we are in because the |
Can the |
re: I believe that the author of a PR has wide latitude. They have taken the initiative. After a period of comment, I am also a believer that a bike shed actively shedding bikes from the rain (i.e. completed and at least approximately That said:
|
Once this PR settles, I may take a run at the "Environment Setup" section of the "User's Guide". Time passes all to quickly and change comes with the dust. At least this PR is making long overdue progress to a better place. |
Evidence that we have an opportunity for improvement ;-) The place that I had in mind is the Discord scala-native channel. The place where I come across it is the Scala Native GitHub Repository So, with the consent of the folks in this discussion, I propose the following way forward:
There are other way to stitch/link this together. Thoughts? I think there is not a lot of work here and that some focused, surgical changes will re-pay the effort. The SN Repository ReadMe.md has more problems than just the "Chat" section. Let's get this approximately |
it would be good to have this in a template, but let's do that in another Pull Request.
I believe current Contributors' guide is still "valuable" as a general guideline about writing valuable commit messages. While I agree it would be nice to have better name than "Contributor's Guide", but I don't have a good alternative off the top of my head ¯_(ツ)_/¯
Oh, right 👍 I didn't think of this Discord server just because I'm not that active on that server (the conversation there is a bit too fast for me as slow English reader, since all the conversation is going on in 1 channel), but I think it's a good place to ask in a conversational form :) |
* Add contributing quickstart guide * Add URL to sbt publish from "publish locally" * Update quick start guide * Remove specific version for LLVM and sbt * Mention MyScalaNativePlugin and scriptedBufferLog * Add built date to quickstart guide
@tanishiking Congratulations & thank you for getting this over the finish line. |
* Add contributing quickstart guide * Add URL to sbt publish from "publish locally" * Update quick start guide * Remove specific version for LLVM and sbt * Mention MyScalaNativePlugin and scriptedBufferLog * Add built date to quickstart guide (cherry picked from commit 999df0d)
* Add contributing quickstart guide * Add URL to sbt publish from "publish locally" * Update quick start guide * Remove specific version for LLVM and sbt * Mention MyScalaNativePlugin and scriptedBufferLog * Add built date to quickstart guide (cherry picked from commit 999df0d)
ref #3489
This PR adds a quickstart page for contributing to ScalaNative + fixed the outdated commands.
This page is intended to provide the minimum information necessary to get started working on the ScalaNative repository. Any further information can be described on other pages and linked to from the quickstart guide.
Any comments from both experienced ScalaNative developer and newbie to ScalaNative 👍
FYI @kyouko-taiga