boot-dev

Boot development discussion and banter
richiardiandrea 2018-01-08T01:07:50.000067Z

@bhagany I think you might be really onto something, I remember having this: https://github.com/pandeiro/boot-http/issues/70

richiardiandrea 2018-01-08T01:08:11.000049Z

It looks like I misinterpreted the problem and your explanation is probably what's happening

bhagany 2018-01-08T01:45:54.000061Z

@richiardiandrea indeed, trying to use boot-http is also how I discovered it šŸ™‚

richiardiandrea 2018-01-08T01:48:08.000001Z

@bhagany so I will need to fix it too very soon cause now I remember why I ran into that perun "misunderstanding" that you fixed. I tried to move the files back in resources and puff...now boot-http is broken because of the above šŸ¤¦ Thanks for digging btw, I did not have time at the time.

bhagany 2018-01-08T01:48:48.000032Z

Iā€™m hoping to open a PR tonight

1šŸŽ‰
bhagany 2018-01-08T03:07:44.000098Z

@richiardiandrea interesting discovery: (sift :move {#"foo\.txt" "bar.txt"} :to-asset #{#"bar\.txt"}) sticks

richiardiandrea 2018-01-08T03:08:34.000067Z

oh I never ever use that feature

bhagany 2018-01-08T03:08:43.000020Z

sift?

richiardiandrea 2018-01-08T03:08:51.000041Z

no I mean :to-asset

bhagany 2018-01-08T03:08:55.000007Z

I never have either

richiardiandrea 2018-01-08T03:09:37.000088Z

but it is a good point, I always assume that sift does the right thing and uses the output roles...

richiardiandrea 2018-01-08T03:09:46.000056Z

maybe not?

bhagany 2018-01-08T03:10:14.000158Z

I don't think it does

bhagany 2018-01-08T03:11:04.000114Z

I was wondering why when I do something like (-> fileset (boot/add-resource tmp) boot/commit!) it'll stick, but sift or mv won't

bhagany 2018-01-08T03:11:25.000074Z

and now I think it's because boot needs to know if it's a resource or asset or whatever

richiardiandrea 2018-01-08T03:13:52.000111Z

@bhagany from the code both :move and :add-* use boot.core/get-add-dir

richiardiandrea 2018-01-08T03:13:58.000022Z

digging more

bhagany 2018-01-08T03:14:37.000030Z

I'll be very glad to have other eyes on it šŸ™‚

bhagany 2018-01-08T03:15:20.000026Z

I don't see where sift :move does get-add-dir, though

richiardiandrea 2018-01-08T03:15:23.000097Z

sorry actually no, sift-action :move uses another code branch

bhagany 2018-01-08T03:15:33.000096Z

cool, we're on the same page

richiardiandrea 2018-01-08T03:16:04.000028Z

yeah that's tricky because sift-mv is used there on top in those defmethod

bhagany 2018-01-08T03:16:09.000006Z

very interesting that :to-* wrap ... exactly

richiardiandrea 2018-01-08T03:17:41.000068Z

maybe :move should use the same code, sift-mv, with a default role ?

bhagany 2018-01-08T03:18:07.000067Z

I've been wondering if there's a way to easily determine the role of the src file...

richiardiandrea 2018-01-08T03:18:29.000052Z

I would default it to one that outputs

bhagany 2018-01-08T03:19:07.000210Z

I feel like it's hard to pick a default for it

bhagany 2018-01-08T03:20:02.000063Z

@bhagany uploaded a file: https://clojurians.slack.com/files/U051706GF/F8P81HUSX/image.png

richiardiandrea 2018-01-08T03:20:05.000096Z

well 80% of the times you want to transform from an input role to an output role, or from a resource (which is output atm) to output

bhagany 2018-01-08T03:20:06.000035Z

that ?? gets me every time

richiardiandrea 2018-01-08T03:20:10.000037Z

yeaaaaaaaaaaaaa

richiardiandrea 2018-01-08T03:20:26.000025Z

so I would default to asset

bhagany 2018-01-08T03:20:44.000042Z

hrm, I was leaning toward resource

bhagany 2018-01-08T03:21:00.000002Z

at least in the case of Perun, we often want to use files as input as well

bhagany 2018-01-08T03:21:15.000085Z

after processing them a bit

richiardiandrea 2018-01-08T03:21:27.000012Z

right

richiardiandrea 2018-01-08T03:22:43.000024Z

you are right boot is compositional/transformational...so everything that is more than just one task will need :resource-like role

richiardiandrea 2018-01-08T03:23:34.000028Z

notably only the last task has input->output

bhagany 2018-01-08T03:24:03.000017Z

yeah, that's is how I understand it as well

bhagany 2018-01-08T03:24:23.000087Z

not that I'd be very surprised to find that I don't actually understand it šŸ™‚

richiardiandrea 2018-01-08T03:25:13.000015Z

I am trying to use sift-mv in place of the current :move implementation

bhagany 2018-01-08T03:25:31.000081Z

I'm not sure we can do that

bhagany 2018-01-08T03:25:51.000026Z

sift-mv modifies :dir, and sift-action :move modifies :path

bhagany 2018-01-08T03:26:34.000114Z

my first impulse is to modify sift-action :move so that it also modifies :dir

richiardiandrea 2018-01-08T03:27:16.000102Z

yes somehow :dir needs to be added in there

bhagany 2018-01-08T03:29:51.000028Z

^ that works for me

bhagany 2018-01-08T03:30:32.000065Z

... nope, taking that back

richiardiandrea 2018-01-08T03:32:17.000104Z

I was about to try, but ok, no I am taking back the attempt šŸ˜„

richiardiandrea 2018-01-08T03:34:32.000067Z

sooo @bhagany also sift reduces over actions so basically if I understand correctly first :path is modified then :dir

richiardiandrea 2018-01-08T03:35:03.000108Z

(maybe you've noticed already :D)

bhagany 2018-01-08T03:35:49.000103Z

do you mean for something like (sift :move {#"foo\.txt" "bar.txt"} :to-asset #{#"bar\.txt"})?

richiardiandrea 2018-01-08T03:36:13.000033Z

yes, so :move is done before :to-asset

richiardiandrea 2018-01-08T03:36:17.000160Z

it seems

bhagany 2018-01-08T03:36:23.000177Z

yes, but I think that might just be luck

bhagany 2018-01-08T03:36:39.000031Z

I don't think the order of reduction is necessarily defined there

bhagany 2018-01-08T03:36:51.000015Z

Also, I modified the gist to something that actually works šŸ™‚

richiardiandrea 2018-01-08T03:36:51.000099Z

if you see the line above there is a reduce-kv

richiardiandrea 2018-01-08T03:36:56.000072Z

oh cool

richiardiandrea 2018-01-08T03:38:20.000052Z

another fix would be to compose the two, if this reduction theory is right šŸ˜„

bhagany 2018-01-08T03:39:21.000121Z

possible, but I didn't really think that we would need both reductions over the same fileset

richiardiandrea 2018-01-08T03:39:55.000054Z

well yes actually don't want to slow you down if you have another working solution

bhagany 2018-01-08T03:40:53.000149Z

well, fwiw, I am not terribly confident that this is the right thing to do. I feel like there might be some reason for the current behavior that I'm not seeing

bhagany 2018-01-08T03:41:10.000080Z

and also, I can now work around it

richiardiandrea 2018-01-08T03:41:56.000005Z

hrm, probably worth an issue, possibly pinging Misha for some insight

bhagany 2018-01-08T03:42:42.000099Z

yeah, I'll open an issue, and perhaps a maintainer or two will take the trouble to read this conversation šŸ™‚

richiardiandrea 2018-01-08T03:43:19.000051Z

šŸ˜„

bhagany 2018-01-08T03:45:48.000111Z

maybe I'll skip right to the PR and see how it goes

richiardiandrea 2018-01-08T03:46:37.000099Z

Would be awesome, also to see if the current tests are passing (even if not very many)

bhagany 2018-01-08T03:48:23.000029Z

yup, tests pass

1šŸ‘
bhagany 2018-01-08T03:48:29.000025Z

on os x at least

martinklepsch 2018-01-08T11:49:53.000072Z

Anyone comfortable with Java could have a good impact here: https://github.com/boot-clj/boot-bin/issues/6