GN copy maintaining directory structure ("cp -r")

133 views
Skip to first unread message

brian.a...@discordapp.com

unread,
Dec 3, 2018, 8:22:51 PM12/3/18
to Chromium-dev
Hello,

Is it feasible to use a copy() step in GN to copy the outputs from another step to a new directory, but maintaining directory structure relative to some part of the source directory? E.g., can I copy /build/gen/blah/foo/bar/baz to /build/dest/foo/bar/baz and /build/gen/blah/foo/bar/qux/quux to /build/dest/foo/bar/qux/quux? I thought the answer might involve rebase_path, but no incantation I can come up with seems to do this, and I've tried quite a few now.

Thanks!
Brian

Nico Weber

unread,
Dec 3, 2018, 8:27:48 PM12/3/18
to brian.a...@discordapp.com, chromi...@chromium.org
GN's copy() step being able to copy directories is considered a bug. https://crbug.com/855747 has some words on why. So you shouldn't try and use it for this purpose.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/52545745-8937-4619-bb9f-bb5192b7a8ff%40chromium.org.

Brian Armstrong

unread,
Dec 3, 2018, 8:30:22 PM12/3/18
to tha...@chromium.org, chromi...@chromium.org
I should have clarified, I have all the source files from get_target_outputs(), and I'm looking to transform the outputs according to this strategy, so it's not a blind recursive copy.

Mike Dougherty

unread,
Dec 3, 2018, 9:36:33 PM12/3/18
to brian.a...@discordapp.com, chromi...@chromium.org, tha...@chromium.org
Reply all
Reply to author
Forward
0 new messages