-
Notifications
You must be signed in to change notification settings - Fork 989
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
Clean /tmp and $TMPDIR in make clean #9150
Conversation
Pull Request Checklist
|
Jenkins BuildsClick to see older builds (78)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work:
Cleaning Yarn/Metro caches in temp dirs ...
/bin/sh: 6: pushd: not found
/bin/sh: 9: popd: not found
/bin/sh: 6: pushd: not found
/bin/sh: 9: popd: not found
Makefile:90: recipe for target 'clean' failed
make: *** [clean] Error 127
This logic a bit clunky, there's a simpler way to do this by using a status-react
-specific TMPDIR
:
# We don't want to use /run/user/$UID because it runs out of space too easilly
export TMPDIR = /tmp/tmp-status-react
Then add a target that will run first on every make
call to crate it:
#----------------
# Required targets
#----------------
mk-tmpdir: SHELL := /bin/sh
mk-tmpdir: ##@prepare Create a TMPDIR for temporary files
@mkdir -p "$(TMPDIR)"
# Run these tasks every time make is called
-include mk-tmpdir
This should be above the Nix section in Makefile.
Then modify the clean
target to look like this:
rm-tmpdir: SHELL := /bin/sh
rm-tmpdir: ##@prepare Remove TMPDIR
rm -r "$(TMPDIR)"
clean: SHELL := /bin/sh
clean: _fix-node-perms rm-tmpdir ##@prepare Remove all output folders
git clean -dxf -f
It would be also good to add both new targets at the end of .PHONY
.
@jakubgs i tested this on macOS and it worked there, but maybe because my |
@jakubgs thanks for reviewing! A question - you suggest to use a separate $TMPDIR for status-react, but what about |
Well, But you might be right, |
Damn, I added some commands before
https://ci.status.im/job/status-react/job/prs/job/android-e2e/job/PR-9150/3/ |
@siphiuel are you referring in your description to the following files?
Because if so then on CI hosts they don't end up in |
According to
This is the part of the I need to find a way to customize it, because we can't just blindly remove the cache folder, since other CI builds on the same host could be using one of the directories we would try to remove. |
Ah, I see, by default if
Now, |
07df0b3
to
66baccc
Compare
Yeah, it must be something like the |
3bcbebd
to
8e4c963
Compare
I managed to make it work. I added a MacOS
Linux
Windows
Android & iOSIt appears mobile platforms do not create any of those |
55b5450
to
ae6fd67
Compare
ae6fd67
to
d09ed15
Compare
Also: - parallelize upload and achive stages - fix s3cmd uploads for combined Jenkinsfile - fix failing TestFlight clean job Signed-off-by: Jakub Sokołowski <jakub@status.im>
d09ed15
to
f28fd8f
Compare
Sometimes Metro bundler cache/Yarn cache get broken and this issue manifests itself in weird errors during app startup, e.g.
ReactClassInterface: You are attempting to define 'UNSAFE_componentWillReceiveProps' on your component more than once. This conflict may be due to a mixin
.The solution is to clean temp directories, on macOS at least Yarn and Metro bundler put their cache files into
/tmp
and$TMPDIR
folders.Changes:
TMPDIR
to be/tmp/tmp-status-react-$(BUILD_TAG)
whereBUILD_TAG
is the commitBUILD_TAG
is a unique build identifierTMPDIR
to_NIX_KEEP
so it's passed to Nix shell and builds_tmpdir-mk
target toMakefile
to be called every timemake
is called_tmpdir-rm
target toMakefile
to be called withmake clean
Archive
andUpload
stages to shorten the builds a bits3cmd
upload, since Nix isn't available on masterfastlane ios clean
job by adding missingNIX_IGNORE_SYMLINK_STORE=1
(fix failing TestFlight clean job #9232)