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

Remove logic from outside build - 0.5.0 only #2605

Merged
merged 24 commits into from
Oct 21, 2022

Conversation

ekrich
Copy link
Member

@ekrich ekrich commented Apr 20, 2022

The idea here is to not have any build or naming logic in the build file. We don't want all the build tools (sbt, Mill, Gradle, Maven, etc.) re-implementing the same logic.

This removes nativeLink / artifactPath which is called for every single project, scala version, and for normal and test configuration so that makes the sbt load much slower. Note: add a println of the value in the build and see for yourself.

The idea is also to internalize any caching or other tricks needed to speed up compilation. Even though build tools typically handle recompilation caching some of this is already in the build tools so I think this should be handled within. This is not planned for this PR however.

I would hope that we can finalize this and then attack the Library and Rust PRs after because they can build on this idea.

Note: we have this PR which may need considering. I don't quite understand the specific use in the Portsfile. #2362

@ekrich
Copy link
Member Author

ekrich commented Apr 20, 2022

Now you can run the second task as well to show the entire build config.

show sandbox2_13 / nativeConfig

show sandbox2_13 / nativeBuildConfig

Copy link
Contributor

@WojciechMazur WojciechMazur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this change, but let's schedule it for 0.5.0, it would be way easier for maintainers of the mill, scala-cli or other build tools to handle that.

@WojciechMazur WojciechMazur added this to the 0.5.0 milestone Jun 27, 2022
@ekrich
Copy link
Member Author

ekrich commented Jun 27, 2022

Sounds good. I need to change the artifact basename to be in the NativeConfig vs Config. I also think it might be nice to drop the -out for the executable, for the test executable too?

I plan to do some followup work to fix the discovery issues and capture the discovered items to speed up the build.

@ekrich ekrich force-pushed the topic/artifact-name branch 2 times, most recently from 344d6cf to 2473e29 Compare July 18, 2022 21:12
@ekrich ekrich force-pushed the topic/artifact-name branch 2 times, most recently from 51fe29a to 70be30f Compare September 23, 2022 15:01
@ekrich
Copy link
Member Author

ekrich commented Sep 23, 2022

I have heard rumblings about wanting C and C++ options separate and perhaps we can separate include and link paths from the options. Perhaps we should have the conformance option separate as well like the standard e.g. -std=c++11. I also plan to make discovery return the items that will be used for compiling and linking so if you want to augment/inspect/replace them then all these things are possible. This way we can remove settings from the build that can't be changed. In other words, you can pretty much set nothing or have complete control. I am also thinking about/formulating plans to allow each project to present options for that project read from scala-native.properties. This can allow the link filtering -D_MYDEF setting and other things to make the library developer better. We could also separate to GC and move some code around to the proper project.

I also plan to cache the discovery - it only needs to happen once (reloaded when the build is reloaded). Not sure how that works for different platfroms yet. With the properties file, we could also cache those for each sub-project to avoid extra computation. Also, checking time stamps on the native files could avoid recompilation similar to make.

@ekrich ekrich changed the title Draft: Remove logic from build Draft: Remove logic from outside build but give users more control Sep 23, 2022
@ekrich
Copy link
Member Author

ekrich commented Sep 27, 2022

Check if this is supported for workdir - #2438

@ekrich ekrich changed the title Draft: Remove logic from outside build but give users more control Remove logic from outside build Sep 29, 2022
@ekrich ekrich changed the title Remove logic from outside build Remove logic from outside build - 0.5.0 only Sep 30, 2022
@ekrich
Copy link
Member Author

ekrich commented Oct 11, 2022

@WojciechMazur This is ready for review. I would prefer to do several smaller PRs on the way to better tools rather than a big bang that is hard to review.

@ekrich ekrich force-pushed the topic/artifact-name branch 2 times, most recently from 13e1f4e to d1ba21b Compare October 14, 2022 22:44
@WojciechMazur WojciechMazur merged commit cf79a29 into scala-native:main Oct 21, 2022
@ekrich ekrich deleted the topic/artifact-name branch October 22, 2022 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants