Git Product home page Git Product logo

Comments (10)

tshu-w avatar tshu-w commented on June 23, 2024 1

PRs welcome -- if you're game to give it a try, we'd be happy to help you finish off even a half-working attempt.

Sure, will give it a try when I am free.

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on June 23, 2024 1

But we should try fixing this for brew edit. PRs welcome -- if you're game to give it a try, we'd be happy to help you finish off even a half-working attempt.

Agreed. Please scope this logic entirely into dev-cmd/edit.rb if so, thanks!

from brew.

Bo98 avatar Bo98 commented on June 23, 2024

Original issue analysis is incorrect as the sandbox and build.rb doesn't apply here.

But there is overall environment filtering going on and setting HOMEBREW_TEMP does work: HOMEBREW_TEMP=$TMPDIR brew edit karabiner-elements. This perhaps should happen by default for brew edit but currently doesn't.

from brew.

tshu-w avatar tshu-w commented on June 23, 2024

Original issue analysis is incorrect as the sandbox and build.rb doesn't apply here.

Thank you for pointing this out.

But there is overall environment filtering going on and setting HOMEBREW_TEMP does work: HOMEBREW_TEMP=$TMPDIR brew edit karabiner-elements. This perhaps should happen by default for brew edit but currently doesn't.

Is there any side effect if the user sets HOMEBREW_TEMP to TMPDIR globally? Or do I need to wait for changes from brew edit?

from brew.

carlocab avatar carlocab commented on June 23, 2024

Is there any side effect if the user sets HOMEBREW_TEMP to TMPDIR globally?

It could break some builds that get confused by the long paths that TMPDIR typically point to.

If you don't build anything from source you'll probably be fine. If you do encounter build failures, you can always try to unset HOMEBREW_TEMP.

from brew.

tshu-w avatar tshu-w commented on June 23, 2024

Thank you for your reply ;), then I will temporarily leave this issue open. Feel free to close it if your team thinks it should not be implemented for brew edit.

from brew.

carlocab avatar carlocab commented on June 23, 2024

You could probably also set

TMPDIR=/private/tmp

as a likely safer alternative (though I don't think HOMEBREW_TEMP=$TMPDIR is that unsafe either).

But we should try fixing this for brew edit. PRs welcome -- if you're game to give it a try, we'd be happy to help you finish off even a half-working attempt.

from brew.

tshu-w avatar tshu-w commented on June 23, 2024

Hi, after a rough reading of the edit command code I have some doubts.

I don't quite understand why HOMEBREW_TEMP=$TMPDIR brew edit karabiner-elements can work. How does setting HOMEBREW_TEMP affect the access to the sock file in TMPDIR by exec emacsclient? Is it because TMPDIR is reset to HOMEBREW_TEMP during command execution (not found in the code) or is there another reason?

from brew.

MikeMcQuaid avatar MikeMcQuaid commented on June 23, 2024

Is it because TMPDIR is reset to HOMEBREW_TEMP during command execution (not found in the code)

Yes, this is done by bin/brew.

from brew.

tshu-w avatar tshu-w commented on June 23, 2024

Is it because TMPDIR is reset to HOMEBREW_TEMP during command execution (not found in the code)

Yes, this is done by bin/brew.

But bin/brew is just filter TMPDIR and I miss up the logic that sets TMPDIR back to HOMEBREW_TEMP in dev-cmd/edit.rb or other places like

# Set TMPDIR so Xcode's `make` doesn't fall back to `/var/tmp/`,
# which may be not user-writable.
ENV["TMPDIR"] = ENV.fetch("HOMEBREW_TEMP", nil)
. So I am really confused why HOMEBREW_TEMP=$TMPDIR brew edit karabiner-elements work.

from brew.

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.