flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: AW: AW: AW: AW: AW: [FalconJX] Extern builds use patch files instead of replace tasks
Date Tue, 31 May 2016 21:12:54 GMT
Somehow dev@ keeps falling of the recipients list…

Anyway, an update:

Using my Mac and the command line Gnu patch (not Git or Maven patch plug-in), I am able to
reproduce what you reported:  The patch I generated from Git does not apply correctly to those
four files and using the –l (ignore whitespace) option doesn't help.  But, I just discovered
that by getting Ant to run fixcrlf on the downloaded files, then Gnu patch can correctly apply
the patch.  I guess that means that it is a line ending issue.  Git must be more tolerant
that Gnu patch about EOL in the source files.

I also tried generating the patch from diff (instead of Git) and it wouldn't apply either,
so I don't think it is the way Git diff vs Mac diff work, I think it is that the ExternC with
js-root option rewrites the .JS files with, in this case, Mac EOL and those four files have
DOS EOL in them.  I suppose we could try tweaking ExternC to remember the EOL in the input
file and use it during output, but would it be possible to run the equivalent of fixcrlf from
Maven somehow?

Thanks,
-Alex

From: Alex Harui <aharui@adobe.com<mailto:aharui@adobe.com>>
Date: Tuesday, May 31, 2016 at 1:02 PM
To: Christofer Dutz <christofer.dutz@c-ware.de<mailto:christofer.dutz@c-ware.de>>
Subject: Re: AW: AW: AW: AW: AW: [FalconJX] Extern builds use patch files instead of replace
tasks

I think I correctly applied your patch in the Ant build and when testing the results in an
app, I got tons of warnings.  In looking at the proposed patches, it appears that the patch
isn't "complete".  The Ant patch is working with JS files that have been processed with ExternC
with -js–root to strip out function bodies and otherwise prepare the JS files to look like
real externs to the Google Closure Compiler.  I think we had a miscommunication there.

I've updated the flex-asjs/examples/flexjs/CreateJSExample to properly use the createjs.swc
from flex-falcon.  Before my latest update, building that example was resulting in about 7
warnings like:


WARNING - 'createjs.Stage' used but not goog.require'd

