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

When compiling to JS (in `-d:release`) output contains toolchain path on dev's machine #11545

Closed
define-private-public opened this issue Jun 20, 2019 · 5 comments

Comments

@define-private-public
Copy link
Contributor

commented Jun 20, 2019

I'm working on a project right now where I'm leveraging Nim's JS target. This is most likely more of a minor thing, but I noticed in the compiled output (when -d:release is defined), it's still includes some path paths from the developer's machines.

While what I found seems pretty miniscule, I'm not a fan when my compiled code has information about my system (or some of the tools that I used). This is fine when compiling a debug build, but not so much for a release.

Example

I'm finding this in the output.

function assert_valid_date_173456(monthday_173458, month_173459, year_173460) {
		if (!((monthday_173458 <= get_days_in_month_173419(month_173459, year_173460)))) {
		failed_assert_impl_14255((makeNimstrLit("/home/me/.choosenim/toolchains/nim-0.20.0/lib/pure/times.nim(624, 10) `monthday <= getDaysInMonth(month, year)` ") || []).concat(cstrToNimstr((year_173460)+"") || [],makeNimstrLit("-") || [],nsuIntToStr(month_173459, 2) || [],makeNimstrLit("-") || [],cstrToNimstr((monthday_173458)+"") || [],makeNimstrLit(" is not a valid date") || []));
		}
}

Additional Information

Nim Compiler Version 0.20.0
This happens when I compile with the -d:release flag.

@nc-x

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

It is because now --listFullPaths:on is the default, so at compile time the paths will be stored in your final executable/js. You will need to disable the above option through your project's nimble file/nims file/cfg file if you want the previous behaviour.

@alaviss

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

The flag in concern should be --excessiveStackTrace, which is now on by default. Passing --excessiveStackTrace:off should be enough.

kaushalmodi added a commit to kaushalmodi/nim_config that referenced this issue Jun 20, 2019

@narimiran narimiran added the JS label Jun 20, 2019

@define-private-public

This comment has been minimized.

Copy link
Contributor Author

commented Jun 22, 2019

I tried setting both of those two flags to off in my compile step and it didn't work. Is there something else I'm missing?

@alaviss

This comment has been minimized.

Copy link
Contributor

commented Jun 22, 2019

# for stacktrace; fixes #8928 ; Note: `fullPaths = true` is correct
# here, regardless of --excessiveStackTrace
{.line: instantiationInfo(fullPaths = true).}:

That's because of how assert work. Either we disable assertions (--assertions:off), or figure out why there's this note here.

@Araq

This comment has been minimized.

Copy link
Member

commented Jun 23, 2019

@alaviss Just remove it and see what it breaks. :-)

@Araq Araq closed this in #11574 Jun 24, 2019

alaviss added a commit to alaviss/Nim that referenced this issue Jun 27, 2019

alaviss added a commit to alaviss/Nim that referenced this issue Jun 27, 2019

Araq added a commit that referenced this issue Jul 1, 2019

assertions: fixes #11545 (#11605)
* assertions: properly fix #11545

* tests/assert: enable excessiveStackTrace

* tests/assert: add test case for #11545

* tfailedassert_stacktrace: disable excessiveStackTrace

* assertions: weird workaround for failing tests

This fixes megatest on *nix, but have no idea why

narimiran added a commit that referenced this issue Jul 2, 2019

assertions: fixes #11545 (#11605)
* assertions: properly fix #11545

* tests/assert: enable excessiveStackTrace

* tests/assert: add test case for #11545

* tfailedassert_stacktrace: disable excessiveStackTrace

* assertions: weird workaround for failing tests

This fixes megatest on *nix, but have no idea why

(cherry picked from commit 2c10b24)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.