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

Integration tests that ensure dependencies are recompiled or not recompiled depending on mtime #2945

Closed
ry opened this issue Sep 14, 2019 · 4 comments

Comments

@ry
Copy link
Member

ry commented Sep 14, 2019

It's not clear to me that we correctly recompile dependencies when some file deep in the dep tree is changed. I think the only way for this to work correct is if the dependency tree is written into the cache... But maybe I'm wrong.

We need to verify this is correct before 1.0

@ry ry mentioned this issue Sep 14, 2019
43 tasks
@bartlomieju
Copy link
Member

Related issue #1692?

@bartlomieju
Copy link
Member

bartlomieju commented Sep 25, 2019

Informational note: currently TS files are recompiled if their' hash doesn't match hash of compiled version.

File hash is calculated using this function:

pub fn source_code_version_hash(
  source_code: &[u8],
  version: &str,
  config_hash: &[u8],
) -> String {
  gen_hash(vec![source_code, version.as_bytes(), config_hash])
}

So hash consists of compiled file contents, Deno version and content of tsconfig.json (if it's provided). That means that touch some/ts/file.ts won't trigger recompilation. The other problem with this approach appears when you consider two separate Deno processes:

$ deno -c tsconfig.json some/ts/file.ts &
$ deno some/ts/file.ts &

This might not work as expected because two different processes will compile the same file and put it's compiled counterpart in cache, however they use different compiler configs which might cause strange quirks. Some time ago we talked about "lock files" for DENO_DIR, but nothing concrete was settled upon.

@hayd
Copy link
Contributor

hayd commented Sep 26, 2019

I wonder if a solution to this may also present a solution to #200 (an "integrity" hash on the dep tree to match against).

@bartlomieju
Copy link
Member

No longer relevant after recent refactors to TS compiler and module graph (#7225)

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

3 participants