Closed timofei-iatsenko closed 3 years ago
Regarding point 1, build artifacts means everything not tracked by git, these needs to be tracked in case the build result depends on these
To have ultra runner work on CI you will need to cache non tracked files (build artifacts, node moduels) and the .ultra.cache.json files, this way the next builds will skip unchanged packages
The main reason we're tracking build artifacts is to make sure nothing was deleted in between builds, but to be fair, for most use cases this is probably overkill.
I don't fully understand why your project gets rebuild every time though. Are you certain nothing outside of build
creates or modifies files? What is the list of changes that ultra
shows?
To answer your other questions:
--rebuild
whenever you make those kinds of changes. ultra
only looks within its own package and dependencies.I don't fully understand why your project gets rebuild every time though. Are you certain nothing outside of build creates or modifies files? What is the list of changes that ultra shows?
I found the root cause of my issue. I had files that are "build artefacts", but was added (tracked) to the git. I don't remember why it was done like that, but adding them to git ignore and deleting from index fixed the issue.
Thanks for the answers, looks very good, now it works well.
@thekip glad you were able to resolve your issue!
Hey, @folke thanks for the really good piece of software. The ultra-runner looks awesome and really promising for our workflow. Yesterday I ran it in our rush monorepo and as stated in docs it builds everything with zero-config, nice job!
However, I would like to know more about incremental build feature. To know how to optimize code or what patterns to avoid and what can cause optimization bailouts.
Could you elaborate a bit more on the strategy used for incremental build?
For example:
From doc:
Wy we even should keep track on "build artefacts"? The build artefacts should not affect building, because they are, literally build artefacts, not sources.
Following up this question should I store my artefacts in project folder eq
projects/app1/dist
or it's better to hoist it into another level out of package folder?What happened if I change root-level dependency or environment variable? For example root level
tsconfig.json
or dependencies in root level package.json. Does it treats package folder as "hermetic" where only changes applied to files inside that folder may produce different build no matter of environment (node version?).More real-world example. I have a package with build command:
Where
gulp extract-messages
creates a*.pot
file in{package-name}/src/translates
.I see on my CI that this invalidate cache every time. Means all consequent runs (without any changes) always trigger full rebuild.
As far as I understand ultra runner should create
.ultra.cache.json
after build command successfully executed. It means it should store mtime of these newly created files (kind of artefacts) and next time skips build.But somehow these files invalidate cache every time. Do I understand the flow correctly? Do I miss something?