Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use Path.GetFullPath to get the absolute path.#1033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
kmosegaard wants to merge1 commit intoprotobuf-net:main
base:main
Choose a base branch
Loading
fromkmosegaard:make_paths_absolute

Conversation

@kmosegaard
Copy link
Contributor

Possible fix for#1030

@kmosegaardkmosegaard marked this pull request as draftMarch 3, 2023 14:24
@mgravell
Copy link
Member

I'd very much want to understand the full intent and scenarios here; if this is resolving down to the real file system, that's probably not ideal.

What problem are we trying to solve, and how does this fix address it?

@kmosegaard
Copy link
ContributorAuthor

The intent is to remove the.. from the paths given to the AdditionalFiles.

An example could be e.g.

    <AdditionalFiles Include="../../proto/base.proto" />    <AdditionalFiles Include="../../proto/interface/rpc.proto" ImportPaths="../" />

These would be added toAdditionalFilesFileSystem as:

  • {repo dir}/src/App/../../proto/base.proto
  • {repo dir}/src/App/../../proto/interface/rpc.proto

rpc.proto relies on imported definitions frombase.proto. An import path has to be added. If I'm not mistaken the generator tries to findbase.proto (in the virtual file system) at the same path asrpc.proto. Next, it tries to go through the import paths.

As the example is presented, it will try to look forbase.proto at{repo dir}/proto/ which is where it is located. In the look-up logic the path will look like this:{repo dir}/proto/base.proto. When trying to find the path in the virtual file system, it will end up doing this comparison:{repo dir}/src/App/../../proto/base.proto == {repo dir}/proto/base.proto which won't work.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@kmosegaard@mgravell

[8]ページ先頭

©2009-2025 Movatter.jp