(There are some other non-CreateJS warnings, but less ignore those for this discussion). 
That's because the createjs.swc, with its .js files packed in it wasn't being included as
an external SWC.  With my change to the build.xml in flex-asjs/examples/flexjs/CreateJS, it
now uses the createjs.swc and the results using the Ant-built version cause those warnings
to go away (but unfortunately, they are replaced by about 10 warnings about toString which
we'll have to fix at some point).

Those warnings about "used but not required" go away because part of building an externs SWC
is to make sure you have .js files that fit the externs format that GCC expects.  But GCC
is pickier when parsing externs than when otherwise parsing JS files.  It doesn't seem to
like function bodies and other stuff.  That's why I added the -js–root option to ExternC:
 we can use the less-picky GCC parsing to take the CreateJS source files and build an AST,
then generate the .AS files from that AST as well as generate a set of externs-like JS files
for GCC, so when GCC later tries to parse the JS files it doesn't output tons of warnings.

So, I think we do need to do more surgery on the CreateJS source files than I think the Maven
preprocessing is currently doing, and currently that is enough changes that Git diff seems
to treat it much like a "delete and new".  It might be possible to upgrade ExternC to try
to retain the whitespace and line numbering of the input files, but I think I'd like to explore
more about why Maven can't apply a big patch like that.  So that's what I'm off to experiment
with now.

-Alex


From: Christofer Dutz <christofer.dutz@c-ware.de<mailto:christofer.dutz@c-ware.de>>
Date: Tuesday, May 31, 2016 at 9:53 AM
To: Alex Harui <aharui@adobe.com<mailto:aharui@adobe.com>>
Subject: AW: AW: AW: AW: AW: [FalconJX] Extern builds use patch files instead of replace tasks

Hi Alex,

The format is the same. I was able to apply the other patches. Just the one didn't.

Looking at the patch itself it seemed as if it replaced the entire file content instead of
just applying a few changes. So the problem is just creating the patch not applying it. Perhaps
investigating problems in the patch creation helps.

Chris



Von meinem Samsung Galaxy Smartphone gesendet.


-------- Ursprüngliche Nachricht --------
Von: Alex Harui <aharui@adobe.com<mailto:aharui@adobe.com>>
Datum: 31.05.16 18:42 (GMT+01:00)
An: Christofer Dutz <christofer.dutz@c-ware.de<mailto:christofer.dutz@c-ware.de>>,
dev@flex.apache.org<mailto:dev@flex.apache.org>
Betreff: Re: AW: AW: AW: AW: [FalconJX] Extern builds use patch files instead of replace tasks

Bummer.  I picked Git because everyone already had to have it installed.  I wasn't sure about
diff and patch on Windows machines.  I'll be around my Windows machine on Wednesday.  Or maybe
I can figure out how to get Git to generate and consume the same patch format.  I think I
tried it earlier and was unsuccessful.  I'll look into it.

-Alex

From: Christofer Dutz <christofer.dutz@c-ware.de<mailto:christofer.dutz@c-ware.de>>
Date: Tuesday, May 31, 2016 at 2:41 AM
To: Alex Harui <aharui@adobe.com<mailto:aharui@adobe.com>>, "dev@flex.apache.org<mailto:dev@flex.apache.org>"
<dev@flex.apache.org<mailto:dev@flex.apache.org>>
Subject: AW: AW: AW: AW: [FalconJX] Extern builds use patch files instead of replace tasks


Hi Alex,


I am using a Mac and I tried what you suggested. Nothing worked :-(


So I had a look at the patch files and noticed that they seem to create and delete most of
the files. So I manually created a patch using:


diff -ur../target/downloads/TweenJS-0.6.2/src/TweenJS-0.6.2/src/ > tweenjs2.patch


And the patch created this way looked completely different. I was able to apply the patch
created this way without any problems. So maybe using git to create the patch isn't ideal.
I added my versions as tweenjs2.patch and easeljs2.patch and updated the maven build to use
these ... could you please try and update your workflow to generate the patch files differently.


Chris

________________________________
Von: Alex Harui <aharui@adobe.com<mailto:aharui@adobe.com>>
Gesendet: Freitag, 27. Mai 2016 18:08:30
An: Christofer Dutz; dev@flex.apache.org<mailto:dev@flex.apache.org>
Betreff: Re: AW: AW: AW: [FalconJX] Extern builds use patch files instead of replace tasks

Are you on a Mac or Windows machine?

I removed the ignore whitespace option from the ant build and the same 4 files failed so I
still suspect a line ending problem.  I noticed the whitespace option in the plugin defaults
to true so not sure why it doesn't work for you.

Can you try applying the patch manually and running unix2dos and or dos2unix on the 4 files
and the patch files?  That may not be a final solution but will prove it is a line ending
issue.

I also used a byte viewer to see that the patch and source had different line ending.

Sent from my LG G3, an AT&T 4G LTE smartphone

------ Original message------
From: Christofer Dutz
Date: Fri, May 27, 2016 1:35 AM
To: dev@flex.apache.org<mailto:dev@flex.apache.org>;
Subject:AW: AW: AW: [FalconJX] Extern builds use patch files instead of replace tasks

Hi Alex,

well I think I was blind and overlooked the "strip" option cause almost every Maven plugin
has a "skip" option and this one doesn't ... but using strip=7 I was able to apply the patches,
but still the 4 files still don't work correctly ... even with "ignoreWhitespace" option turned
on.

Chris



________________________________________
Von: Alex Harui <aharui@adobe.com<mailto:aharui@adobe.com>>
Gesendet: Donnerstag, 26. Mai 2016 18:50:59
An: dev@flex.apache.org<mailto:dev@flex.apache.org>
Betreff: Re: AW: AW: [FalconJX] Extern builds use patch files instead of replace tasks

On 5/26/16, 9:15 AM, "Christofer Dutz" <christofer.dutz@c-ware.de<mailto:christofer.dutz@c-ware.de>>
wrote:

>
>Hi Alex,
>
>I had a look and the plugin doesn't offer this ... the paths seem to be
>invalid ones anyway ... it seems that you copied the originals to a
>directory "a" and the patched ones to one called "b" and created the
>patch from that. After fixing this path-problem, I was able to apply most
>of the patch. The only files that weren't able to be patched were:
>- createjs/events/EventDispatcher.js
>- easeljs/display/Container.js
>- easeljs/display/DisplayObject.js
>- easeljs/utils/SpriteSheetUtils.js
>
>When applying this manually IntelliJ complained about part of the patch
>already being applied. Any ideas?

I am using git to create and apply patches.  They seem to start paths with
"a" and "b".  Not sure why.  Every patch/diff I've worked with seems to
have that.

I found this page:
http://maven.apache.org/plugins/maven-patch-plugin/apply-mojo.html

It lists a "skip" option which I think matches the -p option that should
cut directories of the paths.

It also lists an "ignore-whitespace" option which the Ant build is using
because EventDispatcher.js has different line endings (CRLF) than the
other files.  The other 3 files you mentioned may have the same issue.

Is it possible for you to use those two options?

-Alex

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message