Skip to content

Commit

Permalink
Revert "Followup to emscripten-core#8438 - fix dependencies problems …
Browse files Browse the repository at this point in the history
…that PR created (emscripten-core#8464)"

This reverts commit 6f080ae.
  • Loading branch information
VirtualTim authored May 23, 2019
1 parent b4ab221 commit 28bd9b1
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 139 deletions.
8 changes: 4 additions & 4 deletions src/library_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ mergeInto(LibraryManager.library, {
___async = 1;
},

emscripten_wget__deps: ['emscripten_async_resume', '$PATH_FS', '$Browser'],
emscripten_wget__deps: ['emscripten_async_resume', '$PATH', '$Browser'],
emscripten_wget: function(url, file) {
var _url = UTF8ToString(url);
var _file = UTF8ToString(file);
_file = PATH_FS.resolve(FS.cwd(), _file);
_file = PATH.resolve(FS.cwd(), _file);
Module['setAsync']();
Module['noExitRuntime'] = true;
var destinationDirectory = PATH.dirname(_file);
Expand Down Expand Up @@ -406,12 +406,12 @@ mergeInto(LibraryManager.library, {
}, true);
},

emscripten_wget__deps: ['$EmterpreterAsync', '$PATH_FS', '$FS', '$Browser'],
emscripten_wget__deps: ['$EmterpreterAsync', '$PATH', '$FS', '$Browser'],
emscripten_wget: function(url, file) {
EmterpreterAsync.handle(function(resume) {
var _url = UTF8ToString(url);
var _file = UTF8ToString(file);
_file = PATH_FS.resolve(FS.cwd(), _file);
_file = PATH.resolve(FS.cwd(), _file);
var destinationDirectory = PATH.dirname(_file);
FS.createPreloadedFile(
destinationDirectory,
Expand Down
11 changes: 5 additions & 6 deletions src/library_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -816,15 +816,15 @@ var LibraryBrowser = {
}
},

emscripten_async_wget__deps: ['$PATH_FS'],
emscripten_async_wget__deps: ['$PATH'],
emscripten_async_wget__proxy: 'sync',
emscripten_async_wget__sig: 'viiii',
emscripten_async_wget: function(url, file, onload, onerror) {
Module['noExitRuntime'] = true;

var _url = UTF8ToString(url);
var _file = UTF8ToString(file);
_file = PATH_FS.resolve(_file);
_file = PATH.resolve(FS.cwd(), _file);
function doCallback(callback) {
if (callback) {
var stack = stackSave();
Expand Down Expand Up @@ -869,15 +869,14 @@ var LibraryBrowser = {
}, true /* no need for run dependency, this is async but will not do any prepare etc. step */ );
},

emscripten_async_wget2__deps: ['$PATH_FS'],
emscripten_async_wget2__proxy: 'sync',
emscripten_async_wget2__sig: 'iiiiiiiii',
emscripten_async_wget2: function(url, file, request, param, arg, onload, onerror, onprogress) {
Module['noExitRuntime'] = true;

var _url = UTF8ToString(url);
var _file = UTF8ToString(file);
_file = PATH_FS.resolve(_file);
_file = PATH.resolve(FS.cwd(), _file);
var _request = UTF8ToString(request);
var _param = UTF8ToString(param);
var index = _file.lastIndexOf('/');
Expand Down Expand Up @@ -1514,13 +1513,13 @@ var LibraryBrowser = {
return info.awaited;
},

emscripten_get_preloaded_image_data__deps: ['$PATH_FS'],
emscripten_get_preloaded_image_data__deps: ['$PATH'],
emscripten_get_preloaded_image_data__proxy: 'sync',
emscripten_get_preloaded_image_data__sig: 'iiii',
emscripten_get_preloaded_image_data: function(path, w, h) {
if ((path | 0) === path) path = UTF8ToString(path);

path = PATH_FS.resolve(path);
path = PATH.resolve(path);

var canvas = Module["preloadedImages"][path];
if (canvas) {
Expand Down
18 changes: 9 additions & 9 deletions src/library_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// found in the LICENSE file.

mergeInto(LibraryManager.library, {
$FS__deps: ['__setErrNo', '$PATH', '$PATH_FS', '$TTY', '$MEMFS',
$FS__deps: ['__setErrNo', '$PATH', '$TTY', '$MEMFS',
#if LibraryManager.has('library_idbfs.js')
'$IDBFS',
#endif
Expand Down Expand Up @@ -65,7 +65,7 @@ mergeInto(LibraryManager.library, {
// paths
//
lookupPath: function(path, opts) {
path = PATH_FS.resolve(FS.cwd(), path);
path = PATH.resolve(FS.cwd(), path);
opts = opts || {};
if (!path) return { path: '', node: null };
Expand Down Expand Up @@ -116,7 +116,7 @@ mergeInto(LibraryManager.library, {
var count = 0;
while (FS.isLink(current.mode)) {
var link = FS.readlink(current_path);
current_path = PATH_FS.resolve(PATH.dirname(current_path), link);
current_path = PATH.resolve(PATH.dirname(current_path), link);

var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
current = lookup.node;
Expand Down Expand Up @@ -679,7 +679,7 @@ mergeInto(LibraryManager.library, {
return FS.mknod(path, mode, dev);
},
symlink: function(oldpath, newpath) {
if (!PATH_FS.resolve(oldpath)) {
if (!PATH.resolve(oldpath)) {
throw new FS.ErrnoError({{{ cDefine('ENOENT') }}});
}
var lookup = FS.lookupPath(newpath, { parent: true });
Expand Down Expand Up @@ -720,12 +720,12 @@ mergeInto(LibraryManager.library, {
// source must exist
var old_node = FS.lookupNode(old_dir, old_name);
// old path should not be an ancestor of the new path
var relative = PATH_FS.relative(old_path, new_dirname);
var relative = PATH.relative(old_path, new_dirname);
if (relative.charAt(0) !== '.') {
throw new FS.ErrnoError({{{ cDefine('EINVAL') }}});
}
// new path should not be an ancestor of the old path
relative = PATH_FS.relative(new_path, old_dirname);
relative = PATH.relative(new_path, old_dirname);
if (relative.charAt(0) !== '.') {
throw new FS.ErrnoError({{{ cDefine('ENOTEMPTY') }}});
}
Expand Down Expand Up @@ -872,7 +872,7 @@ mergeInto(LibraryManager.library, {
if (!link.node_ops.readlink) {
throw new FS.ErrnoError({{{ cDefine('EINVAL') }}});
}
return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
return PATH.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
},
stat: function(path, dontFollow) {
var lookup = FS.lookupPath(path, { follow: !dontFollow });
Expand Down Expand Up @@ -1506,7 +1506,7 @@ mergeInto(LibraryManager.library, {
return path;
},
absolutePath: function(relative, base) {
return PATH_FS.resolve(base, relative);
return PATH.resolve(base, relative);
},
standardizePath: function(path) {
return PATH.normalize(path);
Expand Down Expand Up @@ -1858,7 +1858,7 @@ mergeInto(LibraryManager.library, {
Browser.init(); // XXX perhaps this method should move onto Browser?
// TODO we should allow people to just pass in a complete filename instead
// of parent and name being that we just join them anyways
var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent;
var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;
var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname
function processData(byteArray) {
function finish(byteArray) {
Expand Down
2 changes: 1 addition & 1 deletion src/library_lz4.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#if LZ4
mergeInto(LibraryManager.library, {
$LZ4__deps: ['$FS', '$ERRNO_CODES'],
$LZ4__deps: ['$FS'],
$LZ4: {
DIR_MODE: {{{ cDefine('S_IFDIR') }}} | 511 /* 0777 */,
FILE_MODE: {{{ cDefine('S_IFREG') }}} | 511 /* 0777 */,
Expand Down
12 changes: 5 additions & 7 deletions src/library_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// found in the LICENSE file.

mergeInto(LibraryManager.library, {
#if FILESYSTEM == 1
$PATH__deps: ['$FS'],
#endif
$PATH: {
// split a filename into [root, dir, basename, ext], unix version
// 'root' is just a slash, or nothing.
Expand Down Expand Up @@ -80,11 +83,6 @@ mergeInto(LibraryManager.library, {
join2: function(l, r) {
return PATH.normalize(l + '/' + r);
},
},
// The FS-using parts are split out into a separate object, so simple path
// usage does not require the FS.
$PATH_FS__deps: ['$PATH', '$FS'],
$PATH_FS: {
resolve: function() {
var resolvedPath = '',
resolvedAbsolute = false;
Expand All @@ -107,8 +105,8 @@ mergeInto(LibraryManager.library, {
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
},
relative: function(from, to) {
from = PATH_FS.resolve(from).substr(1);
to = PATH_FS.resolve(to).substr(1);
from = PATH.resolve(from).substr(1);
to = PATH.resolve(to).substr(1);
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
Expand Down
2 changes: 1 addition & 1 deletion src/library_pipefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mergeInto(LibraryManager.library, {
$PIPEFS__postset: function() {
addAtInit('PIPEFS.root = FS.mount(PIPEFS, {}, null);');
},
$PIPEFS__deps: ['$FS', '$ERRNO_CODES'],
$PIPEFS__deps: ['$FS'],
$PIPEFS: {
BUCKET_BUFFER_SIZE: 1024 * 8, // 8KiB Buffer
mount: function (mount) {
Expand Down
2 changes: 1 addition & 1 deletion src/library_proxyfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// found in the LICENSE file.

mergeInto(LibraryManager.library, {
$PROXYFS__deps: ['$FS', '$PATH', '$ERRNO_CODES'],
$PROXYFS__deps: ['$FS', '$PATH'],
$PROXYFS: {
mount: function (mount) {
return PROXYFS.createNode(null, '/', mount.opts.fs.lstat(mount.opts.root).mode, 0);
Expand Down
7 changes: 3 additions & 4 deletions src/library_sdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ var LibrarySDL = {
return flags; // We support JPG, PNG, TIF because browsers do
},

IMG_Load_RW__deps: ['SDL_LockSurface', 'SDL_FreeRW', '$PATH_FS'],
IMG_Load_RW__deps: ['SDL_LockSurface', 'SDL_FreeRW'],
IMG_Load_RW__proxy: 'sync',
IMG_Load_RW__sig: 'iii',
IMG_Load_RW: function(rwopsID, freeSrc) {
Expand Down Expand Up @@ -2280,7 +2280,7 @@ var LibrarySDL = {
}

if (!raw) {
filename = PATH_FS.resolve(filename);
filename = PATH.resolve(filename);
var raw = Module["preloadedImages"][filename];
if (!raw) {
if (raw === null) err('Trying to reuse preloaded image, but freePreloadedMediaOnUse is set!');
Expand Down Expand Up @@ -2739,7 +2739,6 @@ var LibrarySDL = {
return 1;
},

Mix_LoadWAV_RW__deps: ['PATH_FS'],
Mix_LoadWAV_RW__proxy: 'sync',
Mix_LoadWAV_RW__sig: 'iii',
Mix_LoadWAV_RW: function(rwopsID, freesrc) {
Expand Down Expand Up @@ -2775,7 +2774,7 @@ var LibrarySDL = {
var bytes;

if (rwops.filename !== undefined) {
filename = PATH_FS.resolve(rwops.filename);
filename = PATH.resolve(rwops.filename);
var raw = Module["preloadedAudios"][filename];
if (!raw) {
if (raw === null) err('Trying to reuse preloaded audio, but freePreloadedMediaOnUse is set!');
Expand Down
2 changes: 1 addition & 1 deletion src/library_sockfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mergeInto(LibraryManager.library, {
$SOCKFS__postset: function() {
addAtInit('SOCKFS.root = FS.mount(SOCKFS, {}, null);');
},
$SOCKFS__deps: ['$FS', '$ERRNO_CODES'], // TODO: avoid ERRNO_CODES
$SOCKFS__deps: ['$FS'],
$SOCKFS: {
mount: function(mount) {
// If Module['websocket'] has already been defined (e.g. for configuring
Expand Down
Loading

0 comments on commit 28bd9b1

Please sign in to comment.