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

nativeLinkReleaseFast and nativeLinkReleaseFull SBT tasks #3391

Merged
merged 1 commit into from Jul 17, 2023

Conversation

keynmol
Copy link
Contributor

@keynmol keynmol commented Jul 16, 2023

Currently the way to build release fast/full is to either use the environment variables (either built-in or roll your own, which couples the correctness to the global settings you need to get right), or use set nativeMode := ... as part of the SBT call - but that necessarily reloads the session and isn't great for interactive use.

I think the experience can be improved - the tasks output stable locations of linked binaries, they can be immediately run, it works great with shell history (because of -release-fast suffix).

In the target folder you immediately see all the binaries with different names, which makes it clear and less error prone when running benchmarks against different configurations. You can also use these tasks to feed into other SBT tasks (running automatic benchmarks for example)

image

@WojciechMazur WojciechMazur modified the milestone: 0.5.0 Jul 16, 2023
@WojciechMazur WojciechMazur added the backport candidate PR which might be backported into previous major release of SN label Jul 16, 2023
@WojciechMazur
Copy link
Contributor

I wonder should we deprecate the withMode flags, and made them build internal. In such case nativeLink would be equivalent of mode = debug. If maybe we should add nativeLinkDebug and make nativeLink delegate to nativeLinkDebug.

@LeeTibbert
Copy link
Contributor

Re: I wonder should we deprecate the withMode flags, and made them build internal

If you are talking about the withMode() in .sbt files, such as the snippet from the
SN docs below, I suggest that it remains. I am a big fan of the Python concept
of "One, and preferably one, obvious way of doing things". Yes, keeping two
ways of doing things goes against that.

I currently can set the value, along with its kin, once in my local.sbt file and not have to tax
my memory of what the proper values are for that project, what fumbly special sbt
command line, or what script file I created which has that fumbly special
sbt command line.

nativeConfig ~= {
  _.withLTO(LTO.thin)
    .withMode(Mode.releaseFast)
    .withGC(GC.commix)
}

@WojciechMazur WojciechMazur merged commit c66dd35 into scala-native:main Jul 17, 2023
77 checks passed
@keynmol keynmol deleted the native-link-release-fast branch July 17, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport candidate PR which might be backported into previous major release of SN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants