question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong absolute paths

See original GitHub issue

Im using cmake to generate font in build steps, cmake fills the input and output directories. There is no problem with cmake commands, This program (svgtofont) goes wrong with absolute paths.

cmake definitions:

set(SVG_ICONS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources/svgFont/svg)
set(FONTICONS_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_font)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/svgFont/package.json.in ${CMAKE_CURRENT_BINARY_DIR}/package.json)

package.json.in file:

//  /home/.../project/fonts/package.json.in
"scripts": {
    "font": "svgtofont --sources @SVG_ICONS_DIR@ --output @FONTICONS_OUTPUT_DIR@"
  }

generated package.json file:

//   /home/.../project_build/fonts/package.json
"scripts": {
    "font": "svgtofont --sources  /home/.../project/fonts/svg --output  /home/.../project_build/generated_font"
  }

error:

The directory does not exist! /home/.../project_build/home/.../project/fonts/svg

It appends input path to running path ( the result is someting like this /home/.../project_build/home/.../project/fonts/svg)

A real example:

[user1@fedora GUI]$ npm run font

> font
> svgtofont --sources /home/user1/projects/MainApp/plugins/GUI/resources/svgFont/svg --output /home/user1/builds/build-MainApp-Desktop_Qt_5_15_2_GCC_64bit-Debug/plugins/GUI/generated_font

The directory does not exist! /home/user1/builds/build-MainApp-Desktop_Qt_5_15_2_GCC_64bit-Debug/plugins/GUI/home/user1/projects/MainApp/plugins/GUI/resources/svgFont/svg

I even tested it without cmake and it still had this problem.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jaywcjlovecommented, Nov 15, 2022

@exil Thank you for your explanation, I get it. I fixed it

Upgrade v3.20.0

1reaction
jaywcjlovecommented, Jun 25, 2022

I have no way of knowing the reason for your error. @mmjvox

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto imported file path is wrong (absolute vs relative ... - GitHub
When I try to automatically import something from server/shared/constants.ts to server/validators/file.ts the import string is: import { ...
Read more >
What is the difference between a relative and absolute path?
Information on the differences between a relative and absolute path.
Read more >
Incorrect Absolute File Path - java - Stack Overflow
What you have done is creating a File object representing the file "GameDatabase.csv" in the current working directory (this file does not exist) ......
Read more >
"Error: Detected an absolute file path. Paths starting with '/' are ...
SOLUTION. To solve this, users need to use a relative path instead of an absolute path. This means that the reference is no...
Read more >
Relative and absolute paths, in the file system and on the web ...
If the path is built starting from the system root, it is called absolute. If the path is built starting from the current...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found