Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
8f6e1bab
Commit
8f6e1bab
authored
Mar 13, 2019
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically rebuild packages if any patches or extra files change
parent
584c61ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
+32
-7
Makefile
Makefile
+3
-1
pyodide_build/buildall.py
pyodide_build/buildall.py
+1
-3
pyodide_build/buildpkg.py
pyodide_build/buildpkg.py
+28
-3
No files found.
Makefile
View file @
8f6e1bab
...
...
@@ -221,8 +221,10 @@ $(CLAPACK): $(CPYTHONLIB)
make
-C
CLAPACK
build/packages.json
:
$(CPYTHONLIB) $(CLAPACK)
build/packages.json
:
FORCE
make
-C
packages
emsdk/emsdk/.complete
:
make
-C
emsdk
FORCE
:
pyodide_build/buildall.py
View file @
8f6e1bab
...
...
@@ -19,9 +19,7 @@ def build_package(pkgname, dependencies, packagesdir, outputdir, args):
# Make sure all of the package's requirements are built first
for
req
in
reqs
:
build_package
(
req
,
dependencies
,
packagesdir
,
outputdir
,
args
)
if
not
(
packagesdir
/
pkgname
/
'build'
/
'.packaged'
).
is_file
():
print
(
"BUILDING PACKAGE: "
+
pkgname
)
buildpkg
.
build_package
(
packagesdir
/
pkgname
/
'meta.yaml'
,
args
)
buildpkg
.
build_package
(
packagesdir
/
pkgname
/
'meta.yaml'
,
args
)
shutil
.
copyfile
(
packagesdir
/
pkgname
/
'build'
/
(
pkgname
+
'.data'
),
outputdir
/
(
pkgname
+
'.data'
))
...
...
pyodide_build/buildpkg.py
View file @
8f6e1bab
...
...
@@ -147,16 +147,41 @@ def package_files(buildpath, srcpath, pkg, args):
fd
.
write
(
b'
\
n
'
)
def
needs_rebuild
(
pkg
,
path
,
buildpath
):
"""
Determines if a package needs a rebuild because its meta.yaml, patches, or
sources are newer than the `.packaged` thunk.
"""
packaged_token
=
buildpath
/
'.packaged'
if
not
packaged_token
.
is_file
():
return
True
package_time
=
packaged_token
.
stat
().
st_mtime
def
source_files
():
yield
path
yield
from
pkg
.
get
(
'source'
,
{}).
get
(
'patches'
,
[])
yield
from
(
x
[
0
]
for
x
in
pkg
.
get
(
'source'
,
{}).
get
(
'extras'
,
[]))
for
source_file
in
source_files
():
source_file
=
Path
(
source_file
)
if
source_file
.
stat
().
st_mtime
>
package_time
:
return
True
def
build_package
(
path
,
args
):
pkg
=
common
.
parse_package
(
path
)
packagedir
=
pkg
[
'package'
][
'name'
]
+
'-'
+
pkg
[
'package'
][
'version'
]
dirpath
=
path
.
parent
orig_path
=
Path
.
cwd
()
os
.
chdir
(
dirpath
)
buildpath
=
dirpath
/
'build'
try
:
buildpath
=
dirpath
/
'build'
if
not
buildpath
.
resolve
().
is_dir
():
os
.
makedirs
(
buildpath
)
if
not
needs_rebuild
(
pkg
,
path
,
buildpath
):
return
if
buildpath
.
resolve
().
is_dir
():
shutil
.
rmtree
(
buildpath
)
os
.
makedirs
(
buildpath
)
srcpath
=
download_and_extract
(
buildpath
,
packagedir
,
pkg
,
args
)
patch
(
path
,
srcpath
,
pkg
,
args
)
compile
(
path
,
srcpath
,
pkg
,
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment