{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/11703","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/11703/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/11703/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/11703/events","html_url":"https://github.com/gradle/gradle/issues/11703","id":538942450,"node_id":"MDU6SXNzdWU1Mzg5NDI0NTA=","number":11703,"title":"Build script class names depend on the absolute path","user":{"login":"wolfs","id":423186,"node_id":"MDQ6VXNlcjQyMzE4Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/423186?v=4","gravatar_id":"","url":"https://api.github.com/users/wolfs","html_url":"https://github.com/wolfs","followers_url":"https://api.github.com/users/wolfs/followers","following_url":"https://api.github.com/users/wolfs/following{/other_user}","gists_url":"https://api.github.com/users/wolfs/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfs/subscriptions","organizations_url":"https://api.github.com/users/wolfs/orgs","repos_url":"https://api.github.com/users/wolfs/repos","events_url":"https://api.github.com/users/wolfs/events{/privacy}","received_events_url":"https://api.github.com/users/wolfs/received_events","type":"User","site_admin":false},"labels":[{"id":1257907014,"node_id":"MDU6TGFiZWwxMjU3OTA3MDE0","url":"https://api.github.com/repos/gradle/gradle/labels/@build-cache","name":"@build-cache","color":"a8221e","default":false,"description":"Issues owned by build-cache team"},{"id":289469033,"node_id":"MDU6TGFiZWwyODk0NjkwMzM=","url":"https://api.github.com/repos/gradle/gradle/labels/from:member","name":"from:member","color":"0052cc","default":false,"description":null}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-12-17T09:29:06Z","updated_at":"2020-01-06T10:16:04Z","closed_at":null,"author_association":"MEMBER","body":"It seems like we use the absolute path for the class names of build scripts, see https://github.com/gradle/gradle/blob/a138710ab109e271b17ee48dc49b359284cd3f66/subprojects/core/src/main/java/org/gradle/groovy/scripts/TextResourceScriptSource.java#L76-L79.\r\n\r\nAs a consequence, `Closure`s defined in build scripts (`build.gradle`) also will have a reference to the absolute path of the build script. The class name looks something like this: `build_cy3ca74runcdcinr48br22m24$_run_closure2$_closure4`.\r\n\r\nThis means that nested beans, like `CommandLineArgumentProvider`s, defined by `Closure`s in build scripts will cause the task to become non-relocatable.\r\n\r\nFor example, this is what happened in the spring boot build: https://ge.spring.io/c/4odyr2tkwjse6/aha5vme4vawuo/task-inputs\r\n\r\nThis is the corresponding code: https://github.com/wilkinsona/spring-boot/blob/7e400d1e73b0d008b6e4f4c200fe1bec9cb7a10c/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-cassandra/build.gradle#L23-L32\r\n\r\nAs a workaround, an actual class can be defined in the build script, which causes the class name to not contain a reference to the build script.\r\n\r\n---\r\ncc: @gradle/build-cache\r\n"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/571082987","html_url":"https://github.com/gradle/gradle/issues/11703#issuecomment-571082987","issue_url":"https://api.github.com/repos/gradle/gradle/issues/11703","id":571082987,"node_id":"MDEyOklzc3VlQ29tbWVudDU3MTA4Mjk4Nw==","user":{"login":"lptr","id":495366,"node_id":"MDQ6VXNlcjQ5NTM2Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/495366?v=4","gravatar_id":"","url":"https://api.github.com/users/lptr","html_url":"https://github.com/lptr","followers_url":"https://api.github.com/users/lptr/followers","following_url":"https://api.github.com/users/lptr/following{/other_user}","gists_url":"https://api.github.com/users/lptr/gists{/gist_id}","starred_url":"https://api.github.com/users/lptr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lptr/subscriptions","organizations_url":"https://api.github.com/users/lptr/orgs","repos_url":"https://api.github.com/users/lptr/repos","events_url":"https://api.github.com/users/lptr/events{/privacy}","received_events_url":"https://api.github.com/users/lptr/received_events","type":"User","site_admin":false},"created_at":"2020-01-06T10:16:04Z","updated_at":"2020-01-06T10:16:04Z","author_association":"MEMBER","body":"How did we not find this problem before? Ah, because we don't have a way to check if script sources load from the cache. Using the execution pipeline for this would have fixed/highlighted the problem."}}
{"actor":{"display_login":"lptr"}}