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

make better run smarter [feature] (#11709) #11719

Closed
AdrianV opened this issue Jul 12, 2019 · 1 comment
Closed

make better run smarter [feature] (#11709) #11719

AdrianV opened this issue Jul 12, 2019 · 1 comment

Comments

@AdrianV
Copy link
Contributor

AdrianV commented Jul 12, 2019

IMHO the new better run behavior with nim c -r feature is too optimistic now.

For example there is no recompile when I change from -d:debug to -d:release or when I change the compiler or cpu target or compiler parameters.

I would suggest that these parameters should be tracked too.

@timotheecour
Copy link
Member

timotheecour commented Jul 12, 2019

A1: when nim c -cache foo.nim foo bar gets run, nim creates a hash string hashid of all compiler flags (including cmd line ones and implicit ones from nim.cfg, config.nims, but excluding program arguments given after foo.nim, these are not cached so we can rerun with different such arguments)
... etc
# then see if hash exists otherwise create new one and garbage collect via LRU to keep disk usage low

this prevents nim c -d:foo --stacktrace:on bar.nim to invalidate what was cached by nim c -d:baz bar.nim for example; both are kept, until garbage collection kicks in

also I'd prefer this cache to be triggered by a separate --cache flag, not by the existing -r flag, for several reasons:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants