-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix broken "Releases" Makefile #13787
Conversation
Very funny CircleCI... Failing at the last, most irrelevant test :( |
Finally CI works! Forgot to add the errors I am trying to solve... Problem 1: Extract from releases tarball and run make
Problem 2: .git does not exist
|
I think when I wrote this this Makefile and install.py script it imagined it as a way to generate the source archive.. not as something that could be run from within the source archive (hence the hard dependency on the git directory). Perhaps we should remove |
Makefile
Outdated
@@ -1,5 +1,7 @@ | |||
VERSION = $(shell cat emscripten-version.txt | sed s/\"//g) | |||
DESTDIR ?= ../emscripten-$(VERSION) | |||
ifeq ($(DESTDIR),) | |||
DESTDIR := $(shell mktemp -d)/emscripten-$(VERSION) |
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.
Isn't the ?=
syntax good enough here? Do we want to support DESTDIR being empty?
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.
Actually, both can handle empty DESTDIR...
The problem is that ?=
will have different values when DESTDIR is needed, whereas :=
is defined once. This is problematic for mktemp -d
.
I can't find a one line equivalent of ?=
that handles both empty and defined once...
EDIT: looks like this isn't compatible with BSD make, I will think of something else...
I rely on |
Using "../emscripten-$(VERSION)" for "DESTDIR" has various problems Notably it self destructs the source as the extracted sources has the same name as "DESTDIR" Fix it by making a unique temporary directory and point there
This is true for all "Releases" extracted sources
But shouldn't the source archive you down already be the result of "install.py"? Oh no I see now that it is the result of |
@@ -1,5 +1,6 @@ | |||
VERSION = $(shell cat emscripten-version.txt | sed s/\"//g) | |||
DESTDIR ?= ../emscripten-$(VERSION) | |||
TMPDESTDIR := $(shell mktemp -d) | |||
DESTDIR ?= $(TMPDESTDIR)/emscripten-$(VERSION) |
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.
I still don't understand that problem this is solving. Can you explain?
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.
../emscripten-$(VERSION)
is exactly the same as $PWD
when you first extracted from zip
It will end up delete itself down the line...
EDIT: sorry got confused a bit, err, I think you need to run make
just to see what I am getting into
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.
I see, but as long as you run with make DESTDIR=xxx
it should be fine right?
Should we just error out if $DESTDIR already exists instead of deleting it?
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.
I feel that running just make
and errors out is wrong, lol
and tools/install.py
has that error implemented so it must point to folder that is clean
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.
Actually now I am not using this Makefile directly anymore as I opted to use the patched install.py
. I just want to raise this issue whether it make sense to still use this Makefile from the "Releases" zips...
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.
Ok I suppose that's the way I guess
The archlinux guys seem to package using make install DESTDIR=xxx
and from the git repo
https://github.com/archlinux/svntogit-community/blob/packages/emscripten/trunk/PKGBUILD
I think I will try to change from zip archive to git repo source somehow...
@sbc100 And because I am actually "cross compiling", the Makefile is also not good as it does a host |
I am closing this. Can you please check out termux/termux-packages#6578? Thanks. |
It's safe to assume all the Makefiles in https://github.com/emscripten-core/emscripten/releases are broken
You can test this by downloading the tarball or zip from there, extract it, cd into it and run make.
I found these problems when trying to package
emscripten
for Termux / Android. See termux/termux-packages#5043. Should be done prototyping soon...