Giter VIP home page Giter VIP logo

Comments (4)

lefou avatar lefou commented on June 9, 2024 1

T.workspace exists to avoid the use of os.pwd (As it forces us the always run any Mill tooling in a process bound to that working dir and prohibits future Mill servers that can be shared for multiple projects for example). I think we should change T.workspace to always point to the outer project directory. Although, I said that meta-builds are inaware of their outer builds, that is not completely true. It in deed depends on $-imports of the outer builds. We can still add dependencies with import $ivy. Also, the used Mill version is configured in the outer build. We also special configure the out-dir to be a sub-directory of the outer out-dir. Also @lihaoyi mentioned in a previous discussion about meta-builds, that these were not designed to be re-used by multiple projects. We can't freely use arbitrary projects as meta-builds. Additionally, any meta-build inherit from a special MillBuildRootModule which itself provide API with information about the outer project. All these indicate, that sharing the T.workspace with the top-level project isn't totally wrong.

from mill.

lefou avatar lefou commented on June 9, 2024

I had kind of the same issue with ScalafmtModule and --meta-level 1, but I think, changing the status quo it is a twofold sword. On the one side, the meta-project is completely separate and has no information about the fact that there is a outer module. On the other side, esp. in the context of remote caching, it's problematic that some source files (e.g. the build.sc) are outside of the workspace.

I currently think the name workspace pretty much should always refer to the whole project and we should change the current behavior. If we really need the effective mill project root, which probably relates to the source path of the root module, we should add a new accessor. Would be nice have have some more opinions on that matter. @lihaoyi maybe?

from mill.

lihaoyi avatar lihaoyi commented on June 9, 2024

TBH I'm not sure what the best thing to do here is. I think workspace referring to mill-build/ is great, but as you said having files outside it is problematic. IIRC there were also BSP limitations where we couldn't have multiple modules with the same content root.

from mill.

lolgab avatar lolgab commented on June 9, 2024

Do we have a decision on what we should do? If I know what we want, I can try to contribute a fix.
We could also avoid setting the sourceroot in semanticdb if it doesn't exist (it defaults to the current working directory).

from mill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.